changeset 29689:12f04946053c

journal: use fm.hexfunc() to get full hash in JSON/template output (BC) We generally do that.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 31 Jul 2016 16:38:16 +0900
parents 996cc60da32c
children c3a9cd78b151
files hgext/journal.py tests/test-journal.t
diffstat 2 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/journal.py	Thu Aug 04 00:04:48 2016 +0530
+++ b/hgext/journal.py	Sun Jul 31 16:38:16 2016 +0900
@@ -475,8 +475,8 @@
     for count, entry in enumerate(repo.journal.filtered(name=name)):
         if count == limit:
             break
-        newhashesstr = ','.join([node.short(hash) for hash in entry.newhashes])
-        oldhashesstr = ','.join([node.short(hash) for hash in entry.oldhashes])
+        newhashesstr = ','.join([fm.hexfunc(hash) for hash in entry.newhashes])
+        oldhashesstr = ','.join([fm.hexfunc(hash) for hash in entry.oldhashes])
 
         fm.startitem()
         fm.condwrite(ui.verbose, 'oldhashes', '%s -> ', oldhashesstr)
--- a/tests/test-journal.t	Thu Aug 04 00:04:48 2016 +0530
+++ b/tests/test-journal.t	Sun Jul 31 16:38:16 2016 +0900
@@ -148,32 +148,32 @@
     "command": "up",
     "date": "1970-01-01 00:00 +0000",
     "name": ".",
-    "newhashes": "1e6c11564562",
-    "oldhashes": "cb9a9f314b8b",
+    "newhashes": "1e6c11564562b4ed919baca798bc4338bd299d6a",
+    "oldhashes": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b",
     "user": "foobar"
    },
    {
     "command": "up 0",
     "date": "1970-01-01 00:00 +0000",
     "name": ".",
-    "newhashes": "cb9a9f314b8b",
-    "oldhashes": "1e6c11564562",
+    "newhashes": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b",
+    "oldhashes": "1e6c11564562b4ed919baca798bc4338bd299d6a",
     "user": "foobar"
    },
    {
     "command": "commit -Aqm b",
     "date": "1970-01-01 00:00 +0000",
     "name": ".",
-    "newhashes": "1e6c11564562",
-    "oldhashes": "cb9a9f314b8b",
+    "newhashes": "1e6c11564562b4ed919baca798bc4338bd299d6a",
+    "oldhashes": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b",
     "user": "foobar"
    },
    {
     "command": "commit -Aqm a",
     "date": "1970-01-01 00:00 +0000",
     "name": ".",
-    "newhashes": "cb9a9f314b8b",
-    "oldhashes": "000000000000",
+    "newhashes": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b",
+    "oldhashes": "0000000000000000000000000000000000000000",
     "user": "foobar"
    }
   ]