hgext3rd/evolve/__init__.py
changeset 2488 1bdbe8f55339
parent 2485 e6ecd35e99ec
child 2493 3ee8e9a12f41
--- a/hgext3rd/evolve/__init__.py	Fri May 26 10:05:37 2017 +0200
+++ b/hgext3rd/evolve/__init__.py	Fri May 26 13:18:26 2017 +0200
@@ -523,29 +523,6 @@
 
 # This section take care of issue warning to the user when troubles appear
 
-
-def _getobsoletereason(repo, revnode):
-    """ Return a tuple containing:
-    - the reason a revision is obsolete (diverged, pruned or superseed)
-    - the list of successors short node if the revision is neither pruned
-    or has diverged
-    """
-    successorssets = obsolete.successorssets(repo, revnode)
-
-    if len(successorssets) == 0:
-        # The commit has been pruned
-        return ('pruned', [])
-    elif len(successorssets) > 1:
-        return ('diverged', [])
-    else:
-        # No divergence, only one set of successors
-        successors = [node.short(node_id) for node_id in successorssets[0]]
-
-        if len(successors) == 1:
-            return ('superseed', successors)
-        else:
-            return ('superseed_split', successors)
-
 def _warnobsoletewc(ui, repo):
     rev = repo['.']
 
@@ -562,7 +539,7 @@
         return
 
     # Show a warning for helping the user to solve the issue
-    reason, successors = _getobsoletereason(repo, rev.node())
+    reason, successors = obshistory._getobsfateandsuccs(repo, rev.node())
 
     if reason == 'pruned':
         solvemsg = _("use 'hg evolve' to update to its parent successor")
@@ -600,7 +577,7 @@
 
             unfilteredrepo = repo.unfiltered()
             rev = unfilteredrepo[changeid]
-            reason, successors = _getobsoletereason(unfilteredrepo, rev.node())
+            reason, successors = obshistory._getobsfateandsuccs(unfilteredrepo, rev.node())
 
             # Be more precise in cqse the revision is superseed
             if reason == 'superseed':