changeset 38542:7ae0ea739770

files: add support for log-like template keywords and functions Note that the ctx does not point to the revision where the file was last changed, but the revision specified by -rREV option.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 01 Jul 2018 22:01:20 +0900
parents 475f5f86eaed
children ece3f2d0bbd9
files mercurial/cmdutil.py tests/test-manifest.t
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Sun Jul 01 21:55:37 2018 +0900
+++ b/mercurial/cmdutil.py	Sun Jul 01 22:01:20 2018 +0900
@@ -2144,6 +2144,7 @@
     needsfctx = ui.verbose or {'size', 'flags'} & fm.datahint()
     for f in ctx.matches(m):
         fm.startitem()
+        fm.context(ctx=ctx)
         if needsfctx:
             fc = ctx[f]
             fm.write('size flags', '% 10d % 1s ', fc.size(), fc.flags())
--- a/tests/test-manifest.t	Sun Jul 01 21:55:37 2018 +0900
+++ b/tests/test-manifest.t	Sun Jul 01 22:01:20 2018 +0900
@@ -41,6 +41,10 @@
   a 2 
   b/a 2 x
   l 1 l
+  $ hg files -T '{path} {node|shortest}\n' -r.
+  a 5bdc
+  b/a 5bdc
+  l 5bdc
 
   $ hg manifest -v
   644   a