Patchwork [1,of,2] clone: for local clones, copy the branchcache from the right location (issue4286)

login
register
mail settings
Submitter Siddharth Agarwal
Date Aug. 21, 2014, 11:14 p.m.
Message ID <bca131b8416bef570f2d.1408662893@devbig136.prn2.facebook.com>
Download mbox | patch
Permalink /patch/5549/
State Accepted
Headers show

Comments

Siddharth Agarwal - Aug. 21, 2014, 11:14 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1408661912 25200
#      Thu Aug 21 15:58:32 2014 -0700
# Node ID bca131b8416bef570f2d72e50100e26d451a691c
# Parent  373d25ae3077814c3c05062ed11f21d5447cacd7
clone: for local clones, copy the branchcache from the right location (issue4286)

The unfiltered branchcache is in .hg/cache/branch2, not
.hg/store/cache/branch2.
Siddharth Agarwal - Aug. 21, 2014, 11:24 p.m.
On 08/21/2014 04:14 PM, Siddharth Agarwal wrote:
> # HG changeset patch
> # User Siddharth Agarwal <sid0@fb.com>
> # Date 1408661912 25200
> #      Thu Aug 21 15:58:32 2014 -0700
> # Node ID bca131b8416bef570f2d72e50100e26d451a691c
> # Parent  373d25ae3077814c3c05062ed11f21d5447cacd7
> clone: for local clones, copy the branchcache from the right location (issue4286)

Oops, test-check-commit-hg.t fails with 'summary line too long'. I'll 
fix up and resend.

>
> The unfiltered branchcache is in .hg/cache/branch2, not
> .hg/store/cache/branch2.
>
> diff --git a/mercurial/hg.py b/mercurial/hg.py
> --- a/mercurial/hg.py
> +++ b/mercurial/hg.py
> @@ -367,7 +367,7 @@
>               # Recomputing branch cache might be slow on big repos,
>               # so just copy it
>               dstcachedir = os.path.join(destpath, 'cache')
> -            srcbranchcache = srcrepo.sjoin('cache/branch2')
> +            srcbranchcache = srcrepo.join('cache/branch2')
>               dstbranchcache = os.path.join(dstcachedir, 'branch2')
>               if os.path.exists(srcbranchcache):
>                   if not os.path.exists(dstcachedir):
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -367,7 +367,7 @@ 
             # Recomputing branch cache might be slow on big repos,
             # so just copy it
             dstcachedir = os.path.join(destpath, 'cache')
-            srcbranchcache = srcrepo.sjoin('cache/branch2')
+            srcbranchcache = srcrepo.join('cache/branch2')
             dstbranchcache = os.path.join(dstcachedir, 'branch2')
             if os.path.exists(srcbranchcache):
                 if not os.path.exists(dstcachedir):