# HG changeset patch # User Sean Farley # Date 2013-08-05 22:21:38 # Node ID 0c8ad779eb367db3b70357355a47ca5b3d65dcc6 # Parent 78155484ae343b0d3fb32a1af6433b0668a0217f basectx: move __contains__ from changectx diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -53,6 +53,9 @@ class basectx(object): def __ne__(self, other): return not (self == other) + def __contains__(self, key): + return key in self._manifest + @propertycache def substate(self): return subrepo.state(self, self._repo.ui) @@ -197,9 +200,6 @@ class changectx(basectx): p = p[:-1] return [changectx(self._repo, x) for x in p] - def __contains__(self, key): - return key in self._manifest - def __getitem__(self, key): return self.filectx(key)