Mercurial > public > mercurial-scm > hg
comparison mercurial/fileset.py @ 44856:b7808443ed6a
mergestate: split out merge state handling code from main merge module
There's already some pretty reasonable encapsulation here, but I want
to make the mergestate storage a property of the context so memctx
instances can do a reasonable thing. This is the first step in a
reshuffle to make that easier.
Differential Revision: https://phab.mercurial-scm.org/D8550
author | Augie Fackler <augie@google.com> |
---|---|
date | Mon, 18 May 2020 14:59:59 -0400 |
parents | e685fac56693 |
children | 89a2afe31e82 |
comparison
equal
deleted
inserted
replaced
44855:1d2d353e5c4a | 44856:b7808443ed6a |
---|---|
14 from .pycompat import getattr | 14 from .pycompat import getattr |
15 from . import ( | 15 from . import ( |
16 error, | 16 error, |
17 filesetlang, | 17 filesetlang, |
18 match as matchmod, | 18 match as matchmod, |
19 merge, | 19 mergestate as mergestatemod, |
20 pycompat, | 20 pycompat, |
21 registrar, | 21 registrar, |
22 scmutil, | 22 scmutil, |
23 util, | 23 util, |
24 ) | 24 ) |
243 """ | 243 """ |
244 # i18n: "resolved" is a keyword | 244 # i18n: "resolved" is a keyword |
245 getargs(x, 0, 0, _(b"resolved takes no arguments")) | 245 getargs(x, 0, 0, _(b"resolved takes no arguments")) |
246 if mctx.ctx.rev() is not None: | 246 if mctx.ctx.rev() is not None: |
247 return mctx.never() | 247 return mctx.never() |
248 ms = merge.mergestate.read(mctx.ctx.repo()) | 248 ms = mergestatemod.mergestate.read(mctx.ctx.repo()) |
249 return mctx.predicate( | 249 return mctx.predicate( |
250 lambda f: f in ms and ms[f] == b'r', predrepr=b'resolved' | 250 lambda f: f in ms and ms[f] == b'r', predrepr=b'resolved' |
251 ) | 251 ) |
252 | 252 |
253 | 253 |
257 """ | 257 """ |
258 # i18n: "unresolved" is a keyword | 258 # i18n: "unresolved" is a keyword |
259 getargs(x, 0, 0, _(b"unresolved takes no arguments")) | 259 getargs(x, 0, 0, _(b"unresolved takes no arguments")) |
260 if mctx.ctx.rev() is not None: | 260 if mctx.ctx.rev() is not None: |
261 return mctx.never() | 261 return mctx.never() |
262 ms = merge.mergestate.read(mctx.ctx.repo()) | 262 ms = mergestatemod.mergestate.read(mctx.ctx.repo()) |
263 return mctx.predicate( | 263 return mctx.predicate( |
264 lambda f: f in ms and ms[f] == b'u', predrepr=b'unresolved' | 264 lambda f: f in ms and ms[f] == b'u', predrepr=b'unresolved' |
265 ) | 265 ) |
266 | 266 |
267 | 267 |