diff --git a/infinitepush/__init__.py b/infinitepush/__init__.py --- a/infinitepush/__init__.py +++ b/infinitepush/__init__.py @@ -149,6 +149,13 @@ _scratchbranchmatcher = lambda x: False _maybehash = re.compile(r'^[a-f0-9]+$').search +if util.safehasattr(util, '_hgexecutable'): + # Before 5be286db + _hgexecutable = util.hgexecutable +else: + from mercurial.utils import procutil + _hgexecutable = procutil.hgexecutable + def _buildexternalbundlestore(ui): put_args = ui.configlist('infinitepush', 'put_args', []) put_binary = ui.config('infinitepush', 'put_binary') @@ -1352,7 +1359,7 @@ nodesargs.append('--node') nodesargs.append(node) with open(os.devnull, 'w+b') as devnull: - cmdline = [util.hgexecutable(), 'debugfillinfinitepushmetadata', + cmdline = [_hgexecutable(), 'debugfillinfinitepushmetadata', '-R', root] + nodesargs # Process will run in background. We don't care about the return code subprocess.Popen(cmdline, close_fds=True, shell=False, diff --git a/remotefilelog/repack.py b/remotefilelog/repack.py --- a/remotefilelog/repack.py +++ b/remotefilelog/repack.py @@ -31,8 +31,15 @@ class RepackAlreadyRunning(error.Abort): pass +if util.safehasattr(util, '_hgexecutable'): + # Before 5be286db + _hgexecutable = util.hgexecutable +else: + from mercurial.utils import procutil + _hgexecutable = procutil.hgexecutable + def backgroundrepack(repo, incremental=True, packsonly=False): - cmd = [util.hgexecutable(), '-R', repo.origroot, 'repack'] + cmd = [_hgexecutable(), '-R', repo.origroot, 'repack'] msg = _("(running background repack)\n") if incremental: cmd.append('--incremental') diff --git a/remotefilelog/shallowrepo.py b/remotefilelog/shallowrepo.py --- a/remotefilelog/shallowrepo.py +++ b/remotefilelog/shallowrepo.py @@ -25,6 +25,13 @@ import os +if util.safehasattr(util, '_hgexecutable'): + # Before 5be286db + _hgexecutable = util.hgexecutable +else: + from mercurial.utils import procutil + _hgexecutable = procutil.hgexecutable + requirement = "remotefilelog" _prefetching = _('prefetching') @@ -182,7 +189,7 @@ opts=None): """Runs prefetch in background with optional repack """ - cmd = [util.hgexecutable(), '-R', repo.origroot, 'prefetch'] + cmd = [_hgexecutable(), '-R', repo.origroot, 'prefetch'] if repack: cmd.append('--repack') if revs: