diff mercurial/bundle2.py @ 49767:f1887500f3ec

delta-find: add a `delta-reuse-policy` on configuration `path` That option allows to control the behavior on a per-path basis, opening the way to treating pulls from central servers differently than other operations.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 03 Dec 2022 01:24:34 +0100
parents 4188e75af983
children 385a4f8056e5
line wrap: on
line diff
--- a/mercurial/bundle2.py	Sat Dec 03 01:31:23 2022 +0100
+++ b/mercurial/bundle2.py	Sat Dec 03 01:24:34 2022 +0100
@@ -517,6 +517,10 @@
 
 
 def _processchangegroup(op, cg, tr, source, url, **kwargs):
+    if op.remote is not None and op.remote.path is not None:
+        remote_path = op.remote.path
+        kwargs = kwargs.copy()
+        kwargs['delta_base_reuse_policy'] = remote_path.delta_reuse_policy
     ret = cg.apply(op.repo, tr, source, url, **kwargs)
     op.records.add(
         b'changegroup',