compat: from compatibility layer for allprecursors
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 19 Apr 2018 16:15:10 +0200
changeset 3698 4819656d1134
parent 3697 6aff4bb3970d
child 3699 67d6cc7e0979
compat: from compatibility layer for allprecursors We only support down to 4.3 now.
hgext3rd/evolve/compat.py
hgext3rd/evolve/evolvecmd.py
--- a/hgext3rd/evolve/compat.py	Thu Apr 19 16:12:37 2018 +0200
+++ b/hgext3rd/evolve/compat.py	Thu Apr 19 16:15:10 2018 +0200
@@ -38,16 +38,6 @@
 
 eh = exthelper.exthelper()
 
-# allprecursors set move from mercurial.obsolete to mercurial.obsutil in 4.3
-# allprecursors  was renamed into allpredecessors in 4.4
-def allprecursors(*args, **kwargs):
-    func = getattr(obsutil, 'allpredecessors', None)
-    if func is None:
-        func = getattr(obsutil, 'allprecursors', None)
-        if func is None:
-            func = obsolete.allprecursors
-    return func(*args, **kwargs)
-
 # compatibility layer for mercurial < 4.3
 def bookmarkapplychanges(repo, tr, changes):
     """Apply a list of changes to bookmarks
--- a/hgext3rd/evolve/evolvecmd.py	Thu Apr 19 16:12:37 2018 +0200
+++ b/hgext3rd/evolve/evolvecmd.py	Thu Apr 19 16:15:10 2018 +0200
@@ -1019,7 +1019,7 @@
     """Compute sets of commits divergent with a given one"""
     cache = {}
     base = {}
-    for n in compat.allprecursors(repo.obsstore, [ctx.node()]):
+    for n in obsutil.allpredecessors(repo.obsstore, [ctx.node()]):
         if n == ctx.node():
             # a node can't be a base for divergence with itself
             continue