--- a/hgext/remotefilelog/repack.py Mon Dec 09 22:24:58 2019 -0800
+++ b/hgext/remotefilelog/repack.py Fri Dec 13 09:43:43 2019 -0800
@@ -36,9 +36,7 @@
pass
-def backgroundrepack(
- repo, incremental=True, packsonly=False, ensurestart=False
-):
+def backgroundrepack(repo, incremental=True, packsonly=False):
cmd = [procutil.hgexecutable(), b'-R', repo.origroot, b'repack']
msg = _(b"(running background repack)\n")
if incremental:
@@ -48,7 +46,11 @@
cmd.append(b'--packsonly')
repo.ui.warn(msg)
# We know this command will find a binary, so don't block on it starting.
- procutil.runbgcommand(cmd, encoding.environ, ensurestart=ensurestart)
+ kwargs = {}
+ if repo.ui.configbool(b'devel', b'remotefilelog.bg-wait'):
+ kwargs['record_wait'] = repo.ui.atexit
+
+ procutil.runbgcommand(cmd, encoding.environ, ensurestart=False, **kwargs)
def fullrepack(repo, options=None):