Patchwork D7344: index: use `index.has_node` in `bookmarks.bmstore`

login
register
mail settings
Submitter phabricator
Date Nov. 8, 2019, 4:26 p.m.
Message ID <differential-rev-PHID-DREV-rofunw2mdkoogtwo5b64-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/42948/
State Superseded
Headers show

Comments

phabricator - Nov. 8, 2019, 4:26 p.m.
marmoute created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/bookmarks.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -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)