--- a/hgext/mq.py Mon Nov 16 12:51:00 2009 -0600
+++ b/hgext/mq.py Mon Nov 16 13:52:53 2009 -0600
@@ -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)
--- a/tests/test-mq Mon Nov 16 12:51:00 2009 -0600
+++ b/tests/test-mq Mon Nov 16 13:52:53 2009 -0600
@@ -175,6 +175,10 @@
hg revert --no-backup ../a
hg import ../../import.diff
hg st
+echo % import --no-commit should succeed
+hg import --no-commit ../../import.diff
+hg st
+hg revert --no-backup ../a
echo % qunapplied
hg qunapplied
--- a/tests/test-mq.out Mon Nov 16 12:51:00 2009 -0600
+++ b/tests/test-mq.out Mon Nov 16 13:52:53 2009 -0600
@@ -154,6 +154,9 @@
abort: source has mq patches applied
% import should fail
abort: cannot import over an applied patch
+% import --no-commit should succeed
+applying ../../import.diff
+M a
% qunapplied
test2.patch
% qpush/qpop with index