index: use `index.has_node` in `bookmarks.bmstore`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 08 Nov 2019 13:36:02 +0100
changeset 43544 886ec3962c66
parent 43543 2c3afd083e45
child 43545 9c1f4e2f1fc4
index: use `index.has_node` in `bookmarks.bmstore` Differential Revision: https://phab.mercurial-scm.org/D7344
mercurial/bookmarks.py
--- a/mercurial/bookmarks.py	Fri Nov 08 11:44:23 2019 +0100
+++ b/mercurial/bookmarks.py	Fri Nov 08 13:36:02 2019 +0100
@@ -78,7 +78,7 @@
         self._nodemap = nodemap = {}  # node: sorted([refspec, ...])
         self._clean = True
         self._aclean = True
-        nm = repo.changelog.nodemap
+        has_node = repo.changelog.index.has_node
         tonode = bin  # force local lookup
         try:
             with _getbkfile(repo) as bkfile:
@@ -89,7 +89,7 @@
                     try:
                         sha, refspec = line.split(b' ', 1)
                         node = tonode(sha)
-                        if node in nm:
+                        if has_node(node):
                             refspec = encoding.tolocal(refspec)
                             refmap[refspec] = node
                             nrefs = nodemap.get(node)