Skip to content
Snippets Groups Projects
Commit 5c01204e039b authored by Philippe Pepiot's avatar Philippe Pepiot
Browse files

Do not use environment through remote hg

When executing benchmarks with remote ssh repositories, do not use the default
environment, clear it (env -i) and use an empty HGRCPATH.
parent 56210ae92fd5
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@
import timeit
import shutil
import subprocess
import stat
from .utils import (BaseNChangesetsTestSuite, BaseTimeTestSuite,
BaseTrackTestSuite, median, REPOS_DIR)
......@@ -134,4 +135,9 @@
if self.repo_type == 'local':
return [path]
elif self.repo_type == 'ssh':
with open('hg_wrapper', 'wb') as f:
f.write('#!/bin/sh\nexec env -i HGRCPATH= {} $*\n'.format(
os.path.abspath(self.hgpath)))
st = os.stat('hg_wrapper')
os.chmod('hg_wrapper', st.st_mode | stat.S_IEXEC)
return [
......@@ -137,5 +143,5 @@
return [
'--remotecmd', os.path.abspath(self.hgpath),
'--remotecmd', os.path.abspath('hg_wrapper'),
'ssh://localhost/{}'.format(os.path.abspath(path))]
else:
raise NotImplementedError
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment