Mercurial > public > mercurial-scm > hg-stable
diff mercurial/revlog.py @ 43582:0c659fc20207
index: add a `has_node` method (API)
The new `index.has_node(node)` is to be preferred over:
`node in index.nodemap`.
This get us closer to be able to remove the `nodemap` attribute of the index.
Differential Revision: https://phab.mercurial-scm.org/D7322
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sun, 03 Nov 2019 00:01:09 +0100 |
parents | 642433629e20 |
children | 8b533de0429d |
line wrap: on
line diff
--- a/mercurial/revlog.py Sat Nov 09 05:54:22 2019 +0100 +++ b/mercurial/revlog.py Sun Nov 03 00:01:09 2019 +0100 @@ -213,6 +213,10 @@ nodemap[n] = r return nodemap + def has_node(self, node): + """return True if the node exist in the index""" + return node in self.nodemap + def append(self, tup): self.nodemap[tup[7]] = len(self) super(revlogoldindex, self).append(tup)