##// END OF EJS Templates
annotate: automatically populate fields referenced from template...
Yuya Nishihara -
r38377:57dc72b5 default
parent child Browse files
Show More
@@ -359,11 +359,12 b' def annotate(ui, repo, *pats, **opts):'
359 else:
359 else:
360 def makefunc(get, fmt):
360 def makefunc(get, fmt):
361 return get
361 return get
362 datahint = rootfm.datahint()
362 funcmap = [(makefunc(get, fmt), sep) for fn, sep, get, fmt in opmap
363 funcmap = [(makefunc(get, fmt), sep) for fn, sep, get, fmt in opmap
363 if opts.get(opnamemap.get(fn, fn))]
364 if opts.get(opnamemap.get(fn, fn)) or fn in datahint]
364 funcmap[0] = (funcmap[0][0], '') # no separator in front of first column
365 funcmap[0] = (funcmap[0][0], '') # no separator in front of first column
365 fields = ' '.join(fn for fn, sep, get, fmt in opmap
366 fields = ' '.join(fn for fn, sep, get, fmt in opmap
366 if opts.get(opnamemap.get(fn, fn)))
367 if opts.get(opnamemap.get(fn, fn)) or fn in datahint)
367
368
368 def bad(x, y):
369 def bad(x, y):
369 raise error.Abort("%s: %s" % (x, y))
370 raise error.Abort("%s: %s" % (x, y))
@@ -76,6 +76,11 b' log-like templating'
76 $ hg annotate -T'{lines % "{rev} {node|shortest}: {line}"}' a
76 $ hg annotate -T'{lines % "{rev} {node|shortest}: {line}"}' a
77 0 8435: a
77 0 8435: a
78
78
79 '{line_number}' field should be populated as necessary
80
81 $ hg annotate -T'{lines % "{rev}:{line_number}: {line}"}' a
82 0:1: a
83
79 $ cat <<EOF >>a
84 $ cat <<EOF >>a
80 > a
85 > a
81 > a
86 > a
General Comments 0
You need to be logged in to leave comments. Login now