# HG changeset patch # User Boris Feld # Date 1496166194 -7200 # Node ID f4acfbb361919e7cc34bdcfd5b9f9163b54b60a9 # Parent 5adb8bdb935e330326e5196c79fa95de4ac1138e 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. diff -r 5adb8bdb935e -r f4acfbb36191 hgext3rd/evolve/templatekw.py --- 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):