comparison tests/run-tests.py @ 35600:31acf6619f08

run-tests: fix regular expression for path test The previous regexp would match the empty string. This fixes a mistake added in 964212780daf. Differential Revision: https://phab.mercurial-scm.org/D1843
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 10 Jan 2018 19:04:52 -0800
parents 964212780daf
children 6d65cef5b038
comparison
equal deleted inserted replaced
35599:af25237be091 35600:31acf6619f08
2448 if re.match(b'#!.*python', initial): 2448 if re.match(b'#!.*python', initial):
2449 self._pythondir = self._bindir 2449 self._pythondir = self._bindir
2450 # If it looks like our in-repo Rust binary, use the source root. 2450 # If it looks like our in-repo Rust binary, use the source root.
2451 # This is a bit hacky. But rhg is still not supported outside the 2451 # This is a bit hacky. But rhg is still not supported outside the
2452 # source directory. So until it is, do the simple thing. 2452 # source directory. So until it is, do the simple thing.
2453 elif re.search(b'|/rust/target/[^/]+/hg', normbin): 2453 elif re.search(b'/rust/target/[^/]+/hg', normbin):
2454 self._pythondir = os.path.dirname(self._testdir) 2454 self._pythondir = os.path.dirname(self._testdir)
2455 # Fall back to the legacy behavior. 2455 # Fall back to the legacy behavior.
2456 else: 2456 else:
2457 self._pythondir = self._bindir 2457 self._pythondir = self._bindir
2458 2458