diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -822,7 +822,7 @@ class queue(object): except AbortNoCleanup: tr.close() self.savedirty() - return 2, repo.dirstate.p1() + raise except: # re-raises try: tr.abort() @@ -880,7 +880,8 @@ class queue(object): touched = set(touched) & tobackup if touched and keepchanges: raise AbortNoCleanup( - _("local changes found, refresh first")) + _("conflicting local changes found"), + hint=_("did you forget to qrefresh?")) self.backup(repo, touched, copy=True) tobackup = tobackup - touched (patcherr, files, fuzz) = self.patch(repo, pf) @@ -1417,6 +1418,8 @@ class queue(object): else: ret = self.apply(repo, s, list, all_files=all_files, tobackup=tobackup, keepchanges=keepchanges) + except AbortNoCleanup: + raise except: # re-raises self.ui.warn(_('cleaning up working directory...')) node = repo.dirstate.p1() diff --git a/tests/test-mq-qpush-fail.t b/tests/test-mq-qpush-fail.t --- a/tests/test-mq-qpush-fail.t +++ b/tests/test-mq-qpush-fail.t @@ -344,25 +344,29 @@ test qpush --keep-changes $ echo b >> b $ hg qpush --keep-changes applying p3 - errors during apply, please fix and refresh p2 - [2] + abort: conflicting local changes found + (did you forget to qrefresh?) + [255] $ rm b $ hg qpush --keep-changes applying p3 - errors during apply, please fix and refresh p2 - [2] + abort: conflicting local changes found + (did you forget to qrefresh?) + [255] $ hg rm -A b $ hg qpush --keep-changes applying p3 - errors during apply, please fix and refresh p2 - [2] + abort: conflicting local changes found + (did you forget to qrefresh?) + [255] $ hg revert -aq b $ echo d > d $ hg add d $ hg qpush --keep-changes applying p3 - errors during apply, please fix and refresh p2 - [2] + abort: conflicting local changes found + (did you forget to qrefresh?) + [255] $ hg forget d $ rm d $ hg qpop @@ -372,8 +376,9 @@ test qpush --keep-changes $ hg qpush -a --keep-changes applying p2 applying p3 - errors during apply, please fix and refresh p2 - [2] + abort: conflicting local changes found + (did you forget to qrefresh?) + [255] $ hg qtop p2 $ hg parents --template "{rev} {desc}\n"