Mercurial > hg-stable
changeset 9924:ea3acaae25bb
localrepo: support 'rev in repo' syntax
author | Alexander Solovyov <piranha@piranha.org.ua> |
---|---|
date | Tue, 24 Nov 2009 14:32:19 +0200 |
parents | c0b79fdfd214 |
children | a9cab6c49d61 |
files | mercurial/localrepo.py |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/localrepo.py Tue Nov 24 11:20:25 2009 -0800 +++ b/mercurial/localrepo.py Tue Nov 24 14:32:19 2009 +0200 @@ -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