diff hgext/mq.py @ 9867:81f1462ef2c7

Allow import --no-commit over an applied MQ patch. Since it only changes the working directory, it does not matter whether a patch is applied. This change makes it easier to use hg import --no-commit instead of patch.
author Brendan Cully <brendan@kublai.com>
date Mon, 16 Nov 2009 11:31:08 -0800
parents 24bc6e414610
children c51494c53841
line wrap: on
line diff
--- a/hgext/mq.py	Mon Nov 16 13:35:36 2009 +0100
+++ b/hgext/mq.py	Mon Nov 16 11:31:08 2009 -0800
@@ -2550,7 +2550,7 @@
         repo.__class__ = mqrepo
 
 def mqimport(orig, ui, repo, *args, **kwargs):
-    if hasattr(repo, 'abort_if_wdir_patched'):
+    if hasattr(repo, 'abort_if_wdir_patched') and not kwargs.get('no_commit', False):
         repo.abort_if_wdir_patched(_('cannot import over an applied patch'),
                                    kwargs.get('force'))
     return orig(ui, repo, *args, **kwargs)