Comments
Patch
@@ -444,7 +444,7 @@ class Test(unittest.TestCase):
debug=False,
timeout=defaults['timeout'],
startport=defaults['port'], extraconfigopts=None,
- py3kwarnings=False, shell=None,
+ py3kwarnings=False, shell=None, hgcommand=None,
slowtimeout=defaults['slowtimeout'],
pythondir=None):
"""Create a test from parameters.
@@ -493,6 +493,7 @@ class Test(unittest.TestCase):
self._py3kwarnings = py3kwarnings
self._pythondir = pythondir
self._shell = _bytespath(shell)
+ self._hgcommand = hgcommand or b'hg'
self._aborted = False
self._daemonpids = []
@@ -992,6 +993,8 @@ class TTest(Test):
if self._debug:
script.append(b'set -x\n')
+ if self._hgcommand != b'hg':
+ script.append(b'alias hg="%s"\n' % self._hgcommand)
if os.getenv('MSYSTEM'):
script.append(b'alias pwd="pwd -W"\n')
@@ -1820,6 +1823,7 @@ class TestRunner(object):
self._pythondir = None
self._coveragefile = None
self._createdfiles = []
+ self._hgcommand = None
self._hgpath = None
self._portoffset = 0
self._ports = {}
@@ -1928,6 +1932,7 @@ class TestRunner(object):
whg = self.options.with_hg
self._bindir = os.path.dirname(os.path.realpath(whg))
assert isinstance(self._bindir, bytes)
+ self._hgcommand = os.path.basename(whg)
self._tmpbindir = os.path.join(self._hgtmp, b'install', b'bin')
os.makedirs(self._tmpbindir)
@@ -1940,6 +1945,7 @@ class TestRunner(object):
else:
self._installdir = os.path.join(self._hgtmp, b"install")
self._bindir = os.path.join(self._installdir, b"bin")
+ self._hgcommand = b'hg'
self._tmpbindir = self._bindir
self._pythondir = os.path.join(self._installdir, b"lib", b"python")
@@ -2121,6 +2127,7 @@ class TestRunner(object):
extraconfigopts=self.options.extra_config_opt,
py3kwarnings=self.options.py3k_warnings,
shell=self.options.shell,
+ hgcommand=self._hgcommand,
pythondir=self._pythondir)
t.should_reload = True
return t