D7313: revlog: move the nodemap into the index object (for pure)

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Sun Nov 10 04:36:12 EST 2019


yuja added a comment.


  > @@ -662,29 +665,10 @@
  >
  >   except TypeError:
  >       raise
  >   except error.RevlogError:
  >
  > - if not isinstance(self._nodecache, revlogutils.NodeMap):
  > - # parsers.c radix tree lookup failed
  > - if node == wdirid or node in wdirfilenodeids:
  > - raise error.WdirUnsupported
  > - raise error.LookupError(node, self.indexfile, _(b'no node'))
  > - else:
  > - # pure python cache lookup failed
  > - n = self._nodecache
  > - i = self.index
  > - p = self._nodepos
  > - if p is None:
  > - p = len(i) - 1
  > - else:
  > - assert p < len(i)
  > - for r in pycompat.xrange(p, -1, -1):
  > - v = i[r][7]
  > - n[v] = r
  > - if v == node:
  > - self._nodepos = r - 1
  > - return r
  > - if node == wdirid or node in wdirfilenodeids:
  > - raise error.WdirUnsupported
  > - raise error.LookupError(node, self.indexfile, _(b'no node'))
  >
  > +            # parsers.c radix tree lookup failed
  > +            if node == wdirid or node in wdirfilenodeids:
  > +                raise error.WdirUnsupported
  > +            raise error.LookupError(node, self.indexfile, _(b'no node'))
  
  So `revlog._nodepos` is now useless since the node map is no longer built
  incrementally.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7313/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7313

To: marmoute, indygreg, #hg-reviewers
Cc: yuja, mercurial-devel


More information about the Mercurial-devel mailing list