Show More
@@ -1259,6 +1259,43 b' class deltacomputer:' | |||||
1259 | if target_rev is None: |
|
1259 | if target_rev is None: | |
1260 | target_rev = len(self.revlog) |
|
1260 | target_rev = len(self.revlog) | |
1261 |
|
1261 | |||
|
1262 | gather_debug = self._gather_debug | |||
|
1263 | cachedelta = revinfo.cachedelta | |||
|
1264 | revlog = self.revlog | |||
|
1265 | ||||
|
1266 | p1r = p2r = None | |||
|
1267 | ||||
|
1268 | if gather_debug: | |||
|
1269 | start = util.timer() | |||
|
1270 | dbg = self._one_dbg_data() | |||
|
1271 | dbg['revision'] = target_rev | |||
|
1272 | target_revlog = b"UNKNOWN" | |||
|
1273 | target_type = self.revlog.target[0] | |||
|
1274 | target_key = self.revlog.target[1] | |||
|
1275 | if target_type == KIND_CHANGELOG: | |||
|
1276 | target_revlog = b'CHANGELOG:' | |||
|
1277 | elif target_type == KIND_MANIFESTLOG: | |||
|
1278 | target_revlog = b'MANIFESTLOG:' | |||
|
1279 | if target_key: | |||
|
1280 | target_revlog += b'%s:' % target_key | |||
|
1281 | elif target_type == KIND_FILELOG: | |||
|
1282 | target_revlog = b'FILELOG:' | |||
|
1283 | if target_key: | |||
|
1284 | target_revlog += b'%s:' % target_key | |||
|
1285 | dbg['target-revlog'] = target_revlog | |||
|
1286 | p1r = revlog.rev(revinfo.p1) | |||
|
1287 | p2r = revlog.rev(revinfo.p2) | |||
|
1288 | if p1r != nullrev: | |||
|
1289 | p1_chain_len = revlog._chaininfo(p1r)[0] | |||
|
1290 | else: | |||
|
1291 | p1_chain_len = -1 | |||
|
1292 | if p2r != nullrev: | |||
|
1293 | p2_chain_len = revlog._chaininfo(p2r)[0] | |||
|
1294 | else: | |||
|
1295 | p2_chain_len = -1 | |||
|
1296 | dbg['p1-chain-len'] = p1_chain_len | |||
|
1297 | dbg['p2-chain-len'] = p2_chain_len | |||
|
1298 | ||||
1262 | if not revinfo.textlen: |
|
1299 | if not revinfo.textlen: | |
1263 | return self._fullsnapshotinfo(fh, revinfo, target_rev) |
|
1300 | return self._fullsnapshotinfo(fh, revinfo, target_rev) | |
1264 |
|
1301 | |||
@@ -1271,34 +1308,17 b' class deltacomputer:' | |||||
1271 | if revinfo.flags & REVIDX_RAWTEXT_CHANGING_FLAGS: |
|
1308 | if revinfo.flags & REVIDX_RAWTEXT_CHANGING_FLAGS: | |
1272 | return self._fullsnapshotinfo(fh, revinfo, target_rev) |
|
1309 | return self._fullsnapshotinfo(fh, revinfo, target_rev) | |
1273 |
|
1310 | |||
1274 | gather_debug = self._gather_debug |
|
|||
1275 |
|
||||
1276 | if gather_debug: |
|
|||
1277 | start = util.timer() |
|
|||
1278 |
|
||||
1279 | # count the number of different delta we tried (for debug purpose) |
|
1311 | # count the number of different delta we tried (for debug purpose) | |
1280 | dbg_try_count = 0 |
|
1312 | dbg_try_count = 0 | |
1281 | # count the number of "search round" we did. (for debug purpose) |
|
1313 | # count the number of "search round" we did. (for debug purpose) | |
1282 | dbg_try_rounds = 0 |
|
1314 | dbg_try_rounds = 0 | |
1283 | dbg_type = b'unknown' |
|
1315 | dbg_type = b'unknown' | |
1284 |
|
1316 | |||
1285 | cachedelta = revinfo.cachedelta |
|
|||
1286 | p1 = revinfo.p1 |
|
|||
1287 | p2 = revinfo.p2 |
|
|||
1288 | revlog = self.revlog |
|
|||
1289 |
|
||||
1290 | deltainfo = None |
|
1317 | deltainfo = None | |
1291 | p1r, p2r = revlog.rev(p1), revlog.rev(p2) |
|
1318 | if p1r is None: | |
|
1319 | p1r = revlog.rev(revinfo.p1) | |||
|
1320 | p2r = revlog.rev(revinfo.p2) | |||
1292 |
|
1321 | |||
1293 | if gather_debug: |
|
|||
1294 | if p1r != nullrev: |
|
|||
1295 | p1_chain_len = revlog._chaininfo(p1r)[0] |
|
|||
1296 | else: |
|
|||
1297 | p1_chain_len = -1 |
|
|||
1298 | if p2r != nullrev: |
|
|||
1299 | p2_chain_len = revlog._chaininfo(p2r)[0] |
|
|||
1300 | else: |
|
|||
1301 | p2_chain_len = -1 |
|
|||
1302 | if self._debug_search: |
|
1322 | if self._debug_search: | |
1303 | msg = b"DBG-DELTAS-SEARCH: SEARCH rev=%d\n" |
|
1323 | msg = b"DBG-DELTAS-SEARCH: SEARCH rev=%d\n" | |
1304 | msg %= target_rev |
|
1324 | msg %= target_rev | |
@@ -1437,9 +1457,7 b' class deltacomputer:' | |||||
1437 | and dbg_try_count == 1 |
|
1457 | and dbg_try_count == 1 | |
1438 | and deltainfo.base == cachedelta[0] |
|
1458 | and deltainfo.base == cachedelta[0] | |
1439 | ) |
|
1459 | ) | |
1440 | dbg = self._one_dbg_data() |
|
|||
1441 | dbg['duration'] = end - start |
|
1460 | dbg['duration'] = end - start | |
1442 | dbg['revision'] = target_rev |
|
|||
1443 | dbg[ |
|
1461 | dbg[ | |
1444 | 'delta-base' |
|
1462 | 'delta-base' | |
1445 | ] = deltainfo.base # pytype: disable=attribute-error |
|
1463 | ] = deltainfo.base # pytype: disable=attribute-error | |
@@ -1447,8 +1465,6 b' class deltacomputer:' | |||||
1447 | dbg['using-cached-base'] = used_cached |
|
1465 | dbg['using-cached-base'] = used_cached | |
1448 | dbg['delta_try_count'] = dbg_try_count |
|
1466 | dbg['delta_try_count'] = dbg_try_count | |
1449 | dbg['type'] = dbg_type |
|
1467 | dbg['type'] = dbg_type | |
1450 | dbg['p1-chain-len'] = p1_chain_len |
|
|||
1451 | dbg['p2-chain-len'] = p2_chain_len |
|
|||
1452 | if ( |
|
1468 | if ( | |
1453 | deltainfo.snapshotdepth # pytype: disable=attribute-error |
|
1469 | deltainfo.snapshotdepth # pytype: disable=attribute-error | |
1454 | is not None |
|
1470 | is not None | |
@@ -1458,20 +1474,6 b' class deltacomputer:' | |||||
1458 | ] = deltainfo.snapshotdepth # pytype: disable=attribute-error |
|
1474 | ] = deltainfo.snapshotdepth # pytype: disable=attribute-error | |
1459 | else: |
|
1475 | else: | |
1460 | dbg['snapshot-depth'] = 0 |
|
1476 | dbg['snapshot-depth'] = 0 | |
1461 | target_revlog = b"UNKNOWN" |
|
|||
1462 | target_type = self.revlog.target[0] |
|
|||
1463 | target_key = self.revlog.target[1] |
|
|||
1464 | if target_type == KIND_CHANGELOG: |
|
|||
1465 | target_revlog = b'CHANGELOG:' |
|
|||
1466 | elif target_type == KIND_MANIFESTLOG: |
|
|||
1467 | target_revlog = b'MANIFESTLOG:' |
|
|||
1468 | if target_key: |
|
|||
1469 | target_revlog += b'%s:' % target_key |
|
|||
1470 | elif target_type == KIND_FILELOG: |
|
|||
1471 | target_revlog = b'FILELOG:' |
|
|||
1472 | if target_key: |
|
|||
1473 | target_revlog += b'%s:' % target_key |
|
|||
1474 | dbg['target-revlog'] = target_revlog |
|
|||
1475 | self._dbg_process_data(dbg) |
|
1477 | self._dbg_process_data(dbg) | |
1476 | return deltainfo |
|
1478 | return deltainfo | |
1477 |
|
1479 |
General Comments 0
You need to be logged in to leave comments.
Login now