Mercurial > hg
comparison mercurial/revlogutils/deltas.py @ 50654:bfb6404089a5 stable
delta-find: gather the condition to blindly use a full snapshot together
We are about to make the `if` body bigger, so having only one of them is simpler/
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 08 Jun 2023 03:11:51 +0200 |
parents | f930b1b1d671 |
children | 485c9410b75a |
comparison
equal
deleted
inserted
replaced
50653:f930b1b1d671 | 50654:bfb6404089a5 |
---|---|
1294 else: | 1294 else: |
1295 p2_chain_len = -1 | 1295 p2_chain_len = -1 |
1296 dbg['p1-chain-len'] = p1_chain_len | 1296 dbg['p1-chain-len'] = p1_chain_len |
1297 dbg['p2-chain-len'] = p2_chain_len | 1297 dbg['p2-chain-len'] = p2_chain_len |
1298 | 1298 |
1299 if not revinfo.textlen: | 1299 # 1) if the revision is empty, no amount of delta can beat it |
1300 # | |
1301 # 2) no delta for flag processor revision (see "candelta" for why) | |
1302 # not calling candelta since only one revision needs test, also to | |
1303 # avoid overhead fetching flags again. | |
1304 if not revinfo.textlen or revinfo.flags & REVIDX_RAWTEXT_CHANGING_FLAGS: | |
1300 return self._fullsnapshotinfo(fh, revinfo, target_rev) | 1305 return self._fullsnapshotinfo(fh, revinfo, target_rev) |
1301 | 1306 |
1302 if excluded_bases is None: | 1307 if excluded_bases is None: |
1303 excluded_bases = set() | 1308 excluded_bases = set() |
1304 | |
1305 # no delta for flag processor revision (see "candelta" for why) | |
1306 # not calling candelta since only one revision needs test, also to | |
1307 # avoid overhead fetching flags again. | |
1308 if revinfo.flags & REVIDX_RAWTEXT_CHANGING_FLAGS: | |
1309 return self._fullsnapshotinfo(fh, revinfo, target_rev) | |
1310 | 1309 |
1311 # count the number of different delta we tried (for debug purpose) | 1310 # count the number of different delta we tried (for debug purpose) |
1312 dbg_try_count = 0 | 1311 dbg_try_count = 0 |
1313 # count the number of "search round" we did. (for debug purpose) | 1312 # count the number of "search round" we did. (for debug purpose) |
1314 dbg_try_rounds = 0 | 1313 dbg_try_rounds = 0 |