A local clone of a Mercurial repository doesn't retain the branchcache: $ hg clone hg hg2 $ ls -al hg2/.hg/cache ls: cannot access hg2/.hg/cache: No such file or directory A remote clone generates a proper branch cache: $ hg clone http://selenic.com hg hg3 $ ls -al hg3/.hg/cache -rw-r--r-- 1 dsp users 148 Jun 20 12:47 branch2-served The missing branchcache will result in a branch cache regeneration which can be very slow on large repositories.
Marking as feature as this is only visible in performance.
FWIW, I've started playing around with moving the caches into store and part of transactions because of bug 4255. I've also toyed with the idea of transferring the data in the caches as part of clone/push/pull. I'll likely wait for bundle2 until I do that though. Getting caches into store is complicated enough as it is.
Not super exited to see cache information part of store… More exited at the idea of cache rollback and bundle2 usage.
These are local clones, so they don't generate a bundle2 yet. They instead copy or hardlink files over. I'm going to send patches to copy over the branchcache shortly.
Fixed by http://selenic.com/repo/hg/rev/ab0c42d22522 Siddharth Agarwal <sid0@fb.com> clone: for local clones, copy branchcache from the right location (issue4286) The unfiltered branchcache is in .hg/cache/branch2, not .hg/store/cache/branch2. (please test the fix)
Fixed by http://selenic.com/repo/hg/rev/4bc1fd86e915 Siddharth Agarwal <sid0@fb.com> clone: for local clones, copy over filtered branchcaches as well (issue4286) Local clones copy/hardlink over files directly, so the branchcaches should all be valid. There's a slight chance that a read operation would update one of the branchcaches, but we hold a lock over the source repo so they shouldn't cause an invalid branchcache to be copied over, just a different, valid one. (please test the fix)