##// END OF EJS Templates
local-clone: extract the listing of caches to copy...
marmoute -
r32493:3c8a71a8 default
parent child Browse files
Show More
@@ -420,6 +420,14 b' def _copycache(srcrepo, dstcachedir, fna'
420 420 os.mkdir(dstcachedir)
421 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 431 def clone(ui, peeropts, source, dest=None, pull=False, rev=None,
424 432 update=True, stream=False, branch=None, shareopts=None):
425 433 """Make a copy of an existing repository.
@@ -578,11 +586,8 b' def clone(ui, peeropts, source, dest=Non'
578 586 util.copyfile(srcbookmarks, dstbookmarks)
579 587
580 588 dstcachedir = os.path.join(destpath, 'cache')
581 # In local clones we're copying all nodes, not just served
582 # ones. Therefore copy all branch caches over.
583 _copycache(srcrepo, dstcachedir, 'branch2')
584 for cachename in repoview.filtertable:
585 _copycache(srcrepo, dstcachedir, 'branch2-%s' % cachename)
589 for cache in _cachetocopy(srcrepo):
590 _copycache(srcrepo, dstcachedir, cache)
586 591
587 592 # we need to re-init the repo after manually copying the data
588 593 # into it
General Comments 0
You need to be logged in to leave comments. Login now