Happily, this resolves an import cycle!
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
marmoute | |
indygreg |
hg-reviewers |
Happily, this resolves an import cycle!
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/fileset.py (5 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
ae83bc916d12 | b25d90613f2b | Augie Fackler | May 18 2020, 4:45 PM |
import re | import re | ||||
from .i18n import _ | from .i18n import _ | ||||
from .pycompat import getattr | from .pycompat import getattr | ||||
from . import ( | from . import ( | ||||
error, | error, | ||||
filesetlang, | filesetlang, | ||||
match as matchmod, | match as matchmod, | ||||
mergestate as mergestatemod, | |||||
pycompat, | pycompat, | ||||
registrar, | registrar, | ||||
scmutil, | scmutil, | ||||
util, | util, | ||||
) | ) | ||||
from .utils import stringutil | from .utils import stringutil | ||||
# common weight constants | # common weight constants | ||||
@predicate(b'resolved()', weight=_WEIGHT_STATUS) | @predicate(b'resolved()', weight=_WEIGHT_STATUS) | ||||
def resolved(mctx, x): | def resolved(mctx, x): | ||||
"""File that is marked resolved according to :hg:`resolve -l`. | """File that is marked resolved according to :hg:`resolve -l`. | ||||
""" | """ | ||||
# i18n: "resolved" is a keyword | # i18n: "resolved" is a keyword | ||||
getargs(x, 0, 0, _(b"resolved takes no arguments")) | getargs(x, 0, 0, _(b"resolved takes no arguments")) | ||||
if mctx.ctx.rev() is not None: | if mctx.ctx.rev() is not None: | ||||
return mctx.never() | return mctx.never() | ||||
ms = mergestatemod.mergestate.read(mctx.ctx.repo()) | ms = mctx.ctx.mergestate() | ||||
return mctx.predicate( | return mctx.predicate( | ||||
lambda f: f in ms and ms[f] == b'r', predrepr=b'resolved' | lambda f: f in ms and ms[f] == b'r', predrepr=b'resolved' | ||||
) | ) | ||||
@predicate(b'unresolved()', weight=_WEIGHT_STATUS) | @predicate(b'unresolved()', weight=_WEIGHT_STATUS) | ||||
def unresolved(mctx, x): | def unresolved(mctx, x): | ||||
"""File that is marked unresolved according to :hg:`resolve -l`. | """File that is marked unresolved according to :hg:`resolve -l`. | ||||
""" | """ | ||||
# i18n: "unresolved" is a keyword | # i18n: "unresolved" is a keyword | ||||
getargs(x, 0, 0, _(b"unresolved takes no arguments")) | getargs(x, 0, 0, _(b"unresolved takes no arguments")) | ||||
if mctx.ctx.rev() is not None: | if mctx.ctx.rev() is not None: | ||||
return mctx.never() | return mctx.never() | ||||
ms = mergestatemod.mergestate.read(mctx.ctx.repo()) | ms = mctx.ctx.mergestate() | ||||
return mctx.predicate( | return mctx.predicate( | ||||
lambda f: f in ms and ms[f] == b'u', predrepr=b'unresolved' | lambda f: f in ms and ms[f] == b'u', predrepr=b'unresolved' | ||||
) | ) | ||||
@predicate(b'hgignore()', weight=_WEIGHT_STATUS) | @predicate(b'hgignore()', weight=_WEIGHT_STATUS) | ||||
def hgignore(mctx, x): | def hgignore(mctx, x): | ||||
"""File that matches the active .hgignore pattern. | """File that matches the active .hgignore pattern. |