changeset 22554:bfc50ff55f3f

tags: use full hash for formatter output as in log or annotate commands
author Yuya Nishihara <yuya@tcha.org>
date Sun, 21 Sep 2014 12:50:48 +0900
parents 67b6b82a6bbe
children 2143d794e960
files mercurial/commands.py tests/test-encoding.t
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Sun Sep 21 12:46:23 2014 +0900
+++ b/mercurial/commands.py	Sun Sep 21 12:50:48 2014 +0900
@@ -5999,7 +5999,10 @@
     """
 
     fm = ui.formatter('tags', opts)
-    hexfunc = ui.debugflag and hex or short
+    if fm or ui.debugflag:
+        hexfunc = hex
+    else:
+        hexfunc = short
     tagtype = ""
 
     for t, n in reversed(repo.tagslist()):
--- a/tests/test-encoding.t	Sun Sep 21 12:46:23 2014 +0900
+++ b/tests/test-encoding.t	Sun Sep 21 12:50:48 2014 +0900
@@ -184,13 +184,13 @@
   $ hg tags -Tjson
   [
    {
-    "node": "a52c0692f24a",
+    "node": "a52c0692f24ad921c0a31e1736e7635a8b23b670",
     "rev": 5,
     "tag": "tip",
     "type": ""
    },
    {
-    "node": "ca661e7520de",
+    "node": "ca661e7520dec3f5438a63590c350bebadb04989",
     "rev": 3,
     "tag": "\xc3\xa9", (esc)
     "type": ""