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

2019-11-09 Thread marmoute (Pierre-Yves David)
Closed by commit rHGe8cd502f0afe: index: use `index.has_node` in 
`histedit.cleanupnode` (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/D7352?vs=17853&id=17879

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

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

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

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



To: marmoute, durin42, #hg-reviewers, indygreg
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


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

2019-11-08 Thread marmoute (Pierre-Yves David)
marmoute updated this revision to Diff 17853.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7352?vs=17775&id=17853

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

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

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

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



To: marmoute, durin42, #hg-reviewers, indygreg
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


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

2019-11-08 Thread marmoute (Pierre-Yves David)
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

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



To: marmoute, durin42, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel