run-tests: fix conditional when tests are run outside of `tests`
The logic to find `hghave` was using `__file__` but… non absolute path in
`__file__` gets wrong as soon as we change directory (thanks python… you are
being helpful). The rest of the `run-tests.py` code already deal with this
fine. We simply reuse the `RUNTESTDIR` variable to fix it.
--- a/tests/run-tests.py Mon Mar 09 01:11:59 2020 +0100
+++ b/tests/run-tests.py Tue Mar 10 16:47:02 2020 +0100
@@ -1626,7 +1626,7 @@
return self._have.get(allreqs)
# TODO do something smarter when all other uses of hghave are gone.
- runtestdir = os.path.abspath(os.path.dirname(_bytespath(__file__)))
+ runtestdir = osenvironb[b'RUNTESTDIR']
tdir = runtestdir.replace(b'\\', b'/')
proc = Popen4(
b'%s -c "%s/hghave %s"' % (self._shell, tdir, allreqs),