Bug 4286 - Local clone doesn't retain branchcache.
Summary: Local clone doesn't retain branchcache.
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: All All
: normal feature
Assignee: Siddharth Agarwal
URL:
Keywords: easy
Depends on:
Blocks:
 
Reported: 2014-06-20 15:49 UTC by David Soria Parra
Modified: 2014-09-04 13:48 UTC (History)
5 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Soria Parra 2014-06-20 15:49 UTC
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.
Comment 1 Matt Mackall 2014-06-20 16:33 UTC
Marking as feature as this is only visible in performance.
Comment 2 Gregory Szorc 2014-06-20 17:01 UTC
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.
Comment 3 Pierre-Yves David 2014-06-23 07:17 UTC
Not super exited to see cache information part of store…

More exited at the idea of cache rollback and bundle2 usage.
Comment 4 Siddharth Agarwal 2014-08-21 18:57 UTC
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.
Comment 5 HG Bot 2014-08-21 20:15 UTC
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)
Comment 6 HG Bot 2014-08-21 20:15 UTC
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)