changeset 42512:df1419c5756a

remotefilelog: tell runbgcommand to not block on child process startup These two invocations will always find a binary because they're re-running hg. As a result, we can skip waiting for the subprocess to start running and save a little bit of wall-time. Differential Revision: https://phab.mercurial-scm.org/D6539
author Augie Fackler <augie@google.com>
date Tue, 18 Jun 2019 09:57:06 -0400
parents ca1014ad3de4
children 089f14dd7df3
files hgext/remotefilelog/repack.py hgext/remotefilelog/shallowrepo.py
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/remotefilelog/repack.py	Tue Jun 18 09:43:27 2019 -0400
+++ b/hgext/remotefilelog/repack.py	Tue Jun 18 09:57:06 2019 -0400
@@ -43,7 +43,8 @@
     if packsonly:
         cmd.append('--packsonly')
     repo.ui.warn(msg)
-    procutil.runbgcommand(cmd, encoding.environ)
+    # We know this command will find a binary, so don't block on it starting.
+    procutil.runbgcommand(cmd, encoding.environ, ensurestart=False)
 
 def fullrepack(repo, options=None):
     """If ``packsonly`` is True, stores creating only loose objects are skipped.
--- a/hgext/remotefilelog/shallowrepo.py	Tue Jun 18 09:43:27 2019 -0400
+++ b/hgext/remotefilelog/shallowrepo.py	Tue Jun 18 09:57:06 2019 -0400
@@ -190,7 +190,9 @@
                 cmd.append('--repack')
             if revs:
                 cmd += ['-r', revs]
-            procutil.runbgcommand(cmd, encoding.environ)
+            # We know this command will find a binary, so don't block
+            # on it starting.
+            procutil.runbgcommand(cmd, encoding.environ, ensurestart=False)
 
         def prefetch(self, revs, base=None, pats=None, opts=None):
             """Prefetches all the necessary file revisions for the given revs