Patchwork [4,of,4] local-clone: also copy tags related caches

login
register
mail settings
Submitter Pierre-Yves David
Date May 25, 2017, 10:56 a.m.
Message ID <20f11bbc7de105b9cdc4.1495709773@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/20897/
State Accepted
Headers show

Comments

Pierre-Yves David - May 25, 2017, 10:56 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1495706949 -7200
#      Thu May 25 12:09:09 2017 +0200
# Node ID 20f11bbc7de105b9cdc436ee85dbc65df75d122c
# Parent  2d5c478a7511cea26f1177b4842264c40b679f3f
# 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 20f11bbc7de1
local-clone: also copy tags related caches

This caches provide a large speedup for some repositories. Keeping it around is
valuable.

Patch

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -427,6 +427,9 @@  def _cachetocopy(srcrepo):
     cachefiles = ['branch2']
     cachefiles += ['branch2-%s' % f for f in repoview.filtertable]
     cachefiles += ['rbc-names-v1', 'rbc-revs-v1']
+    cachefiles += ['tags2']
+    cachefiles += ['tags2-%s' % f for f in repoview.filtertable]
+    cachefiles += ['hgtagsfnodes1']
     return cachefiles
 
 def clone(ui, peeropts, source, dest=None, pull=False, rev=None,
diff --git a/tests/test-tags.t b/tests/test-tags.t
--- a/tests/test-tags.t
+++ b/tests/test-tags.t
@@ -724,3 +724,11 @@  Check that the bundle includes cache dat
       f63cc8fe54e4d326f8d692805d70e092f851ddb1
       40f0358cb314c824a5929ee527308d90e023bc10
   hgtagsfnodes -- 'sortdict()'
+
+Check that local clone includes cache data
+
+  $ hg clone tagsclient tags-local-clone
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ (cd tags-local-clone/.hg/cache/; ls -1 tag*)
+  tags2-visible