Details
Details
- Reviewers
marmoute indygreg - Group Reviewers
hg-reviewers
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
marmoute | |
indygreg |
hg-reviewers |
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/commands.py (6 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
5f133c786485 | 0ea3ad23312e | Augie Fackler | May 18 2020, 4:45 PM |
): | ): | ||||
raise error.Abort(_(b'user quit')) | raise error.Abort(_(b'user quit')) | ||||
uipathfn = scmutil.getuipathfn(repo) | uipathfn = scmutil.getuipathfn(repo) | ||||
if show: | if show: | ||||
ui.pager(b'resolve') | ui.pager(b'resolve') | ||||
fm = ui.formatter(b'resolve', opts) | fm = ui.formatter(b'resolve', opts) | ||||
ms = mergestatemod.mergestate.read(repo) | ms = repo[None].mergestate() | ||||
wctx = repo[None] | wctx = repo[None] | ||||
m = scmutil.match(wctx, pats, opts) | m = scmutil.match(wctx, pats, opts) | ||||
# Labels and keys based on merge state. Unresolved path conflicts show | # Labels and keys based on merge state. Unresolved path conflicts show | ||||
# as 'P'. Resolved path conflicts show as 'R', the same as normal | # as 'P'. Resolved path conflicts show as 'R', the same as normal | ||||
# resolved conflicts. | # resolved conflicts. | ||||
mergestateinfo = { | mergestateinfo = { | ||||
mergestatemod.MERGE_RECORD_UNRESOLVED: ( | mergestatemod.MERGE_RECORD_UNRESOLVED: ( | ||||
fm.context(ctx=wctx) | fm.context(ctx=wctx) | ||||
fm.condwrite(not nostatus, b'mergestatus', b'%s ', key, label=label) | fm.condwrite(not nostatus, b'mergestatus', b'%s ', key, label=label) | ||||
fm.data(path=f) | fm.data(path=f) | ||||
fm.plain(b'%s\n' % uipathfn(f), label=label) | fm.plain(b'%s\n' % uipathfn(f), label=label) | ||||
fm.end() | fm.end() | ||||
return 0 | return 0 | ||||
with repo.wlock(): | with repo.wlock(): | ||||
ms = mergestatemod.mergestate.read(repo) | ms = repo[None].mergestate() | ||||
if not (ms.active() or repo.dirstate.p2() != nullid): | if not (ms.active() or repo.dirstate.p2() != nullid): | ||||
raise error.Abort( | raise error.Abort( | ||||
_(b'resolve command not applicable when not merging') | _(b'resolve command not applicable when not merging') | ||||
) | ) | ||||
wctx = repo[None] | wctx = repo[None] | ||||
opts = pycompat.byteskwargs(opts) | opts = pycompat.byteskwargs(opts) | ||||
ui.pager(b'summary') | ui.pager(b'summary') | ||||
ctx = repo[None] | ctx = repo[None] | ||||
parents = ctx.parents() | parents = ctx.parents() | ||||
pnode = parents[0].node() | pnode = parents[0].node() | ||||
marks = [] | marks = [] | ||||
try: | try: | ||||
ms = mergestatemod.mergestate.read(repo) | ms = repo[None].mergestate() | ||||
except error.UnsupportedMergeRecords as e: | except error.UnsupportedMergeRecords as e: | ||||
s = b' '.join(e.recordtypes) | s = b' '.join(e.recordtypes) | ||||
ui.warn( | ui.warn( | ||||
_(b'warning: merge state has unsupported record types: %s\n') % s | _(b'warning: merge state has unsupported record types: %s\n') % s | ||||
) | ) | ||||
unresolved = [] | unresolved = [] | ||||
else: | else: | ||||
unresolved = list(ms.unresolved()) | unresolved = list(ms.unresolved()) |