# HG changeset patch # User Yuya Nishihara # Date 2018-07-01 13:18:46 # Node ID 85e3aa21bcdc8461b9355ba571d03b1d25756e0b # Parent e8c33e27ee9b8bd1b0170a926597e8d6e378b5c3 status: add support for log-like template keywords and functions It's bound to ctx2 since "hg status" can be considered to show the status of the files at ctx2 given ctx1 as the base. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -5117,6 +5117,7 @@ def status(ui, repo, *pats, **opts): label = 'status.' + state for f in files: fm.startitem() + fm.context(ctx=ctx2) fm.condwrite(showchar, 'status', '%s ', char, label=label) fm.write('path', fmt, repo.pathto(f, cwd), label=label) if f in copy: diff --git a/tests/test-status.t b/tests/test-status.t --- a/tests/test-status.t +++ b/tests/test-status.t @@ -213,6 +213,16 @@ hg status -A: C .hgignore C modified + $ hg status -A -T '{status} {path} {node|shortest}\n' + A added ffff + A copied ffff + R removed ffff + ! deleted ffff + ? unknown ffff + I ignored ffff + C .hgignore ffff + C modified ffff + $ hg status -A -Tjson [ {