Mercurial > hg
comparison hgext/histedit.py @ 43548:ccda03f6abcb
index: use `index.has_node` in `histedit.cleanupnode`
Differential Revision: https://phab.mercurial-scm.org/D7352
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 08 Nov 2019 15:09:09 +0100 |
parents | 2b5d07702f94 |
children | 418ca164d44c |
comparison
equal
deleted
inserted
replaced
43547:2b5d07702f94 | 43548:ccda03f6abcb |
---|---|
2563 # we should probably get rid of obsolescence marker created during the | 2563 # we should probably get rid of obsolescence marker created during the |
2564 # histedit, but we currently do not have such information. | 2564 # histedit, but we currently do not have such information. |
2565 repo = repo.unfiltered() | 2565 repo = repo.unfiltered() |
2566 # Find all nodes that need to be stripped | 2566 # Find all nodes that need to be stripped |
2567 # (we use %lr instead of %ln to silently ignore unknown items) | 2567 # (we use %lr instead of %ln to silently ignore unknown items) |
2568 nm = repo.changelog.nodemap | 2568 has_node = repo.changelog.index.has_node |
2569 nodes = sorted(n for n in nodes if n in nm) | 2569 nodes = sorted(n for n in nodes if has_node(n)) |
2570 roots = [c.node() for c in repo.set(b"roots(%ln)", nodes)] | 2570 roots = [c.node() for c in repo.set(b"roots(%ln)", nodes)] |
2571 if roots: | 2571 if roots: |
2572 backup = not nobackup | 2572 backup = not nobackup |
2573 repair.strip(ui, repo, roots, backup=backup) | 2573 repair.strip(ui, repo, roots, backup=backup) |
2574 | 2574 |