D1433: run-tests: fix TESTDIR if testdescs are absolute paths

spectral (Kyle Lippincott) phabricator at mercurial-scm.org
Fri Nov 17 09:12:21 EST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGdb5da5c563d0: run-tests: fix TESTDIR if testdescs are absolute paths (authored by spectral, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D1433?vs=3578&id=3590#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1433?vs=3578&id=3590

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

AFFECTED FILES
  tests/run-tests.py

CHANGE DETAILS

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -2356,9 +2356,9 @@
         # assume all tests in same folder for now
         if testdescs:
             pathname = os.path.dirname(testdescs[0]['path'])
-            if pathname and not osenvironb[b'TESTDIR'].endswith(b'/'):
-                osenvironb[b'TESTDIR'] += b'/'
-            osenvironb[b'TESTDIR'] += pathname
+            if pathname:
+                osenvironb[b'TESTDIR'] = os.path.join(osenvironb[b'TESTDIR'],
+                                                      pathname)
         if self.options.outputdir:
             self._outputdir = canonpath(_bytespath(self.options.outputdir))
         else:



To: spectral, #hg-reviewers, yuja
Cc: yuja, mercurial-devel


More information about the Mercurial-devel mailing list