Patchwork D7352: index: use `index.has_node` in `histedit.cleanupnode`

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

Comments

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

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -2565,8 +2565,8 @@ 
         repo = repo.unfiltered()
         # Find all nodes that need to be stripped
         # (we use %lr instead of %ln to silently ignore unknown items)
-        nm = repo.changelog.nodemap
-        nodes = sorted(n for n in nodes if n in nm)
+        has_node = repo.changelog.index.has_node
+        nodes = sorted(n for n in nodes if has_node(n))
         roots = [c.node() for c in repo.set(b"roots(%ln)", nodes)]
         if roots:
             backup = not nobackup