template: use hex-node in successors
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 16 Jun 2017 17:21:49 +0200
changeset 2602 31d3be16e65c
parent 2601 20c1e035101b
child 2603 23f1c3b9052f
template: use hex-node in successors AS pointed by yuya on the list, the raw data for the template should be hex and not binary.
hgext3rd/evolve/templatekw.py
tests/test-evolve-templates.t
--- a/hgext3rd/evolve/templatekw.py	Fri Jun 16 17:16:26 2017 +0200
+++ b/hgext3rd/evolve/templatekw.py	Fri Jun 16 17:21:49 2017 +0200
@@ -93,11 +93,12 @@
         return ''
 
     ssets, _ = closestsuccessors(repo, ctx.node())
+    ssets = [[node.hex(n) for n in ss] for ss in ssets]
 
     data = []
     gen = []
     for ss in ssets:
-        subgen = '[%s]' % ', '.join(map(node.short, ss))
+        subgen = '[%s]' % ', '.join(n[:12] for n in ss)
         gen.append(subgen)
         h = templatekw._hybrid(iter(subgen), ss, lambda x: {'successor': x},
                                lambda d: "%s" % d["successor"])
--- a/tests/test-evolve-templates.t	Fri Jun 16 17:16:26 2017 +0200
+++ b/tests/test-evolve-templates.t	Fri Jun 16 17:21:49 2017 +0200
@@ -128,6 +128,14 @@
   o  []
   
 
+  $ hg log -GT '{successors|json}\n'
+  o  ""
+  |
+  | @  [["d004c8f274b9ec480a47a93c10dac5eee63adb78"]]
+  |/
+  o  ""
+  
+
   $ hg up 'desc(A1)' --hidden
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   working directory parent is obsolete! (a468dc9b3633)