Submitter | Yuya Nishihara |
---|---|
Date | July 3, 2018, 1:26 p.m. |
Message ID | <32caef1aff8134dc1ca3.1530624366@mimosa> |
Download | mbox | patch |
Permalink | /patch/32582/ |
State | Accepted |
Headers | show |
Comments
Patch
diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2634,6 +2634,7 @@ def grep(ui, repo, pattern, *pats, **opt 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 --git a/tests/test-grep.t b/tests/test-grep.t --- a/tests/test-grep.t +++ b/tests/test-grep.t @@ -53,6 +53,11 @@ simple templated 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