hgext/rebase.py
branchstable
changeset 10672 c2e1e637d4da
parent 10659 19c0ff5606e1
child 10676 13341047d517
child 10762 129e96f7a87a
--- a/hgext/rebase.py	Fri Mar 05 17:38:02 2010 -0500
+++ b/hgext/rebase.py	Tue Mar 02 15:08:43 2010 -0500
@@ -440,11 +440,15 @@
         branch = repo[None].branch()
         dest = repo[branch].rev()
     else:
-        if 'qtip' in repo.tags() and (repo[dest].hex() in
-                                [s.rev for s in repo.mq.applied]):
-            raise util.Abort(_('cannot rebase onto an applied mq patch'))
         dest = repo[dest].rev()
 
+    # This check isn't strictly necessary, since mq detects commits over an
+    # applied patch. But it prevents messing up the working directory when
+    # a partially completed rebase is blocked by mq.
+    if 'qtip' in repo.tags() and (repo[dest].hex() in
+                            [s.rev for s in repo.mq.applied]):
+        raise util.Abort(_('cannot rebase onto an applied mq patch'))
+
     if src:
         commonbase = repo[src].ancestor(repo[dest])
         if commonbase == repo[src]: