mq: strip should not blow away local changes
authorChris Mason <mason@suse.com>
Thu, 27 Jul 2006 09:27:45 -0700
changeset 2699 f8bcaf5696d5
parent 2698 c1123e83c8e2
child 2701 f12d2e5b97fe
mq: strip should not blow away local changes This changes the mq strip command to abort if there are any changes in the working directory.
hgext/mq.py
--- a/hgext/mq.py	Thu Jul 27 09:27:42 2006 -0700
+++ b/hgext/mq.py	Thu Jul 27 09:27:45 2006 -0700
@@ -530,6 +530,9 @@
         revnum = chlog.rev(rev)
 
         if update:
+            (c, a, r, d, u) = repo.changes(None, None)
+            if c or a or d or r:
+                raise util.Abort(_("Local changes found"))
             urev = self.qparents(repo, rev)
             repo.update(urev, allow=False, force=True, wlock=wlock)
             repo.dirstate.write()