compat: drop 4.3 compatiblity code for 'successors' revset
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 19 Nov 2018 01:42:50 +0000
changeset 4256 e7e154b2388b
parent 4255 7661706dc14d
child 4257 4a8f59b69d37
compat: drop 4.3 compatiblity code for 'successors' revset
hgext3rd/evolve/templatekw.py
--- a/hgext3rd/evolve/templatekw.py	Mon Nov 19 01:41:36 2018 +0000
+++ b/hgext3rd/evolve/templatekw.py	Mon Nov 19 01:42:50 2018 +0000
@@ -17,7 +17,6 @@
 
 from mercurial import (
     templatekw,
-    node,
     util
 )
 
@@ -48,35 +47,7 @@
     """
     return directsuccessorssets(repo, nodeid)
 
-if util.safehasattr(templatekw, 'showsuccessorssets'):
-    templatekw.keywords["successors"] = templatekw.showsuccessorssets
-else:
-    # for version <= hg4.3
-
-    @eh.templatekw("successors")
-    def shownextvisiblesuccessors(repo, ctx, templ, **args):
-        """Returns a string of sets of successors for a changectx
-
-        Format used is: [ctx1, ctx2], [ctx3] if ctx has been splitted into ctx1 and
-        ctx2 while also diverged into ctx3"""
-        if not ctx.obsolete():
-            return ''
-
-        ssets, _ = closestsuccessors(repo, ctx.node())
-        ssets = [[node.hex(n) for n in ss] for ss in ssets]
-
-        data = []
-        gen = []
-        for ss in ssets:
-            subgen = '[%s]' % ', '.join(n[:12] for n in ss)
-            gen.append(subgen)
-            h = templatekw._hybrid(iter(subgen), ss, lambda x: {'successor': x},
-                                   lambda d: "%s" % d["successor"])
-            data.append(h)
-
-        gen = ', '.join(gen)
-        return templatekw._hybrid(iter(gen), data, lambda x: {'successorset': x},
-                                  lambda d: d["successorset"])
+templatekw.keywords["successors"] = templatekw.showsuccessorssets
 
 def _getusername(ui):
     """the default username in the config or None"""