--- a/mercurial/hg.py Wed Jun 09 15:33:58 2021 +0200
+++ b/mercurial/hg.py Tue Jun 08 02:06:45 2021 +0200
@@ -24,7 +24,6 @@
from . import (
bookmarks,
bundlerepo,
- cacheutil,
cmdutil,
destutil,
discovery,
@@ -866,18 +865,10 @@
requirements=dest_reqs,
)
destrepo = localrepo.makelocalrepository(ui, destrootpath)
+ destlock = destrepo.lock()
+ from . import streamclone # avoid cycle
- destpath = destrepo.vfs.base
- destlock = copystore(ui, srcrepo, destpath)
- # copy bookmarks over
- srcbookmarks = srcrepo.vfs.join(b'bookmarks')
- dstbookmarks = os.path.join(destpath, b'bookmarks')
- if os.path.exists(srcbookmarks):
- util.copyfile(srcbookmarks, dstbookmarks)
-
- dstcachedir = os.path.join(destpath, b'cache')
- for cache in cacheutil.cachetocopy(srcrepo):
- _copycache(srcrepo, dstcachedir, cache)
+ streamclone.local_copy(srcrepo, destrepo)
# we need to re-init the repo after manually copying the data
# into it