From patchwork Tue Jul 3 13:26:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [8, of, 8] status: add support for log-like template keywords and functions From: Yuya Nishihara X-Patchwork-Id: 32587 Message-Id: <3b536d74a296aadb1e8b.1530624371@mimosa> To: mercurial-devel@mercurial-scm.org Date: Tue, 03 Jul 2018 22:26:11 +0900 # HG changeset patch # User Yuya Nishihara # Date 1530451126 -32400 # Sun Jul 01 22:18:46 2018 +0900 # Node ID 3b536d74a296aadb1e8b15edb446ed7709b8e5ec # Parent c5970d8c9a15a4d4fbc1562d819e5aef4186ef84 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 [ {