diff mercurial/streamclone.py @ 40398:0ac794e0e285

streamclone: include obsstore file into stream bundle if client can read it
author Anton Shestakov <av6@dwimlabs.net>
date Fri, 05 Oct 2018 23:27:17 +0800
parents f0e8f27768eb
children 9aeb9e2d28a7
line wrap: on
line diff
--- a/mercurial/streamclone.py	Fri Oct 19 18:34:42 2018 -0400
+++ b/mercurial/streamclone.py	Fri Oct 05 23:27:17 2018 +0800
@@ -532,7 +532,7 @@
             finally:
                 fp.close()
 
-def generatev2(repo, includes, excludes):
+def generatev2(repo, includes, excludes, includeobsmarkers):
     """Emit content for version 2 of a streaming clone.
 
     the data stream consists the following entries:
@@ -567,6 +567,9 @@
             if repo.svfs.exists(name):
                 totalfilesize += repo.svfs.lstat(name).st_size
                 entries.append((_srcstore, name, _filefull, None))
+        if includeobsmarkers and repo.svfs.exists('obsstore'):
+            totalfilesize += repo.svfs.lstat('obsstore').st_size
+            entries.append((_srcstore, 'obsstore', _filefull, None))
         for name in cacheutil.cachetocopy(repo):
             if repo.cachevfs.exists(name):
                 totalfilesize += repo.cachevfs.lstat(name).st_size