diff --git a/contrib/check-code.py b/contrib/check-code.py --- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -168,6 +168,8 @@ utestpats = [ (r'^ .*: largefile \S+ not available from file:.*/.*[^)]$', winglobmsg), (r'^ .*file://\$TESTTMP', 'write "file:/*/$TESTTMP" + (glob) to match on windows too'), + (r'^ (cat|find): .*: No such file or directory', + 'use test -f to test for file existence'), ], # warnings [ diff --git a/tests/test-histedit-edit.t b/tests/test-histedit-edit.t --- a/tests/test-histedit-edit.t +++ b/tests/test-histedit-edit.t @@ -233,8 +233,7 @@ check saving last-message.txt, at first > EOF 0 files updated, 0 files merged, 1 files removed, 0 files unresolved abort: emulating unexpected abort - $ cat .hg/last-message.txt - cat: .hg/last-message.txt: No such file or directory + $ test -f .hg/last-message.txt [1] $ cat >> .hg/hgrc <<EOF diff --git a/tests/test-issue3084.t b/tests/test-issue3084.t --- a/tests/test-issue3084.t +++ b/tests/test-issue3084.t @@ -165,8 +165,7 @@ Ensure that .hg/largefiles isn't created $ chmod 755 .hg #endif - $ find .hg/largefiles - find: `.hg/largefiles': No such file or directory + $ test -f .hg/largefiles [1] ancestor is "normal": diff --git a/tests/test-mq-qfold.t b/tests/test-mq-qfold.t --- a/tests/test-mq-qfold.t +++ b/tests/test-mq-qfold.t @@ -182,8 +182,7 @@ and that combination of '--edit' and '-- refresh interrupted while patch was popped! (revert --all, qpush to recover) abort: emulating unexpected abort [255] - $ cat .hg/last-message.txt - cat: .hg/last-message.txt: No such file or directory + $ test -f .hg/last-message.txt [1] (reset applied patches and directory status) diff --git a/tests/test-mq-qnew.t b/tests/test-mq-qnew.t --- a/tests/test-mq-qnew.t +++ b/tests/test-mq-qnew.t @@ -268,8 +268,7 @@ Test saving last-message.txt $ HGEDITOR="sh $TESTTMP/editor.sh" hg qnew -e patch abort: emulating unexpected abort [255] - $ cat .hg/last-message.txt - cat: .hg/last-message.txt: No such file or directory + $ test -f .hg/last-message.txt [1] (test that editor is invoked and commit message is saved into diff --git a/tests/test-mq-qrefresh-replace-log-message.t b/tests/test-mq-qrefresh-replace-log-message.t --- a/tests/test-mq-qrefresh-replace-log-message.t +++ b/tests/test-mq-qrefresh-replace-log-message.t @@ -133,8 +133,7 @@ Test saving last-message.txt: refresh interrupted while patch was popped! (revert --all, qpush to recover) abort: emulating unexpected abort [255] - $ cat .hg/last-message.txt - cat: .hg/last-message.txt: No such file or directory + $ test -f .hg/last-message.txt [1] (reset applied patches and directory status) diff --git a/tests/test-subrepo-svn.t b/tests/test-subrepo-svn.t --- a/tests/test-subrepo-svn.t +++ b/tests/test-subrepo-svn.t @@ -672,11 +672,9 @@ Test sanitizing ".hg/hgrc" in subrepo $ cd tc $ grep ' s$' .hgsubstate 16 s - $ cat s/.hg/hgrc - cat: s/.hg/hgrc: No such file or directory + $ test -f s/.hg/hgrc [1] - $ cat s/sub/.hg/hgrc - cat: s/sub/.hg/hgrc: No such file or directory + $ test -f s/sub/.hg/hgrc [1] Test that sanitizing is omitted in meta data area: diff --git a/tests/test-tag.t b/tests/test-tag.t --- a/tests/test-tag.t +++ b/tests/test-tag.t @@ -242,8 +242,7 @@ at first, test saving last-message.txt $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg tag custom-tag -e abort: pretag.test-saving-lastmessage hook exited with status 1 [255] - $ cat .hg/last-message.txt - cat: .hg/last-message.txt: No such file or directory + $ test -f .hg/last-message.txt [1] (test that editor is invoked and commit message is saved into