Patchwork D7323: index: use `index.has_node` in `revlog.addrevision`

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

Comments

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

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/revlog.py

CHANGE DETAILS




To: marmoute, indygreg, #hg-reviewers
Cc: mercurial-devel
phabricator - Nov. 8, 2019, 7:44 p.m.
This revision is now accepted and ready to land.
indygreg added a comment.
indygreg accepted this revision.


  I wholeheartedly approve of introducing an explicit API for lookups here.

REPOSITORY
  rHG Mercurial

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

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

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

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1995,7 +1995,7 @@ 
             )
 
         node = node or self.hash(rawtext, p1, p2)
-        if node in self.nodemap:
+        if self.index.has_node(node):
             return node
 
         if validatehash: