Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 38545:e8c33e27ee9b
resolve: add support for log-like template keywords and functions
It uses wctx as the associated revision since "hg resolve" is the command
to manipulate the working directory files.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 01 Jul 2018 22:11:23 +0900 |
parents | ece3f2d0bbd9 |
children | 85e3aa21bcdc |
comparison
equal
deleted
inserted
replaced
38544:ece3f2d0bbd9 | 38545:e8c33e27ee9b |
---|---|
4532 | 4532 |
4533 if show: | 4533 if show: |
4534 ui.pager('resolve') | 4534 ui.pager('resolve') |
4535 fm = ui.formatter('resolve', opts) | 4535 fm = ui.formatter('resolve', opts) |
4536 ms = mergemod.mergestate.read(repo) | 4536 ms = mergemod.mergestate.read(repo) |
4537 m = scmutil.match(repo[None], pats, opts) | 4537 wctx = repo[None] |
4538 m = scmutil.match(wctx, pats, opts) | |
4538 | 4539 |
4539 # Labels and keys based on merge state. Unresolved path conflicts show | 4540 # Labels and keys based on merge state. Unresolved path conflicts show |
4540 # as 'P'. Resolved path conflicts show as 'R', the same as normal | 4541 # as 'P'. Resolved path conflicts show as 'R', the same as normal |
4541 # resolved conflicts. | 4542 # resolved conflicts. |
4542 mergestateinfo = { | 4543 mergestateinfo = { |
4552 if not m(f): | 4553 if not m(f): |
4553 continue | 4554 continue |
4554 | 4555 |
4555 label, key = mergestateinfo[ms[f]] | 4556 label, key = mergestateinfo[ms[f]] |
4556 fm.startitem() | 4557 fm.startitem() |
4558 fm.context(ctx=wctx) | |
4557 fm.condwrite(not nostatus, 'status', '%s ', key, label=label) | 4559 fm.condwrite(not nostatus, 'status', '%s ', key, label=label) |
4558 fm.write('path', '%s\n', f, label=label) | 4560 fm.write('path', '%s\n', f, label=label) |
4559 fm.end() | 4561 fm.end() |
4560 return 0 | 4562 return 0 |
4561 | 4563 |