template: fix precursors template for older mercurial version
In mercurial 4.1 and below templatekw._hybrid require the gen argument to be different
than None. Manually compute the same default output for these older mercurial
versions.
--- a/hgext3rd/evolve/templatekw.py Tue May 30 13:16:43 2017 +0200
+++ b/hgext3rd/evolve/templatekw.py Tue May 30 19:43:14 2017 +0200
@@ -69,7 +69,10 @@
displayed
"""
precursors = sorted(closestprecursors(repo, ctx.node()))
- return templatekw._hybrid(None, precursors, lambda x: {'precursor': x},
+ # <= hg-4.1 requires an explicite gen.
+ # we can use None once the support is dropped
+ gen = " ".join(map(node.short, precursors))
+ return templatekw._hybrid(gen, precursors, lambda x: {'precursor': x},
lambda d: "%s" % node.short(d['precursor']))
def closestsuccessors(repo, nodeid):