Show More
@@ -824,6 +824,16 b' def local_copy(src_repo, dest_repo):' | |||
|
824 | 824 | |
|
825 | 825 | with dest_repo.lock(): |
|
826 | 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 | 837 | entries, totalfilesize = _v2_walk( |
|
828 | 838 | src_repo, |
|
829 | 839 | includes=None, |
@@ -834,7 +844,7 b' def local_copy(src_repo, dest_repo):' | |||
|
834 | 844 | dest_vfs_map = _makemap(dest_repo) |
|
835 | 845 | progress = src_repo.ui.makeprogress( |
|
836 | 846 | topic=_(b'linking'), |
|
837 | total=len(entries), | |
|
847 | total=len(entries) + bm_count, | |
|
838 | 848 | unit=_(b'files'), |
|
839 | 849 | ) |
|
840 | 850 | # copy files |
@@ -848,18 +858,16 b' def local_copy(src_repo, dest_repo):' | |||
|
848 | 858 | hardlink = _copy_files(src_vfs_map, dest_vfs_map, files, progress) |
|
849 | 859 | |
|
850 | 860 | # copy bookmarks over |
|
851 | src_book_vfs = bookmarks.bookmarksvfs(src_repo) | |
|
852 | srcbookmarks = src_book_vfs.join(b'bookmarks') | |
|
853 | dst_book_vfs = bookmarks.bookmarksvfs(dest_repo) | |
|
854 | dstbookmarks = dst_book_vfs.join(b'bookmarks') | |
|
855 | if os.path.exists(srcbookmarks): | |
|
861 | if bm_count: | |
|
862 | dst_book_vfs = bookmarks.bookmarksvfs(dest_repo) | |
|
863 | dstbookmarks = dst_book_vfs.join(b'bookmarks') | |
|
856 | 864 | util.copyfile(srcbookmarks, dstbookmarks) |
|
857 | 865 | progress.complete() |
|
858 | 866 | if hardlink: |
|
859 | 867 | msg = b'linked %d files\n' |
|
860 | 868 | else: |
|
861 | 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 | 872 | with dest_repo.transaction(b"localclone") as tr: |
|
865 | 873 | dest_repo.store.write(tr) |
General Comments 0
You need to be logged in to leave comments.
Login now