# HG changeset patch # User FUJIWARA Katsunori # Date 1496981269 -32400 # Node ID 627eaab1ad072ac89e579f365627c6bc8394a6ba # Parent b698921ee1378b039a0f8bef5a3aace16d658b9d tests: factor external procedures out for portability Fortunately, "&&" is treated as "execute next, if previous doesn't fail" both on POSIX and Windows. But keeping portability of "dirstaterace.command" manually is troublesome. This patch factors external procedures out as a shell script for portability. "sh SCRIPT" always allows scripting in POSIX style. This change is also for convenience. Fixed script name can reduce command line arguments. "r" prefix is needed for "sh '$TESTTMP/dirstaterace.sh'", because $TESTTMP contains backslash on Windows. diff -r b698921ee137 -r 627eaab1ad07 tests/test-dirstate-race.t --- a/tests/test-dirstate-race.t Fri Jun 09 13:07:48 2017 +0900 +++ b/tests/test-dirstate-race.t Fri Jun 09 13:07:49 2017 +0900 @@ -57,7 +57,8 @@ > extensions.wrapfunction(context.workingctx, '_checklookup', overridechecklookup) > def overridechecklookup(orig, self, files): > # make an update that changes the dirstate from underneath - > self._repo.ui.system(self._repo.ui.config('dirstaterace', 'command'), cwd=self._repo.root) + > self._repo.ui.system(r"sh '$TESTTMP/dirstaterace.sh'", + > cwd=self._repo.root) > return orig(self, files) > EOF @@ -73,8 +74,11 @@ definitely a bug, but the fix for that is hard and the next status run is fine anyway. - $ hg status --config extensions.dirstaterace=$TESTTMP/dirstaterace.py \ - > --config dirstaterace.command='rm b && rm -r dir1 && rm d && mkdir d && rm e && mkdir e' + $ cat > $TESTTMP/dirstaterace.sh < rm b && rm -r dir1 && rm d && mkdir d && rm e && mkdir e + > EOF + + $ hg status --config extensions.dirstaterace=$TESTTMP/dirstaterace.py M d M e ! b