Skip to content
Snippets Groups Projects
Commit 0ccb43d4 authored by Jun Wu's avatar Jun Wu
Browse files

test-dispatch: stabilize the test

When cwd is removed and `hg` is executed, some shells may run `getcwd`
before forking and executing, some may not do it, some may print a
different error message.

The test should be shell-independent so let's just avoid checking the error
message.

Differential Revision: https://phab.mercurial-scm.org/D1282
parent 05ebb553
No related branches found
Tags 4.4
No related merge requests found
......@@ -68,9 +68,13 @@
$ mkdir $TESTTMP/repo1
$ cd $TESTTMP/repo1
$ rm -rf $TESTTMP/repo1
$ HGDEMANDIMPORT=disable hg version -q
abort: error getting current working directory: * (glob) (no-chg !)
chg: abort: failed to getcwd (errno = *) (glob) (chg !)
[255]
The output could be one of the following and something else:
chg: abort: failed to getcwd (errno = *) (glob)
abort: error getting current working directory: * (glob)
sh: 0: getcwd() failed: No such file or directory
Since the exact behavior depends on the shell, only check it returns non-zero.
$ HGDEMANDIMPORT=disable hg version -q 2>/dev/null || false
[1]
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment