##// END OF EJS Templates
local-clone: perform the hardlink/copy based from _entries_walk returns...
marmoute -
r51526:f2ae815a default
parent child Browse files
Show More
@@ -900,7 +900,7 b' def _copy_files(src_vfs_map, dst_vfs_map'
900 hardlink[0] = False
900 hardlink[0] = False
901 progress.topic = _(b'copying')
901 progress.topic = _(b'copying')
902
902
903 for k, path, size in entries:
903 for k, path in entries:
904 src_vfs = src_vfs_map[k]
904 src_vfs = src_vfs_map[k]
905 dst_vfs = dst_vfs_map[k]
905 dst_vfs = dst_vfs_map[k]
906 src_path = src_vfs.join(path)
906 src_path = src_vfs.join(path)
@@ -951,17 +951,19 b' def local_copy(src_repo, dest_repo):'
951 if os.path.exists(srcbookmarks):
951 if os.path.exists(srcbookmarks):
952 bm_count = 1
952 bm_count = 1
953
953
954 entries, totalfilesize = _v2_walk(
954 entries = _entries_walk(
955 src_repo,
955 src_repo,
956 includes=None,
956 includes=None,
957 excludes=None,
957 excludes=None,
958 includeobsmarkers=True,
958 includeobsmarkers=True,
959 )
959 )
960 entries = list(entries)
960 src_vfs_map = _makemap(src_repo)
961 src_vfs_map = _makemap(src_repo)
961 dest_vfs_map = _makemap(dest_repo)
962 dest_vfs_map = _makemap(dest_repo)
963 total_files = sum(len(e[1].files()) for e in entries) + bm_count
962 progress = src_repo.ui.makeprogress(
964 progress = src_repo.ui.makeprogress(
963 topic=_(b'linking'),
965 topic=_(b'linking'),
964 total=len(entries) + bm_count,
966 total=total_files,
965 unit=_(b'files'),
967 unit=_(b'files'),
966 )
968 )
967 # copy files
969 # copy files
@@ -971,7 +973,11 b' def local_copy(src_repo, dest_repo):'
971 # this would also requires checks that nobody is appending any data
973 # this would also requires checks that nobody is appending any data
972 # to the files while we do the clone, so this is not done yet. We
974 # to the files while we do the clone, so this is not done yet. We
973 # could do this blindly when copying files.
975 # could do this blindly when copying files.
974 files = ((k, path, size) for k, path, ftype, size in entries)
976 files = [
977 (vfs_key, f.unencoded_path)
978 for vfs_key, e in entries
979 for f in e.files()
980 ]
975 hardlink = _copy_files(src_vfs_map, dest_vfs_map, files, progress)
981 hardlink = _copy_files(src_vfs_map, dest_vfs_map, files, progress)
976
982
977 # copy bookmarks over
983 # copy bookmarks over
@@ -984,7 +990,7 b' def local_copy(src_repo, dest_repo):'
984 msg = b'linked %d files\n'
990 msg = b'linked %d files\n'
985 else:
991 else:
986 msg = b'copied %d files\n'
992 msg = b'copied %d files\n'
987 src_repo.ui.debug(msg % (len(entries) + bm_count))
993 src_repo.ui.debug(msg % total_files)
988
994
989 with dest_repo.transaction(b"localclone") as tr:
995 with dest_repo.transaction(b"localclone") as tr:
990 dest_repo.store.write(tr)
996 dest_repo.store.write(tr)
General Comments 0
You need to be logged in to leave comments. Login now