template: drop some 4.1 compatibility code
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 22 Mar 2018 10:38:01 +0100
changeset 3606 9f2ba8ef517b
parent 3605 f60afeb28192
child 3607 5e2cfa64860c
template: drop some 4.1 compatibility code Simplify all the things.
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):