comparison hgext/histedit.py @ 43547:2b5d07702f94

index: use `index.has_node` in `histedit._finishhistedit Differential Revision: https://phab.mercurial-scm.org/D7351
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 08 Nov 2019 15:08:27 +0100
parents 9f70512ae2cf
children ccda03f6abcb
comparison
equal deleted inserted replaced
43546:a166fadf5c3b 43547:2b5d07702f94
2044 for n in tmpnodes: 2044 for n in tmpnodes:
2045 if n in repo: 2045 if n in repo:
2046 mapping[n] = () 2046 mapping[n] = ()
2047 2047
2048 # remove entries about unknown nodes 2048 # remove entries about unknown nodes
2049 nodemap = repo.unfiltered().changelog.nodemap 2049 has_node = repo.unfiltered().changelog.index.has_node
2050 mapping = { 2050 mapping = {
2051 k: v 2051 k: v
2052 for k, v in mapping.items() 2052 for k, v in mapping.items()
2053 if k in nodemap and all(n in nodemap for n in v) 2053 if has_node(k) and all(has_node(n) for n in v)
2054 } 2054 }
2055 scmutil.cleanupnodes(repo, mapping, b'histedit') 2055 scmutil.cleanupnodes(repo, mapping, b'histedit')
2056 hf = fm.hexfunc 2056 hf = fm.hexfunc
2057 fl = fm.formatlist 2057 fl = fm.formatlist
2058 fd = fm.formatdict 2058 fd = fm.formatdict