# HG changeset patch # User Matt Mackall # Date 1333906690 18000 # Node ID c463f46fe05073c34f9c1a3dc712034479ce4fc4 # Parent f8ce254e514fd432eccb979d0ead6a4534c47f63 localrepo: lookup now goes through context diff -r f8ce254e514f -r c463f46fe050 mercurial/localrepo.py --- a/mercurial/localrepo.py Sun Apr 08 12:38:08 2012 -0500 +++ b/mercurial/localrepo.py Sun Apr 08 12:38:10 2012 -0500 @@ -593,37 +593,7 @@ partial[branch] = bheads def lookup(self, key): - if isinstance(key, int): - return self.changelog.node(key) - elif key == '.': - return self.dirstate.p1() - elif key == 'null': - return nullid - elif key == 'tip': - return self.changelog.tip() - n = self.changelog._match(key) - if n: - return n - if key in self._bookmarks: - return self._bookmarks[key] - if key in self.tags(): - return self.tags()[key] - if key in self.branchtags(): - return self.branchtags()[key] - n = self.changelog._partialmatch(key) - if n: - return n - - # can't find key, check if it might have come from damaged dirstate - if key in self.dirstate.parents(): - raise error.Abort(_("working directory has unknown parent '%s'!") - % short(key)) - try: - if len(key) == 20: - key = hex(key) - except TypeError: - pass - raise error.RepoLookupError(_("unknown revision '%s'") % key) + return self[key].node() def lookupbranch(self, key, remote=None): repo = remote or self