Commit f721d7b5 authored by Yuya Nishihara's avatar Yuya Nishihara
Browse files

annotate: add support for template keywords and functions depending on ctx

parent 939e0983c1d9
......@@ -405,14 +405,15 @@ def annotate(ui, repo, *pats, **opts):
formats.append(['%s' for x in l])
pieces.append(l)
for f, p, l in zip(zip(*formats), zip(*pieces), lines):
for f, p, (n, l) in zip(zip(*formats), zip(*pieces), lines):
fm.startitem()
fm.context(fctx=n.fctx)
fm.write(fields, "".join(f), *p)
if l[0].skip:
if n.skip:
fmt = "* %s"
else:
fmt = ": %s"
fm.write('line', fmt, l[1])
fm.write('line', fmt, l)
if not lines[-1][1].endswith('\n'):
fm.plain('\n')
......
......@@ -71,6 +71,11 @@ annotate (JSON)
}
]
log-like templating
$ hg annotate -T'{lines % "{rev} {node|shortest}: {line}"}' a
0 8435: a
$ cat <<EOF >>a
> a
> a
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment