diff mercurial/exchange.py @ 43131:c17a63eb5d4c

sidedata: apply basic but tight security around exchange We don't currently have code to deal with exchange between repository using sidedata and repository not using sidedata. Until we implement such code (eg: dropping side data when pushing to a non-sidedata repo) we prevent the two kind of repo to speak to each other. This is somewhere similar to what 'treemanifest' does. Note that sidedata exchange is broken unless one use changegroup v3 anyway. See next changeset for details. Differential Revision: https://phab.mercurial-scm.org/D6939
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 06 Oct 2019 23:36:51 -0400
parents 8ff1ecfadcd1
children 01e8eefd9434
line wrap: on
line diff
--- a/mercurial/exchange.py	Tue Oct 08 02:19:04 2019 -0400
+++ b/mercurial/exchange.py	Sun Oct 06 23:36:51 2019 -0400
@@ -1049,6 +1049,8 @@
         cgpart.addparam(b'version', version)
     if b'treemanifest' in pushop.repo.requirements:
         cgpart.addparam(b'treemanifest', b'1')
+    if b'exp-sidedata-flag' in pushop.repo.requirements:
+        cgpart.addparam(b'exp-sidedata', b'1')
 
     def handlereply(op):
         """extract addchangegroup returns from server reply"""
@@ -2511,6 +2513,9 @@
     if b'treemanifest' in repo.requirements:
         part.addparam(b'treemanifest', b'1')
 
+    if b'exp-sidedata-flag' in repo.requirements:
+        part.addparam(b'exp-sidedata', b'1')
+
     if (
         kwargs.get(r'narrow', False)
         and kwargs.get(r'narrow_acl', False)