Show More
@@ -420,6 +420,14 b' def _copycache(srcrepo, dstcachedir, fna' | |||||
420 | os.mkdir(dstcachedir) |
|
420 | os.mkdir(dstcachedir) | |
421 | util.copyfile(srcbranchcache, dstbranchcache) |
|
421 | util.copyfile(srcbranchcache, dstbranchcache) | |
422 |
|
422 | |||
|
423 | def _cachetocopy(srcrepo): | |||
|
424 | """return the list of cache file valuable to copy during a clone""" | |||
|
425 | # In local clones we're copying all nodes, not just served | |||
|
426 | # ones. Therefore copy all branch caches over. | |||
|
427 | cachefiles = ['branch2'] | |||
|
428 | cachefiles.extend('branch2-%s' % f for f in repoview.filtertable) | |||
|
429 | return cachefiles | |||
|
430 | ||||
423 | def clone(ui, peeropts, source, dest=None, pull=False, rev=None, |
|
431 | def clone(ui, peeropts, source, dest=None, pull=False, rev=None, | |
424 | update=True, stream=False, branch=None, shareopts=None): |
|
432 | update=True, stream=False, branch=None, shareopts=None): | |
425 | """Make a copy of an existing repository. |
|
433 | """Make a copy of an existing repository. | |
@@ -578,11 +586,8 b' def clone(ui, peeropts, source, dest=Non' | |||||
578 | util.copyfile(srcbookmarks, dstbookmarks) |
|
586 | util.copyfile(srcbookmarks, dstbookmarks) | |
579 |
|
587 | |||
580 | dstcachedir = os.path.join(destpath, 'cache') |
|
588 | dstcachedir = os.path.join(destpath, 'cache') | |
581 | # In local clones we're copying all nodes, not just served |
|
589 | for cache in _cachetocopy(srcrepo): | |
582 | # ones. Therefore copy all branch caches over. |
|
590 | _copycache(srcrepo, dstcachedir, cache) | |
583 | _copycache(srcrepo, dstcachedir, 'branch2') |
|
|||
584 | for cachename in repoview.filtertable: |
|
|||
585 | _copycache(srcrepo, dstcachedir, 'branch2-%s' % cachename) |
|
|||
586 |
|
591 | |||
587 | # we need to re-init the repo after manually copying the data |
|
592 | # we need to re-init the repo after manually copying the data | |
588 | # into it |
|
593 | # into it |
General Comments 0
You need to be logged in to leave comments.
Login now