--- a/mercurial/changegroup.py Tue Mar 30 17:03:02 2021 +0200
+++ b/mercurial/changegroup.py Thu Apr 08 16:39:39 2021 +0200
@@ -293,7 +293,12 @@
# Only useful if we're adding sidedata categories. If both peers have
# the same categories, then we simply don't do anything.
- if self.version == b'04' and srctype == b'pull':
+ adding_sidedata = (
+ requirements.REVLOGV2_REQUIREMENT in repo.requirements
+ and self.version == b'04'
+ and srctype == b'pull'
+ )
+ if adding_sidedata:
sidedata_helpers = get_sidedata_helpers(
repo,
sidedata_categories or set(),