From patchwork Thu May 25 10:56:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3,of,4] local-clone: also copy revs-branch-cache files From: Pierre-Yves David X-Patchwork-Id: 20895 Message-Id: <2d5c478a7511cea26f11.1495709772@nodosa.octopoid.net> To: mercurial-devel@mercurial-scm.org Date: Thu, 25 May 2017 12:56:12 +0200 # HG changeset patch # User Pierre-Yves David # Date 1495706733 -7200 # Thu May 25 12:05:33 2017 +0200 # Node ID 2d5c478a7511cea26f1177b4842264c40b679f3f # Parent 92bfcf826e4613c6d80afce8b6e3cad37539ca69 # EXP-Topic clone-caches # Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ # hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r 2d5c478a7511 local-clone: also copy revs-branch-cache files This cache provides a large speedup for some repositories. Keeping it around is valuable. diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -425,7 +425,8 @@ def _cachetocopy(srcrepo): # In local clones we're copying all nodes, not just served # ones. Therefore copy all branch caches over. cachefiles = ['branch2'] - cachefiles.extend('branch2-%s' % f for f in repoview.filtertable) + cachefiles += ['branch2-%s' % f for f in repoview.filtertable] + cachefiles += ['rbc-names-v1', 'rbc-revs-v1'] return cachefiles def clone(ui, peeropts, source, dest=None, pull=False, rev=None, diff --git a/tests/test-clone.t b/tests/test-clone.t --- a/tests/test-clone.t +++ b/tests/test-clone.t @@ -52,6 +52,8 @@ Ensure branchcache got copied over: checkisexec (execbit !) checklink (symlink !) checklink-target (symlink !) + rbc-names-v1 + rbc-revs-v1 $ cat a a @@ -99,6 +101,8 @@ Ensure branchcache got copied over: $ ls .hg/cache branch2-served + rbc-names-v1 + rbc-revs-v1 $ cat a 2>/dev/null || echo "a not present" a not present