hgext/evolve.py
changeset 1408 b3afdc0815d0
parent 1407 552687eb4856
child 1409 3276730e4b32
--- a/hgext/evolve.py	Fri Jun 19 14:18:45 2015 -0700
+++ b/hgext/evolve.py	Tue Jun 16 17:56:23 2015 -0700
@@ -1260,6 +1260,16 @@
     if repo['.'] != startnode:
         ui.status(_('working directory is now at %s\n') % repo['.'])
 
+class MultipleSuccessorsError(RuntimeError):
+    """Exception raised by _singlesuccessor when multiple sucessors sets exists
+
+    The object contains the list of successorssets in its 'successorssets'
+    attribute to call to easily recover.
+    """
+
+    def __init__(self, successorssets):
+        self.successorssets = successorssets
+
 def _singlesuccessor(repo, p):
     """returns p (as rev) if not obsolete or its unique latest successors
 
@@ -1278,7 +1288,8 @@
         obs = obs.parents()[0]
         newer = obsolete.successorssets(repo, obs.node())
     if len(newer) > 1:
-        raise util.Abort(_("conflict rewriting. can't choose destination\n"))
+        raise MultipleSuccessorsError(newer)
+
     return repo[newer[0][0]].rev()
 
 def builddependencies(repo, revs):
@@ -1296,7 +1307,10 @@
     for r in revs:
         dependencies[r] = set()
         for p in repo[r].parents():
-            succ = _singlesuccessor(repo, p)
+            try:
+                succ = _singlesuccessor(repo, p)
+            except MultipleSuccessorsError, exc:
+                dependencies[r] = exc.successorssets
             if succ in revs:
                 dependencies[r].add(succ)
                 rdependencies[succ].add(r)