clfilter: prevent unwanted warning about filtered parents as unknown
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Mon, 08 Oct 2012 17:15:08 +0200
changeset 18005 aba3c161bcc6
parent 18004 747a2f43d5d9
child 18007 2e30972d859d
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.
mercurial/context.py
--- 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: