[PATCH 3 of 4] local-clone: also copy revs-branch-cache files

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu May 25 06:56:12 EDT 2017


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at octobus.net>
# 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


More information about the Mercurial-devel mailing list