comparison mercurial/context.py @ 18005:aba3c161bcc6

clfilter: prevent unwanted warning about filtered parents as unknown During changectx __init__ the dirstate's parents MAY be checked. If the repo is filtered, this check will complain "working directory has unknown parents" even if the parents are perfectly known. This may happen when the repo is used for serving and the dirstate has parents that are secret, as those secret changesets will be filtered.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Mon, 08 Oct 2012 17:15:08 +0200
parents 82f1fe0308bd
children 8b846dbc57b6
comparison
equal deleted inserted replaced
18004:747a2f43d5d9 18005:aba3c161bcc6
93 self._rev = repo.changelog.rev(self._node) 93 self._rev = repo.changelog.rev(self._node)
94 return 94 return
95 95
96 # lookup failed 96 # lookup failed
97 # check if it might have come from damaged dirstate 97 # check if it might have come from damaged dirstate
98 if changeid in repo.dirstate.parents(): 98 #
99 # XXX we could avoid the unfiltered if we had a recognizable exception
100 # for filtered changeset access
101 if changeid in repo.unfiltered().dirstate.parents():
99 raise error.Abort(_("working directory has unknown parent '%s'!") 102 raise error.Abort(_("working directory has unknown parent '%s'!")
100 % short(changeid)) 103 % short(changeid))
101 try: 104 try:
102 if len(changeid) == 20: 105 if len(changeid) == 20:
103 changeid = hex(changeid) 106 changeid = hex(changeid)