# HG changeset patch # User Pierre-Yves David # Date 1521711481 -3600 # Node ID 9f2ba8ef517b4d5b0a611242f006812e13ca48fa # Parent f60afeb2819221b2e199a49697e9ffb42c68ff65 template: drop some 4.1 compatibility code Simplify all the things. diff -r f60afeb28192 -r 9f2ba8ef517b hgext3rd/evolve/templatekw.py --- a/hgext3rd/evolve/templatekw.py Thu Mar 22 10:35:27 2018 +0100 +++ b/hgext3rd/evolve/templatekw.py Thu Mar 22 10:38:01 2018 +0100 @@ -91,12 +91,7 @@ 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(p[:12] for p in precursors)) - return templatekw._hybrid(gen.__iter__(), precursors, lambda x: {'precursor': x}, + return templatekw._hybrid(None, precursors, lambda x: {'precursor': x}, lambda d: d['precursor'][:12]) def closestsuccessors(repo, nodeid):