# HG changeset patch # User Yuya Nishihara # Date 1530450173 -32400 # Node ID 1e25782a7583a3ccf8fcc9d81a9fcf1e5e10893b # Parent b1bbff1dd99a160288910700724364354ab8cc32 grep: add support for log-like template keywords and functions diff -r b1bbff1dd99a -r 1e25782a7583 mercurial/commands.py --- a/mercurial/commands.py Sun Jul 01 21:47:43 2018 +0900 +++ b/mercurial/commands.py Sun Jul 01 22:02:53 2018 +0900 @@ -2634,6 +2634,7 @@ iter = [('', l) for l in states] for change, l in iter: fm.startitem() + fm.context(ctx=ctx) fm.data(node=fm.hexfunc(scmutil.binnode(ctx))) cols = [ diff -r b1bbff1dd99a -r 1e25782a7583 tests/test-grep.t --- a/tests/test-grep.t Sun Jul 01 21:47:43 2018 +0900 +++ b/tests/test-grep.t Sun Jul 01 22:02:53 2018 +0900 @@ -53,6 +53,11 @@ port:4:vaportight port:4:import/export + $ hg grep port -T '{file}:{tags}:{texts}\n' + port:tip:export + port:tip:vaportight + port:tip:import/export + simple JSON (no "change" field) $ hg grep -Tjson port