hgext3rd/topic/evolvebits.py
changeset 2922 66357d4d03b2
parent 2694 8a222745a71c
child 3017 0884856a4143
--- a/hgext3rd/topic/evolvebits.py	Mon Sep 11 17:24:33 2017 +0200
+++ b/hgext3rd/topic/evolvebits.py	Sun Sep 10 22:41:54 2017 +0900
@@ -1,15 +1,6 @@
 import collections
-from mercurial import obsolete
 
-successorssets = None
-try:
-    from mercurial import obsutil
-    successorssets = getattr(obsutil, 'successorssets', None)
-except ImportError:
-    pass
-
-if successorssets is None:
-    successorssets = obsolete.successorssets
+from . import compat
 
 # Copied from evolve 081605c2e9b6
 
@@ -82,14 +73,14 @@
         return p.rev()
     obs = repo[p]
     ui = repo.ui
-    newer = successorssets(repo, obs.node())
+    newer = compat.successorssets(repo, obs.node())
     # search of a parent which is not killed
     while not newer:
         ui.debug("stabilize target %s is plain dead,"
                  " trying to stabilize on its parent\n" %
                  obs)
         obs = obs.parents()[0]
-        newer = successorssets(repo, obs.node())
+        newer = compat.successorssets(repo, obs.node())
     if len(newer) > 1 or len(newer[0]) > 1:
         raise MultipleSuccessorsError(newer)