Mercurial > hg-stable
changeset 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 | 747a2f43d5d9 |
children | 2e30972d859d |
files | mercurial/context.py |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/context.py Mon Oct 08 17:12:09 2012 +0200 +++ b/mercurial/context.py Mon Oct 08 17:15:08 2012 +0200 @@ -95,7 +95,10 @@ # lookup failed # check if it might have come from damaged dirstate - if changeid in repo.dirstate.parents(): + # + # XXX we could avoid the unfiltered if we had a recognizable exception + # for filtered changeset access + if changeid in repo.unfiltered().dirstate.parents(): raise error.Abort(_("working directory has unknown parent '%s'!") % short(changeid)) try: