Mercurial > hg > mercurial-source
diff mercurial/localrepo.py @ 9929:ea3acaae25bb
localrepo: support 'rev in repo' syntax
author | Alexander Solovyov <piranha@piranha.org.ua> |
---|---|
date | Tue, 24 Nov 2009 14:32:19 +0200 (2009-11-24) |
parents | 0b999aec64e8 |
children | 720f70b720d3 |
line wrap: on
line diff
--- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -128,6 +128,12 @@ return context.workingctx(self) return context.changectx(self, changeid) + def __contains__(self, changeid): + try: + return bool(self.lookup(changeid)) + except error.RepoLookupError: + return False + def __nonzero__(self): return True