mercurial/streamclone.py
changeset 50512 a32d739b0ffb
parent 50477 4cbdfab6f812
child 50514 0925eaf09c8b
--- a/mercurial/streamclone.py	Mon May 22 10:20:24 2023 +0100
+++ b/mercurial/streamclone.py	Sun May 21 02:15:04 2023 +0200
@@ -241,8 +241,8 @@
 
 
 # This is it's own function so extensions can override it.
-def _walkstreamfiles(repo, matcher=None):
-    return repo.store.walk(matcher)
+def _walkstreamfiles(repo, matcher=None, phase=False):
+    return repo.store.walk(matcher, phase=phase)
 
 
 def generatev1(repo):
@@ -679,7 +679,8 @@
     if includes or excludes:
         matcher = narrowspec.match(repo.root, includes, excludes)
 
-    for entry in _walkstreamfiles(repo, matcher):
+    phase = not repo.publishing()
+    for entry in _walkstreamfiles(repo, matcher, phase=phase):
         for f in entry.files():
             file_size = f.file_size(repo.store.vfs)
             if file_size:
@@ -688,10 +689,6 @@
                     ft = _filefull
                 entries.append((_srcstore, f.unencoded_path, ft, file_size))
                 totalfilesize += file_size
-    for name in _walkstreamfullstorefiles(repo):
-        if repo.svfs.exists(name):
-            totalfilesize += repo.svfs.lstat(name).st_size
-            entries.append((_srcstore, name, _filefull, None))
     if includeobsmarkers and repo.svfs.exists(b'obsstore'):
         totalfilesize += repo.svfs.lstat(b'obsstore').st_size
         entries.append((_srcstore, b'obsstore', _filefull, None))