changeset 38544: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
files mercurial/commands.py tests/test-resolve.t
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Sun Jul 01 22:06:53 2018 +0900
+++ b/mercurial/commands.py	Sun Jul 01 22:11:23 2018 +0900
@@ -4534,7 +4534,8 @@
         ui.pager('resolve')
         fm = ui.formatter('resolve', opts)
         ms = mergemod.mergestate.read(repo)
-        m = scmutil.match(repo[None], pats, opts)
+        wctx = repo[None]
+        m = scmutil.match(wctx, pats, opts)
 
         # Labels and keys based on merge state.  Unresolved path conflicts show
         # as 'P'.  Resolved path conflicts show as 'R', the same as normal
@@ -4554,6 +4555,7 @@
 
             label, key = mergestateinfo[ms[f]]
             fm.startitem()
+            fm.context(ctx=wctx)
             fm.condwrite(not nostatus, 'status', '%s ', key, label=label)
             fm.write('path', '%s\n', f, label=label)
         fm.end()
--- a/tests/test-resolve.t	Sun Jul 01 22:06:53 2018 +0900
+++ b/tests/test-resolve.t	Sun Jul 01 22:11:23 2018 +0900
@@ -162,6 +162,10 @@
    }
   ]
 
+  $ hg resolve -l -T '{path} {status} {p1rev} {p2rev}\n'
+  file1 R 2 1
+  file2 U 2 1
+
 resolve -m without paths should mark all resolved
 
   $ hg resolve -m