Show More
@@ -824,6 +824,16 b' def local_copy(src_repo, dest_repo):' | |||||
824 |
|
824 | |||
825 | with dest_repo.lock(): |
|
825 | with dest_repo.lock(): | |
826 | with src_repo.lock(): |
|
826 | with src_repo.lock(): | |
|
827 | ||||
|
828 | # bookmark is not integrated to the streaming as it might use the | |||
|
829 | # `repo.vfs` and they are too many sentitive data accessible | |||
|
830 | # through `repo.vfs` to expose it to streaming clone. | |||
|
831 | src_book_vfs = bookmarks.bookmarksvfs(src_repo) | |||
|
832 | srcbookmarks = src_book_vfs.join(b'bookmarks') | |||
|
833 | bm_count = 0 | |||
|
834 | if os.path.exists(srcbookmarks): | |||
|
835 | bm_count = 1 | |||
|
836 | ||||
827 | entries, totalfilesize = _v2_walk( |
|
837 | entries, totalfilesize = _v2_walk( | |
828 | src_repo, |
|
838 | src_repo, | |
829 | includes=None, |
|
839 | includes=None, | |
@@ -834,7 +844,7 b' def local_copy(src_repo, dest_repo):' | |||||
834 | dest_vfs_map = _makemap(dest_repo) |
|
844 | dest_vfs_map = _makemap(dest_repo) | |
835 | progress = src_repo.ui.makeprogress( |
|
845 | progress = src_repo.ui.makeprogress( | |
836 | topic=_(b'linking'), |
|
846 | topic=_(b'linking'), | |
837 | total=len(entries), |
|
847 | total=len(entries) + bm_count, | |
838 | unit=_(b'files'), |
|
848 | unit=_(b'files'), | |
839 | ) |
|
849 | ) | |
840 | # copy files |
|
850 | # copy files | |
@@ -848,18 +858,16 b' def local_copy(src_repo, dest_repo):' | |||||
848 | hardlink = _copy_files(src_vfs_map, dest_vfs_map, files, progress) |
|
858 | hardlink = _copy_files(src_vfs_map, dest_vfs_map, files, progress) | |
849 |
|
859 | |||
850 | # copy bookmarks over |
|
860 | # copy bookmarks over | |
851 | src_book_vfs = bookmarks.bookmarksvfs(src_repo) |
|
861 | if bm_count: | |
852 | srcbookmarks = src_book_vfs.join(b'bookmarks') |
|
862 | dst_book_vfs = bookmarks.bookmarksvfs(dest_repo) | |
853 | dst_book_vfs = bookmarks.bookmarksvfs(dest_repo) |
|
863 | dstbookmarks = dst_book_vfs.join(b'bookmarks') | |
854 | dstbookmarks = dst_book_vfs.join(b'bookmarks') |
|
|||
855 | if os.path.exists(srcbookmarks): |
|
|||
856 | util.copyfile(srcbookmarks, dstbookmarks) |
|
864 | util.copyfile(srcbookmarks, dstbookmarks) | |
857 | progress.complete() |
|
865 | progress.complete() | |
858 | if hardlink: |
|
866 | if hardlink: | |
859 | msg = b'linked %d files\n' |
|
867 | msg = b'linked %d files\n' | |
860 | else: |
|
868 | else: | |
861 | msg = b'copied %d files\n' |
|
869 | msg = b'copied %d files\n' | |
862 | src_repo.ui.debug(msg % len(entries)) |
|
870 | src_repo.ui.debug(msg % (len(entries) + bm_count)) | |
863 |
|
871 | |||
864 | with dest_repo.transaction(b"localclone") as tr: |
|
872 | with dest_repo.transaction(b"localclone") as tr: | |
865 | dest_repo.store.write(tr) |
|
873 | dest_repo.store.write(tr) |
General Comments 0
You need to be logged in to leave comments.
Login now