comparison mercurial/cmdutil.py @ 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 152f4822d210
comparison
equal deleted inserted replaced
38541:475f5f86eaed 38542:7ae0ea739770
2142 ret = 1 2142 ret = 1
2143 2143
2144 needsfctx = ui.verbose or {'size', 'flags'} & fm.datahint() 2144 needsfctx = ui.verbose or {'size', 'flags'} & fm.datahint()
2145 for f in ctx.matches(m): 2145 for f in ctx.matches(m):
2146 fm.startitem() 2146 fm.startitem()
2147 fm.context(ctx=ctx)
2147 if needsfctx: 2148 if needsfctx:
2148 fc = ctx[f] 2149 fc = ctx[f]
2149 fm.write('size flags', '% 10d % 1s ', fc.size(), fc.flags()) 2150 fm.write('size flags', '% 10d % 1s ', fc.size(), fc.flags())
2150 fm.data(abspath=f) 2151 fm.data(abspath=f)
2151 fm.write('path', fmt, m.rel(f)) 2152 fm.write('path', fmt, m.rel(f))