##// END OF EJS Templates
revlog: also migrates `revlog.upperboundcomp` to ConfigClass...
marmoute -
r51976:5645524c default
parent child Browse files
Show More
@@ -425,7 +425,6 b' class revlog:'
425 that test, debug, or performance measurement code might not set this to
425 that test, debug, or performance measurement code might not set this to
426 accurate value.
426 accurate value.
427 """
427 """
428 self.upperboundcomp = upperboundcomp
429
428
430 self.radix = radix
429 self.radix = radix
431
430
@@ -460,6 +459,7 b' class revlog:'
460 self.delta_config = self.opener.options[b'delta-config'].copy()
459 self.delta_config = self.opener.options[b'delta-config'].copy()
461 else:
460 else:
462 self.delta_config = DeltaConfig()
461 self.delta_config = DeltaConfig()
462 self.delta_config.upper_bound_comp = upperboundcomp
463
463
464 # 3-tuple of (node, rev, text) for a raw revision.
464 # 3-tuple of (node, rev, text) for a raw revision.
465 self._revisioncache = None
465 self._revisioncache = None
@@ -574,6 +574,16 b' class revlog:'
574 return self.feature_config.compression_engine
574 return self.feature_config.compression_engine
575
575
576 @property
576 @property
577 def upperboundcomp(self):
578 """temporary compatibility proxy"""
579 util.nouideprecwarn(
580 b"use revlog.delta_config.upper_bound_comp",
581 b"6.6",
582 stacklevel=2,
583 )
584 return self.delta_config.upper_bound_comp
585
586 @property
577 def _compengineopts(self):
587 def _compengineopts(self):
578 """temporary compatibility proxy"""
588 """temporary compatibility proxy"""
579 util.nouideprecwarn(
589 util.nouideprecwarn(
@@ -784,8 +784,8 b' def _candidategroups('
784 if deltas_limit < chainsize:
784 if deltas_limit < chainsize:
785 tested.add(rev)
785 tested.add(rev)
786 continue
786 continue
787 if sparse and revlog.upperboundcomp is not None:
787 if sparse and revlog.delta_config.upper_bound_comp is not None:
788 maxcomp = revlog.upperboundcomp
788 maxcomp = revlog.delta_config.upper_bound_comp
789 basenotsnap = (p1, p2, nullrev)
789 basenotsnap = (p1, p2, nullrev)
790 if rev not in basenotsnap and revlog.issnapshot(rev):
790 if rev not in basenotsnap and revlog.issnapshot(rev):
791 snapshotdepth = revlog.snapshotdepth(rev)
791 snapshotdepth = revlog.snapshotdepth(rev)
@@ -1186,8 +1186,10 b' class deltacomputer:'
1186 msg %= len(delta)
1186 msg %= len(delta)
1187 self._write_debug(msg)
1187 self._write_debug(msg)
1188 # snapshotdept need to be neither None nor 0 level snapshot
1188 # snapshotdept need to be neither None nor 0 level snapshot
1189 if revlog.upperboundcomp is not None and snapshotdepth:
1189 if revlog.delta_config.upper_bound_comp is not None and snapshotdepth:
1190 lowestrealisticdeltalen = len(delta) // revlog.upperboundcomp
1190 lowestrealisticdeltalen = (
1191 len(delta) // revlog.delta_config.upper_bound_comp
1192 )
1191 snapshotlimit = revinfo.textlen >> snapshotdepth
1193 snapshotlimit = revinfo.textlen >> snapshotdepth
1192 if self._debug_search:
1194 if self._debug_search:
1193 msg = b"DBG-DELTAS-SEARCH: projected-lower-size=%d\n"
1195 msg = b"DBG-DELTAS-SEARCH: projected-lower-size=%d\n"
General Comments 0
You need to be logged in to leave comments. Login now