run-tests: ensure the script exits when it fails to change directories
Caught by PyCharm as an unused variable assignment. This regressed in
c496e8c14b9e.
Differential Revision: https://phab.mercurial-scm.org/D7750
--- a/tests/run-tests.py Fri Dec 27 16:30:14 2019 -0500
+++ b/tests/run-tests.py Fri Dec 27 16:57:28 2019 -0500
@@ -1839,7 +1839,7 @@
cmd = rawcmd.split()
toggletrace(rawcmd)
if len(cmd) == 2 and cmd[0] == b'cd':
- l = b' $ cd %s || exit 1\n' % cmd[1]
+ rawcmd = b'cd %s || exit 1\n' % cmd[1]
script.append(rawcmd)
elif l.startswith(b' > '): # continuations
after.setdefault(prepos, []).append(l)