Show More
@@ -1067,7 +1067,7 b' class _DeltaSearch(_BaseDeltaSearch):' | |||||
1067 | and good not in (self.p1, self.p2) |
|
1067 | and good not in (self.p1, self.p2) | |
1068 | and self.revlog.issnapshot(good) |
|
1068 | and self.revlog.issnapshot(good) | |
1069 | ): |
|
1069 | ): | |
1070 | self.current_stage = _STAGE_SNAPSHOT |
|
1070 | assert self.current_stage == _STAGE_SNAPSHOT | |
1071 | # refine snapshot down |
|
1071 | # refine snapshot down | |
1072 | previous = None |
|
1072 | previous = None | |
1073 | while previous != good: |
|
1073 | while previous != good: | |
@@ -1336,7 +1336,9 b' class deltacomputer:' | |||||
1336 |
|
1336 | |||
1337 | return delta |
|
1337 | return delta | |
1338 |
|
1338 | |||
1339 | def _builddeltainfo(self, revinfo, base, target_rev=None): |
|
1339 | def _builddeltainfo( | |
|
1340 | self, revinfo, base, target_rev=None, as_snapshot=False | |||
|
1341 | ): | |||
1340 | # can we use the cached delta? |
|
1342 | # can we use the cached delta? | |
1341 | revlog = self.revlog |
|
1343 | revlog = self.revlog | |
1342 | chainbase = revlog.chainbase(base) |
|
1344 | chainbase = revlog.chainbase(base) | |
@@ -1354,7 +1356,8 b' class deltacomputer:' | |||||
1354 | snapshotdepth = None |
|
1356 | snapshotdepth = None | |
1355 | if revlog.delta_config.sparse_revlog and deltabase == nullrev: |
|
1357 | if revlog.delta_config.sparse_revlog and deltabase == nullrev: | |
1356 | snapshotdepth = 0 |
|
1358 | snapshotdepth = 0 | |
1357 |
elif revlog.delta_config.sparse_revlog and |
|
1359 | elif revlog.delta_config.sparse_revlog and as_snapshot: | |
|
1360 | assert revlog.issnapshot(deltabase) | |||
1358 | # A delta chain should always be one full snapshot, |
|
1361 | # A delta chain should always be one full snapshot, | |
1359 | # zero or more semi-snapshots, and zero or more deltas |
|
1362 | # zero or more semi-snapshots, and zero or more deltas | |
1360 | p1, p2 = revlog.rev(revinfo.p1), revlog.rev(revinfo.p2) |
|
1363 | p1, p2 = revlog.rev(revinfo.p1), revlog.rev(revinfo.p2) | |
@@ -1679,6 +1682,7 b' class deltacomputer:' | |||||
1679 | revinfo, |
|
1682 | revinfo, | |
1680 | candidaterev, |
|
1683 | candidaterev, | |
1681 | target_rev=target_rev, |
|
1684 | target_rev=target_rev, | |
|
1685 | as_snapshot=search.current_stage == _STAGE_SNAPSHOT, | |||
1682 | ) |
|
1686 | ) | |
1683 | if self._debug_search: |
|
1687 | if self._debug_search: | |
1684 | delta_end = util.timer() |
|
1688 | delta_end = util.timer() |
@@ -279,7 +279,7 b' Test `debug-delta-find`' | |||||
279 | DBG-DELTAS-SEARCH: uncompressed-delta-size=33050 |
|
279 | DBG-DELTAS-SEARCH: uncompressed-delta-size=33050 | |
280 | DBG-DELTAS-SEARCH: delta-search-time=* (glob) |
|
280 | DBG-DELTAS-SEARCH: delta-search-time=* (glob) | |
281 | DBG-DELTAS-SEARCH: DELTA: length=19179 (GOOD) |
|
281 | DBG-DELTAS-SEARCH: DELTA: length=19179 (GOOD) | |
282 |
DBG-DELTAS: FILELOG:SPARSE-REVLOG-TEST-FILE: rev=4971: delta-base=4930 is-cached=1 - search-rounds=1 try-count=1 - delta-type= |
|
282 | DBG-DELTAS: FILELOG:SPARSE-REVLOG-TEST-FILE: rev=4971: delta-base=4930 is-cached=1 - search-rounds=1 try-count=1 - delta-type=delta snap-depth=-1 - p1-chain-length=15 p2-chain-length=-1 - duration=* (glob) | |
283 | $ hg debug-delta-find SPARSE-REVLOG-TEST-FILE 4971 --source p1 |
|
283 | $ hg debug-delta-find SPARSE-REVLOG-TEST-FILE 4971 --source p1 | |
284 | DBG-DELTAS-SEARCH: SEARCH rev=4971 |
|
284 | DBG-DELTAS-SEARCH: SEARCH rev=4971 | |
285 | DBG-DELTAS-SEARCH: ROUND #1 - 3 candidates - search-down |
|
285 | DBG-DELTAS-SEARCH: ROUND #1 - 3 candidates - search-down |
General Comments 0
You need to be logged in to leave comments.
Login now