From patchwork Fri Feb 26 18:12:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2,of,3,v2] annotate: unify template output to use abspath From: timeless@mozdev.org X-Patchwork-Id: 13424 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Fri, 26 Feb 2016 12:12:41 -0600 # HG changeset patch # User timeless # Date 1456509834 0 # Fri Feb 26 18:03:54 2016 +0000 # Node ID d66dc235bd21ed08c5661fd62604d0c1bcfd0f8a # Parent 7e94be4f7b542404823ae92ce3c6518bdc7d7257 annotate: unify template output to use abspath Before this change, annotate used "file", which was inaccurate, the field is actually an abspath. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -390,7 +390,11 @@ ('file', ' ', lambda x: x[0].path(), str), ('line_number', ':', lambda x: x[1], str), ] - fieldnamemap = {'number': 'rev', 'changeset': 'node'} + fieldnamemap = { + 'changeset': 'node', + 'file': 'abspath', + 'number': 'rev', + } if (not opts.get('user') and not opts.get('changeset') and not opts.get('date') and not opts.get('file')): diff --git a/tests/test-annotate.t b/tests/test-annotate.t --- a/tests/test-annotate.t +++ b/tests/test-annotate.t @@ -64,8 +64,8 @@ $ hg annotate -Tjson -cdfnul a [ { + "abspath": "a", "date": [1.0, 0], - "file": "a", "line": "a\n", "line_number": 1, "node": "8435f90966e442695d2ded29fdade2bac5ad8065",