Mercurial > hg > mercurial-crew-with-dirclash
diff mercurial/localrepo.py @ 3494:dba3cadef789
Only look up tags and branches as a last resort
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 18 Oct 2006 11:44:56 -0500 |
parents | fcf14d87e0a4 |
children | baa271270829 |
line wrap: on
line diff
--- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -336,14 +336,17 @@ class localrepository(repo.repository): key = self.dirstate.parents()[0] if key == nullid: raise repo.RepoError(_("no revision checked out")) + n = self.changelog._match(key) + if n: + return n if key in self.tags(): return self.tags()[key] if key in self.branchtags(): return self.branchtags()[key] - try: - return self.changelog.lookup(key) - except: - raise repo.RepoError(_("unknown revision '%s'") % key) + n = self.changelog._partialmatch(key) + if n: + return n + raise repo.RepoError(_("unknown revision '%s'") % key) def dev(self): return os.lstat(self.path).st_dev