Mercurial > hg
comparison contrib/perf.py @ 43526:e258ad110488
revlog: no longer return the nodemap after parsing
Now that both pure and cext version have a `nodemap` attribute, we do not need
to return the `nodemap` object after parsing.
This work is part of a refactoring to unify the revlog index and the nodemap.
This unification prepare the use of a persistent nodemap.
Differential Revision: https://phab.mercurial-scm.org/D7314
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 06 Nov 2019 14:13:19 +0100 |
parents | 9f70512ae2cf |
children | 43424f03d9a4 |
comparison
equal
deleted
inserted
replaced
43525:845e5b313783 | 43526:e258ad110488 |
---|---|
2590 for i in range(count): | 2590 for i in range(count): |
2591 for rev in revs: | 2591 for rev in revs: |
2592 index[rev] | 2592 index[rev] |
2593 | 2593 |
2594 def resolvenode(node): | 2594 def resolvenode(node): |
2595 nodemap = revlogio.parseindex(data, inline)[1] | 2595 nodemap = getattr(revlogio.parseindex(data, inline)[0], 'nodemap', None) |
2596 # This only works for the C code. | 2596 # This only works for the C code. |
2597 if nodemap is None: | 2597 if nodemap is None: |
2598 return | 2598 return |
2599 | 2599 |
2600 try: | 2600 try: |
2601 nodemap[node] | 2601 nodemap[node] |
2602 except error.RevlogError: | 2602 except error.RevlogError: |
2603 pass | 2603 pass |
2604 | 2604 |
2605 def resolvenodes(nodes, count=1): | 2605 def resolvenodes(nodes, count=1): |
2606 nodemap = revlogio.parseindex(data, inline)[1] | 2606 nodemap = getattr(revlogio.parseindex(data, inline)[0], 'nodemap', None) |
2607 if nodemap is None: | 2607 if nodemap is None: |
2608 return | 2608 return |
2609 | 2609 |
2610 for i in range(count): | 2610 for i in range(count): |
2611 for node in nodes: | 2611 for node in nodes: |