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

login
register
mail settings
Submitter phabricator
Date Nov. 9, 2019, 8:41 a.m.
Message ID <635477c7276ad2b3089ceb4488db972c@localhost.localdomain>
Download mbox | patch
Permalink /patch/43060/
State Not Applicable
Headers show

Comments

phabricator - Nov. 9, 2019, 8:41 a.m.
Closed by commit rHGa35bbeef9d88: index: use `index.has_node` in `bookmarks.bmstore` (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7344?vs=17767&id=17875

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

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

AFFECTED FILES
  mercurial/bookmarks.py

CHANGE DETAILS




To: marmoute, #hg-reviewers, indygreg
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)