Patchwork D7750: run-tests: ensure the script exits when it fails to change directories

login
register
mail settings
Submitter phabricator
Date Dec. 27, 2019, 10:09 p.m.
Message ID <differential-rev-PHID-DREV-ypcpnpnrh6fjvk4ens55-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/44094/
State Superseded
Headers show

Comments

phabricator - Dec. 27, 2019, 10:09 p.m.
mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Caught by PyCharm as an unused variable assignment.  This regressed in
  c496e8c14b9e <https://phab.mercurial-scm.org/rHGc496e8c14b9e199697c3353356ccd7b6b8fa1a51>.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7750

AFFECTED FILES
  tests/run-tests.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -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)