mercurial/streamclone.py
changeset 50474 4cbdfab6f812
parent 50469 9fdc28e21b68
child 50509 a32d739b0ffb
equal deleted inserted replaced
50473:2b2284cf949b 50474:4cbdfab6f812
   269     # Get consistent snapshot of repo, lock during scan.
   269     # Get consistent snapshot of repo, lock during scan.
   270     with repo.lock():
   270     with repo.lock():
   271         repo.ui.debug(b'scanning\n')
   271         repo.ui.debug(b'scanning\n')
   272         for entry in _walkstreamfiles(repo):
   272         for entry in _walkstreamfiles(repo):
   273             for f in entry.files():
   273             for f in entry.files():
   274                 if f.file_size:
   274                 file_size = f.file_size(repo.store.vfs)
   275                     entries.append((f.unencoded_path, f.file_size))
   275                 if file_size:
   276                     total_bytes += f.file_size
   276                     entries.append((f.unencoded_path, file_size))
       
   277                     total_bytes += file_size
   277         _test_sync_point_walk_1(repo)
   278         _test_sync_point_walk_1(repo)
   278     _test_sync_point_walk_2(repo)
   279     _test_sync_point_walk_2(repo)
   279 
   280 
   280     repo.ui.debug(
   281     repo.ui.debug(
   281         b'%d files, %d bytes to transfer\n' % (len(entries), total_bytes)
   282         b'%d files, %d bytes to transfer\n' % (len(entries), total_bytes)
   678     if includes or excludes:
   679     if includes or excludes:
   679         matcher = narrowspec.match(repo.root, includes, excludes)
   680         matcher = narrowspec.match(repo.root, includes, excludes)
   680 
   681 
   681     for entry in _walkstreamfiles(repo, matcher):
   682     for entry in _walkstreamfiles(repo, matcher):
   682         for f in entry.files():
   683         for f in entry.files():
   683             if f.file_size:
   684             file_size = f.file_size(repo.store.vfs)
       
   685             if file_size:
   684                 ft = _fileappend
   686                 ft = _fileappend
   685                 if f.is_volatile:
   687                 if f.is_volatile:
   686                     ft = _filefull
   688                     ft = _filefull
   687                 entries.append((_srcstore, f.unencoded_path, ft, f.file_size))
   689                 entries.append((_srcstore, f.unencoded_path, ft, file_size))
   688                 totalfilesize += f.file_size
   690                 totalfilesize += file_size
   689     for name in _walkstreamfullstorefiles(repo):
   691     for name in _walkstreamfullstorefiles(repo):
   690         if repo.svfs.exists(name):
   692         if repo.svfs.exists(name):
   691             totalfilesize += repo.svfs.lstat(name).st_size
   693             totalfilesize += repo.svfs.lstat(name).st_size
   692             entries.append((_srcstore, name, _filefull, None))
   694             entries.append((_srcstore, name, _filefull, None))
   693     if includeobsmarkers and repo.svfs.exists(b'obsstore'):
   695     if includeobsmarkers and repo.svfs.exists(b'obsstore'):