hgext/rebase.py
changeset 10676 13341047d517
parent 10660 24555e216af6
parent 10672 c2e1e637d4da
child 10677 f2558a8228be
--- a/hgext/rebase.py	Sat Mar 13 19:57:52 2010 +0100
+++ b/hgext/rebase.py	Sat Mar 13 20:02:46 2010 +0100
@@ -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]: