It seems test-mq and test-mq-delete assume all diff implementations use the same error message, but that's not correct. $ echo a > a; echo b > b; patch a < b patch: **** Only garbage was found in the patch input. mbp:forcepush akira$ patch -v patch 2.5.8 Copyright (C) 1988 Larry Wall Copyright (C) 2002 Free Software Foundation, Inc. This program comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of this program under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING. written by Larry Wall and Paul Eggert $ echo a > a; echo b > b; patch a < b Hmm... I can't seem to find a patch in there anywhere. $ patch -v Patch version 2.1 And here are how that tests fail. $ gmake tests cd tests && python run-tests.py ............................s...................ssssss.s....s...sssssssss...........................................................s...........ssss........................................... ERROR: test-mq output changed --- Expected output +++ Test output @@ -486,9 +486,7 @@ abort: local changes found, refresh first % apply force, should not discard changes with empty patch applying empty -patch: **** Only garbage was found in the patch input. -patch failed, unable to continue (try -v) -patch empty is empty +Hmm... I can't seem to find a patch in there anywhere. Now at: empty diff -r bf5fc3f07a0a hello.txt --- a/hello.txt !........ ERROR: test-mq-qdelete output changed --- Expected output +++ Test output @@ -30,6 +30,7 @@ Now at: b abort: unknown revision 'c'! applying c +Hmm... I can't seem to find a patch in there anywhere. Now at: c c 3 imported patch c !.................s....................................................................................... Skipped test-casefolding: missing feature: case insensitive file system Skipped test-convert-baz: missing feature: GNU Arch baz client Skipped test-convert-bzr: missing feature: Canonical's Bazaar client Skipped test-convert-bzr-directories: missing feature: Canonical's Bazaar client Skipped test-convert-bzr-ghosts: missing feature: Canonical's Bazaar client Skipped test-convert-bzr-merges: missing feature: Canonical's Bazaar client Skipped test-convert-bzr-treeroot: missing feature: Canonical's Bazaar client Skipped test-convert-cvs: missing feature: cvsps utility Skipped test-convert-darcs: not executable Skipped test-convert-git: missing feature: git command line client Skipped test-convert-hg-svn: missing feature: subversion python bindings Skipped test-convert-mtn: missing feature: monotone client (> 0.31) Skipped test-convert-svn-branches: missing feature: subversion python bindings Skipped test-convert-svn-move: missing feature: subversion python bindings Skipped test-convert-svn-sink: missing feature: subversion python bindings Skipped test-convert-svn-source: missing feature: subversion python bindings Skipped test-convert-svn-startrev: missing feature: subversion python bindings Skipped test-convert-svn-tags: missing feature: subversion python bindings Skipped test-convert-tla: missing feature: GNU Arch tla client Skipped test-highlight: missing feature: Pygments source highlighting library Skipped test-imerge: not executable Skipped test-inotify: missing feature: inotify extension support Skipped test-inotify-issue1208: missing feature: inotify extension support Skipped test-inotify-issue1371: missing feature: inotify extension support Skipped test-inotify-lookup: missing feature: inotify extension support Skipped test-no-symlinks: system supports symbolic links Failed test-mq: output changed Failed test-mq-qdelete: output changed # Ran 308 tests, 26 skipped, 2 failed. gmake: *** [tests] Error 1
Attached patch fixes this problem by using the return code of hg command, instead of diff's output. I think it's better to change hg mq commands not to output patch's error messages.
attaching another patch. This one disables the fallback to externalpatch when NoHunks occured.
The fallback disabling sounds good to me, but I think we should not push this a couple of days before the release. I am tempted to push the tests fixing patch instead, then push the other one after the release.
I agree. anyway this is a very trivial problem. Not a worth to push it this very moment. will take this a closer look after the release
Do we still use the external patcher?
Unfortunately yes. For regular patches, I think it is useless, our works correctly by now. We cannot rule out people use it with completely different tools but we should probably poll the mailing list.
I'd be in favor to deprecating the external patcher, or at least always try the internalpatcher first.
OK, two years later, the external patcher fallback has been removed (http://hg.intevation.org/mercurial/crew/rev/1b4e3152da13). Sorry about this.
--- Bug imported by bugzilla@serpentine.com 2012-05-12 08:55 EDT --- This bug was previously known as _bug_ 1388 at http://mercurial.selenic.com/bts/issue1388 Imported an attachment (id=1074) Imported an attachment (id=1075)