mercurial/hg.py
changeset 46123 5b9bb4e9a3bf
parent 46113 59fa3890d40a
child 46198 72007a9ac064
--- a/mercurial/hg.py	Mon Dec 14 18:19:58 2020 +0100
+++ b/mercurial/hg.py	Mon Dec 14 19:48:35 2020 +0100
@@ -594,16 +594,15 @@
     return srcpeer, peer(ui, peeropts, dest)
 
 
-# Recomputing branch cache might be slow on big repos,
-# so just copy it
+# Recomputing caches is often slow on big repos, so copy them.
 def _copycache(srcrepo, dstcachedir, fname):
     """copy a cache from srcrepo to destcachedir (if it exists)"""
-    srcbranchcache = srcrepo.vfs.join(b'cache/%s' % fname)
-    dstbranchcache = os.path.join(dstcachedir, fname)
-    if os.path.exists(srcbranchcache):
+    srcfname = srcrepo.cachevfs.join(fname)
+    dstfname = os.path.join(dstcachedir, fname)
+    if os.path.exists(srcfname):
         if not os.path.exists(dstcachedir):
             os.mkdir(dstcachedir)
-        util.copyfile(srcbranchcache, dstbranchcache)
+        util.copyfile(srcfname, dstfname)
 
 
 def clone(