From 2cdca65aedbeb8944bf0081bc4b91add38e794b8 Mon Sep 17 00:00:00 2001 From: Jun Wu Date: Mon, 31 Aug 2020 17:32:44 -0700 Subject: [PATCH] remotefilelog: runshellcommand -> spawndetached Summary: There seems to be no need to use a shell. Reviewed By: DurhamG Differential Revision: D23124756 fbshipit-source-id: 7de1c23e2325fe88dc4c6a2c90563d06f109ed2f --- eden/scm/edenscm/hgext/remotefilelog/repack.py | 6 ++---- eden/scm/edenscm/hgext/remotefilelog/shallowrepo.py | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/eden/scm/edenscm/hgext/remotefilelog/repack.py b/eden/scm/edenscm/hgext/remotefilelog/repack.py index c7f2de5202..1b9e0b4cec 100644 --- a/eden/scm/edenscm/hgext/remotefilelog/repack.py +++ b/eden/scm/edenscm/hgext/remotefilelog/repack.py @@ -16,7 +16,7 @@ from edenscm.mercurial import encoding, error, progress, util, vfs from edenscm.mercurial.i18n import _ from edenscm.mercurial.node import nullid, short -from ..extutil import flock, runshellcommand +from ..extutil import flock from . import constants, datapack, historypack, shallowutil @@ -38,11 +38,9 @@ def backgroundrepack(repo, incremental=True): cmd.append("--incremental") msg = _("(running background incremental repack)\n") - cmd = " ".join(map(util.shellquote, cmd)) - if not repo.ui.quiet: repo.ui.write_err(msg) - runshellcommand(cmd, encoding.environ) + util.spawndetached(cmd) def _runrustrepack(ui, packpath, stores, incremental, shared): diff --git a/eden/scm/edenscm/hgext/remotefilelog/shallowrepo.py b/eden/scm/edenscm/hgext/remotefilelog/shallowrepo.py index 7b8f199285..a182deea3e 100644 --- a/eden/scm/edenscm/hgext/remotefilelog/shallowrepo.py +++ b/eden/scm/edenscm/hgext/remotefilelog/shallowrepo.py @@ -13,7 +13,6 @@ from edenscm.mercurial.i18n import _ from edenscm.mercurial.node import hex, nullid, nullrev from edenscm.mercurial.pycompat import iteritems -from ..extutil import runshellcommand from . import constants, fileserverclient, remotefilectx, remotefilelog, shallowutil from .repack import domaintenancerepack @@ -125,9 +124,8 @@ def wraprepo(repo): cmd += ["-r", revs] if base: cmd += ["-b", base] - cmd = " ".join(map(util.shellquote, cmd)) - runshellcommand(cmd, encoding.environ) + util.spawndetached(cmd) def prefetch(self, revs, base=None, pats=None, opts=None, matcher=None): """Prefetches all the necessary file revisions for the given revs