diff hgext/rebase.py @ 9578:341182ac95e4

rebase: return early when source is descendant of destination This only happens when using --base (or no source selection options), as rebase already aborts in this situation when using --source. Without this change you get an abort from the underlying merge, and the repository is in a different state than you started with (the working dir parent is changed).
author Sune Foldager <cryo@cyanite.org>
date Thu, 08 Oct 2009 10:39:43 +0200
parents b91960aed018
children f3404b7f37ca
line wrap: on
line diff
--- a/hgext/rebase.py	Thu Oct 08 10:07:41 2009 +0200
+++ b/hgext/rebase.py	Thu Oct 08 10:39:43 2009 +0200
@@ -401,6 +401,10 @@
             return None
 
         cwdancestors = set(repo.changelog.ancestors(cwd))
+        if dest in cwdancestors:
+            repo.ui.debug('source is descendant of destination\n')
+            return None
+
         cwdancestors.add(cwd)
         rebasingbranch = cwdancestors - targetancestors
         source = min(rebasingbranch)