Show More
@@ -594,16 +594,15 b' def clonewithshare(' | |||||
594 | return srcpeer, peer(ui, peeropts, dest) |
|
594 | return srcpeer, peer(ui, peeropts, dest) | |
595 |
|
595 | |||
596 |
|
596 | |||
597 |
# Recomputing |
|
597 | # Recomputing caches is often slow on big repos, so copy them. | |
598 | # so just copy it |
|
|||
599 | def _copycache(srcrepo, dstcachedir, fname): |
|
598 | def _copycache(srcrepo, dstcachedir, fname): | |
600 | """copy a cache from srcrepo to destcachedir (if it exists)""" |
|
599 | """copy a cache from srcrepo to destcachedir (if it exists)""" | |
601 |
src |
|
600 | srcfname = srcrepo.cachevfs.join(fname) | |
602 |
dst |
|
601 | dstfname = os.path.join(dstcachedir, fname) | |
603 |
if os.path.exists(src |
|
602 | if os.path.exists(srcfname): | |
604 | if not os.path.exists(dstcachedir): |
|
603 | if not os.path.exists(dstcachedir): | |
605 | os.mkdir(dstcachedir) |
|
604 | os.mkdir(dstcachedir) | |
606 |
util.copyfile(src |
|
605 | util.copyfile(srcfname, dstfname) | |
607 |
|
606 | |||
608 |
|
607 | |||
609 | def clone( |
|
608 | def clone( |
@@ -56,6 +56,17 b" share shouldn't have a full cache dir, o" | |||||
56 | rbc-revs-v1 |
|
56 | rbc-revs-v1 | |
57 | tags2-visible |
|
57 | tags2-visible | |
58 |
|
58 | |||
|
59 | Cloning a shared repo should pick up the full cache dir on the other hand. | |||
|
60 | ||||
|
61 | $ hg clone . ../repo2-clone | |||
|
62 | updating to branch default | |||
|
63 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
64 | $ ls -1 ../repo2-clone/.hg/cache | |||
|
65 | branch2-served | |||
|
66 | rbc-names-v1 | |||
|
67 | rbc-revs-v1 | |||
|
68 | tags2-visible | |||
|
69 | ||||
59 | Some sed versions appends newline, some don't, and some just fails |
|
70 | Some sed versions appends newline, some don't, and some just fails | |
60 |
|
71 | |||
61 | $ cat .hg/sharedpath; echo |
|
72 | $ cat .hg/sharedpath; echo |
General Comments 0
You need to be logged in to leave comments.
Login now