# HG changeset patch # User Yuya Nishihara # Date 1530449263 -32400 # Node ID b1bbff1dd99a160288910700724364354ab8cc32 # Parent 2f710498485704d6e26c6a1316b20a0f1c12549e cat: add support for log-like template keywords and functions diff -r 2f7104984857 -r b1bbff1dd99a mercurial/cmdutil.py --- a/mercurial/cmdutil.py Sun Jul 01 22:22:07 2018 +0900 +++ b/mercurial/cmdutil.py Sun Jul 01 21:47:43 2018 +0900 @@ -2290,6 +2290,7 @@ if decode: data = ctx.repo().wwritedata(path, data) fm.startitem() + fm.context(ctx=ctx) fm.write('data', '%s', data) fm.data(abspath=path, path=matcher.rel(path)) diff -r 2f7104984857 -r b1bbff1dd99a tests/test-cat.t --- a/tests/test-cat.t Sun Jul 01 22:22:07 2018 +0900 +++ b/tests/test-cat.t Sun Jul 01 21:47:43 2018 +0900 @@ -65,10 +65,10 @@ Test template output - $ hg --cwd tmp cat ../b ../c -T '== {path} ({abspath}) ==\n{data}' - == ../b (b) == + $ hg --cwd tmp cat ../b ../c -T '== {path} ({abspath}) r{rev} ==\n{data}' + == ../b (b) r2 == 1 - == ../c (c) == + == ../c (c) r2 == 3 $ hg cat b c -Tjson --output -