equal
deleted
inserted
replaced
363 self._sparserevlog = False |
363 self._sparserevlog = False |
364 self.hassidedata = False |
364 self.hassidedata = False |
365 self._srdensitythreshold = 0.50 |
365 self._srdensitythreshold = 0.50 |
366 self._srmingapsize = 262144 |
366 self._srmingapsize = 262144 |
367 |
367 |
|
368 # other optionnals features |
|
369 |
|
370 # might remove rank configuration once the computation has no impact |
|
371 self._compute_rank = False |
|
372 |
368 # Make copy of flag processors so each revlog instance can support |
373 # Make copy of flag processors so each revlog instance can support |
369 # custom flags. |
374 # custom flags. |
370 self._flagprocessors = dict(flagutil.flagprocessors) |
375 self._flagprocessors = dict(flagutil.flagprocessors) |
371 |
376 |
372 # 3-tuple of file handles being used for active writing. |
377 # 3-tuple of file handles being used for active writing. |
404 mmapindexthreshold = None |
409 mmapindexthreshold = None |
405 opts = self.opener.options |
410 opts = self.opener.options |
406 |
411 |
407 if b'changelogv2' in opts and self.revlog_kind == KIND_CHANGELOG: |
412 if b'changelogv2' in opts and self.revlog_kind == KIND_CHANGELOG: |
408 new_header = CHANGELOGV2 |
413 new_header = CHANGELOGV2 |
|
414 self._compute_rank = opts.get(b'changelogv2.compute-rank', True) |
409 elif b'revlogv2' in opts: |
415 elif b'revlogv2' in opts: |
410 new_header = REVLOGV2 |
416 new_header = REVLOGV2 |
411 elif b'revlogv1' in opts: |
417 elif b'revlogv1' in opts: |
412 new_header = REVLOGV1 | FLAG_INLINE_DATA |
418 new_header = REVLOGV1 | FLAG_INLINE_DATA |
413 if b'generaldelta' in opts: |
419 if b'generaldelta' in opts: |
2497 # we can easily detect empty sidedata and they will be no different |
2503 # we can easily detect empty sidedata and they will be no different |
2498 # than ones we manually add. |
2504 # than ones we manually add. |
2499 sidedata_offset = 0 |
2505 sidedata_offset = 0 |
2500 |
2506 |
2501 rank = RANK_UNKNOWN |
2507 rank = RANK_UNKNOWN |
2502 if self._format_version == CHANGELOGV2: |
2508 if self._compute_rank: |
2503 if (p1r, p2r) == (nullrev, nullrev): |
2509 if (p1r, p2r) == (nullrev, nullrev): |
2504 rank = 1 |
2510 rank = 1 |
2505 elif p1r != nullrev and p2r == nullrev: |
2511 elif p1r != nullrev and p2r == nullrev: |
2506 rank = 1 + self.fast_rank(p1r) |
2512 rank = 1 + self.fast_rank(p1r) |
2507 elif p1r == nullrev and p2r != nullrev: |
2513 elif p1r == nullrev and p2r != nullrev: |