Bug 1388 - test-mq and test-mq-qdelete expect all patch implementations use the same error message
Summary: test-mq and test-mq-qdelete expect all patch implementations use the same err...
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: All All
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-16 01:03 UTC by Akira Kitada
Modified: 2012-05-13 05:04 UTC (History)
4 users (show)

See Also:
Python Version: ---


Attachments
(33 bytes, application/octet-stream)
2008-11-16 01:24 UTC, Akira Kitada
Details
(33 bytes, application/octet-stream)
2008-11-16 06:33 UTC, Akira Kitada
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Akira Kitada 2008-11-16 01:03 UTC
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
Comment 1 Akira Kitada 2008-11-16 01:24 UTC
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.
Comment 2 Akira Kitada 2008-11-16 06:33 UTC
attaching another patch. This one disables the fallback to externalpatch when
NoHunks occured.
Comment 3 Patrick Mézard 2008-11-17 02:39 UTC
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.
Comment 4 Akira Kitada 2008-11-17 10:29 UTC
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
Comment 5 Benoit Boissinot 2010-02-16 04:27 UTC
Do we still use the external patcher?
Comment 6 Patrick Mézard 2010-02-16 04:54 UTC
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.
Comment 7 Benoit Boissinot 2010-03-19 12:35 UTC
I'd be in favor to deprecating the external patcher, or at least always try 
the internalpatcher first.
Comment 8 Patrick Mézard 2010-10-10 10:03 UTC
OK, two years later, the external patcher fallback has been removed
(http://hg.intevation.org/mercurial/crew/rev/1b4e3152da13).

Sorry about this.
Comment 9 Bugzilla 2012-05-12 08:55 UTC

--- 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)