hiddenoverride: in memory/disc out of sync fix

Before, out of syncness of in memory state and on disc state caused certain
commands to (appear to) perform repo changes after they had returned.  This
broke hg undo.  This change fixes this by using the in memory state.

Differential Revision: https://phab.mercurial-scm.org/D150
This commit is contained in:
Felix Merk 2017-07-19 17:49:21 -07:00
parent 6a5431e1a3
commit c18c86359b

View File

@ -29,8 +29,10 @@ def uisetup(ui):
def pinnedrevs(orig, repo):
revs = orig(repo)
nodemap = repo.changelog.nodemap
pinned = list(nodemap[n] for n in loadpinnednodes(repo) if n in nodemap)
revs.update(pinned)
pinnednodes = set(loadpinnednodes(repo))
tounpin = getattr(repo, '_tounpinnodes', set())
pinnednodes -= tounpin
revs.update(nodemap[n] for n in pinnednodes)
return revs
def loadpinnednodes(repo):