marmoute created this revision. marmoute added a comment. Herald added subscribers: mercurial-devel, mjpieters. Herald added a reviewer: hg-reviewers.
target is the stable-branch REVISION SUMMARY The option does not seems to do what we want since it does not wait on the background process actually starting (eg: taking the lock). And the race have been dealt with another way anyway. This effectively back out changeset 2c74337e6483 <https://phab.mercurial-scm.org/rHG2c74337e6483e59c1e66830eb90725cc350bda49>. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D7590 AFFECTED FILES hgext/remotefilelog/__init__.py hgext/remotefilelog/repack.py hgext/remotefilelog/shallowrepo.py tests/test-remotefilelog-bgprefetch.t tests/test-remotefilelog-repack-fast.t tests/test-remotefilelog-repack.t CHANGE DETAILS diff --git a/tests/test-remotefilelog-repack.t b/tests/test-remotefilelog-repack.t --- a/tests/test-remotefilelog-repack.t +++ b/tests/test-remotefilelog-repack.t @@ -1,11 +1,8 @@ #require no-windows $ . "$TESTDIR/remotefilelog-library.sh" -# devel.remotefilelog.ensurestart: reduce race condition with -# waiton{repack/prefetch} $ cat >> $HGRCPATH <<EOF > [devel] - > remotefilelog.ensurestart=True > remotefilelog.bg-wait=True > EOF diff --git a/tests/test-remotefilelog-repack-fast.t b/tests/test-remotefilelog-repack-fast.t --- a/tests/test-remotefilelog-repack-fast.t +++ b/tests/test-remotefilelog-repack-fast.t @@ -1,13 +1,11 @@ #require no-windows $ . "$TESTDIR/remotefilelog-library.sh" -# devel.remotefilelog.ensurestart: reduce race condition with -# waiton{repack/prefetch} + $ cat >> $HGRCPATH <<EOF > [remotefilelog] > fastdatapack=True > [devel] - > remotefilelog.ensurestart=True > remotefilelog.bg-wait=True > EOF diff --git a/tests/test-remotefilelog-bgprefetch.t b/tests/test-remotefilelog-bgprefetch.t --- a/tests/test-remotefilelog-bgprefetch.t +++ b/tests/test-remotefilelog-bgprefetch.t @@ -1,11 +1,8 @@ #require no-windows $ . "$TESTDIR/remotefilelog-library.sh" -# devel.remotefilelog.ensurestart: reduce race condition with -# waiton{repack/prefetch} $ cat >> $HGRCPATH <<EOF > [devel] - > remotefilelog.ensurestart=True > remotefilelog.bg-wait=True > EOF diff --git a/hgext/remotefilelog/shallowrepo.py b/hgext/remotefilelog/shallowrepo.py --- a/hgext/remotefilelog/shallowrepo.py +++ b/hgext/remotefilelog/shallowrepo.py @@ -215,13 +215,7 @@ ) def backgroundprefetch( - self, - revs, - base=None, - repack=False, - pats=None, - opts=None, - ensurestart=False, + self, revs, base=None, repack=False, pats=None, opts=None, ): """Runs prefetch in background with optional repack """ @@ -236,9 +230,7 @@ if repo.ui.configbool(b'devel', b'remotefilelog.bg-wait'): kwargs['record_wait'] = repo.ui.atexit - procutil.runbgcommand( - cmd, encoding.environ, ensurestart=ensurestart, **kwargs - ) + procutil.runbgcommand(cmd, encoding.environ, **kwargs) 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 @@ -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: @@ -52,9 +50,7 @@ if repo.ui.configbool(b'devel', b'remotefilelog.bg-wait'): kwargs['record_wait'] = repo.ui.atexit - procutil.runbgcommand( - cmd, encoding.environ, ensurestart=ensurestart, **kwargs - ) + procutil.runbgcommand(cmd, encoding.environ, **kwargs) def fullrepack(repo, options=None): diff --git a/hgext/remotefilelog/__init__.py b/hgext/remotefilelog/__init__.py --- a/hgext/remotefilelog/__init__.py +++ b/hgext/remotefilelog/__init__.py @@ -229,7 +229,6 @@ configitem(b'packs', b'maxpacksize', default=0) configitem(b'packs', b'maxchainlen', default=1000) -configitem(b'devel', b'remotefilelog.ensurestart', default=False) configitem(b'devel', b'remotefilelog.bg-wait', default=False) # default TTL limit is 30 days @@ -1085,26 +1084,19 @@ prefetchrevset = ui.config(b'remotefilelog', b'pullprefetch') bgrepack = repo.ui.configbool(b'remotefilelog', b'backgroundrepack') bgprefetch = repo.ui.configbool(b'remotefilelog', b'backgroundprefetch') - ensurestart = repo.ui.configbool(b'devel', b'remotefilelog.ensurestart') if prefetchrevset: ui.status(_(b"prefetching file contents\n")) revs = scmutil.revrange(repo, [prefetchrevset]) base = repo[b'.'].rev() if bgprefetch: - repo.backgroundprefetch( - prefetchrevset, repack=bgrepack, ensurestart=ensurestart - ) + repo.backgroundprefetch(prefetchrevset, repack=bgrepack) else: repo.prefetch(revs, base=base) if bgrepack: - repackmod.backgroundrepack( - repo, incremental=True, ensurestart=ensurestart - ) + repackmod.backgroundrepack(repo, incremental=True) elif bgrepack: - repackmod.backgroundrepack( - repo, incremental=True, ensurestart=ensurestart - ) + repackmod.backgroundrepack(repo, incremental=True) return result @@ -1255,13 +1247,9 @@ revs = scmutil.revrange(repo, opts.get(b'rev')) repo.prefetch(revs, opts.get(b'base'), pats, opts) - ensurestart = repo.ui.configbool(b'devel', b'remotefilelog.ensurestart') - # Run repack in background if opts.get(b'repack'): - repackmod.backgroundrepack( - repo, incremental=True, ensurestart=ensurestart - ) + repackmod.backgroundrepack(repo, incremental=True) @command( @@ -1281,12 +1269,10 @@ ) def repack_(ui, repo, *pats, **opts): if opts.get(r'background'): - ensurestart = repo.ui.configbool(b'devel', b'remotefilelog.ensurestart') repackmod.backgroundrepack( repo, incremental=opts.get(r'incremental'), packsonly=opts.get(r'packsonly', False), - ensurestart=ensurestart, ) return To: marmoute, #hg-reviewers Cc: mjpieters, mercurial-devel _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel