# HG changeset patch # User Pierre-Yves David # Date 1497625880 -7200 # Node ID df4a1b02308f959a60c2239232cea1b4dd492a93 # Parent ed977325cd2ab6f49dbc0d201c10450247634f2f template: used hex-node for the precursors underlying data As pointed by yuya on mercurial-dev we should not use binary node here. diff -r ed977325cd2a -r df4a1b02308f hgext3rd/evolve/templatekw.py --- a/hgext3rd/evolve/templatekw.py Fri Jun 16 09:22:39 2017 +0200 +++ b/hgext3rd/evolve/templatekw.py Fri Jun 16 17:11:20 2017 +0200 @@ -69,14 +69,15 @@ displayed """ precursors = sorted(closestprecursors(repo, ctx.node())) + precursors = [node.hex(p) for p in precursors] # <= hg-4.1 requires an explicite gen. # we can use None once the support is dropped # # They also requires an iterator instead of an iterable. - gen = iter(" ".join(map(node.short, precursors))) + gen = iter(" ".join(p[:12] for p in precursors)) return templatekw._hybrid(gen.__iter__(), precursors, lambda x: {'precursor': x}, - lambda d: "%s" % node.short(d['precursor'])) + lambda d: d['precursor'][:12]) def closestsuccessors(repo, nodeid): """ returns the closest visible successors sets instead. diff -r ed977325cd2a -r df4a1b02308f tests/test-evolve-templates.t --- a/tests/test-evolve-templates.t Fri Jun 16 09:22:39 2017 +0200 +++ b/tests/test-evolve-templates.t Fri Jun 16 17:11:20 2017 +0200 @@ -117,6 +117,17 @@ | o ea207398892e + +(check json) + + $ hg log -GT '{precursors|json}\n' + o ["471f378eab4c5e25f6c77f785b27c936efb22874"] + | + | @ [] + |/ + o [] + + $ hg up 'desc(A1)' --hidden 1 files updated, 0 files merged, 0 files removed, 0 files unresolved working directory parent is obsolete! (a468dc9b3633)