D4937: remotefilelog: remove function that was described as deprecated
durin42 (Augie Fackler)
phabricator at mercurial-scm.org
Thu Oct 11 12:21:24 UTC 2018
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D4937
AFFECTED FILES
hgext/remotefilelog/extutil.py
hgext/remotefilelog/repack.py
hgext/remotefilelog/shallowrepo.py
CHANGE DETAILS
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
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/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.
To: durin42, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list