diff --git a/hgext/remotefilelog/extutil.py b/hgext/remotefilelog/extutil.py --- a/hgext/remotefilelog/extutil.py +++ b/hgext/remotefilelog/extutil.py @@ -92,18 +92,6 @@ # continue the hg process here. os._exit(returncode) -def runshellcommand(script, env): - ''' - Run a shell command in the background. - This spawns the command and returns before it completes. - - Prefer using runbgcommand() instead of this function. This function should - be discouraged in new code. Running commands through a subshell requires - you to be very careful about correctly escaping arguments, and you need to - make sure your command works with both Windows and Unix shells. - ''' - runbgcommand(script, env=env, shell=True) - @contextlib.contextmanager def flock(lockpath, description, timeout=-1): """A flock based lock object. Currently it is always non-blocking. diff --git a/hgext/remotefilelog/repack.py b/hgext/remotefilelog/repack.py --- a/hgext/remotefilelog/repack.py +++ b/hgext/remotefilelog/repack.py @@ -49,10 +49,8 @@ msg = _("(running background incremental repack)\n") if packsonly: cmd.append('--packsonly') - cmd = ' '.join(map(procutil.shellquote, cmd)) - repo.ui.warn(msg) - extutil.runshellcommand(cmd, encoding.environ) + extutil.runbgcommand(cmd, encoding.environ) def fullrepack(repo, options=None): """If ``packsonly`` is True, stores creating only loose objects are skipped. diff --git a/hgext/remotefilelog/shallowrepo.py b/hgext/remotefilelog/shallowrepo.py --- a/hgext/remotefilelog/shallowrepo.py +++ b/hgext/remotefilelog/shallowrepo.py @@ -199,9 +199,7 @@ cmd.append('--repack') if revs: cmd += ['-r', revs] - cmd = ' '.join(map(procutil.shellquote, cmd)) - - extutil.runshellcommand(cmd, encoding.environ) + extutil.runbgcommand(cmd, encoding.environ) def prefetch(self, revs, base=None, pats=None, opts=None): """Prefetches all the necessary file revisions for the given revs