diff mercurial/bundle2.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 81c80ed7c991
children 4ab6e7b4fe8a
line wrap: on
line diff
--- a/mercurial/bundle2.py	Fri Oct 19 18:34:42 2018 -0400
+++ b/mercurial/bundle2.py	Fri Oct 05 23:27:17 2018 +0800
@@ -1697,8 +1697,15 @@
     if (includepats or excludepats) and not narrowstream:
         raise error.Abort(_('server does not support narrow stream clones'))
 
+    includeobsmarkers = False
+    if repo.obsstore:
+        remoteversions = obsmarkersversion(bundler.capabilities)
+        if repo.obsstore._version in remoteversions:
+            includeobsmarkers = True
+
     filecount, bytecount, it = streamclone.generatev2(repo, includepats,
-                                                      excludepats)
+                                                      excludepats,
+                                                      includeobsmarkers)
     requirements = _formatrequirementsspec(repo.requirements)
     part = bundler.newpart('stream2', data=it)
     part.addparam('bytecount', '%d' % bytecount, mandatory=True)