Mercurial > hg
comparison mercurial/revlog.py @ 43529:bf176127033a
revlog: access the nodemap through the index
The `revlog.rev` method now access the nodemap through `self.index.nodemap`,
instead of using the `_nodecache` attribute that we are trying to remove.
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/D7317
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sat, 02 Nov 2019 15:25:31 +0100 |
parents | 90a0f631829e |
children | 6e3e3e5446ba |
comparison
equal
deleted
inserted
replaced
43528:90a0f631829e | 43529:bf176127033a |
---|---|
659 self._pcache = {} | 659 self._pcache = {} |
660 self.index.clearcaches() | 660 self.index.clearcaches() |
661 | 661 |
662 def rev(self, node): | 662 def rev(self, node): |
663 try: | 663 try: |
664 return self._nodecache[node] | 664 return self.index.nodemap[node] |
665 except TypeError: | 665 except TypeError: |
666 raise | 666 raise |
667 except error.RevlogError: | 667 except error.RevlogError: |
668 # parsers.c radix tree lookup failed | 668 # parsers.c radix tree lookup failed |
669 if node == wdirid or node in wdirfilenodeids: | 669 if node == wdirid or node in wdirfilenodeids: |