Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 37315:0a1fb171dc1d
localrepo: use revsymbol() in lookup()
lookup() seems to be about looking up a revision based on a symbol
that may come from the user (via the wire protocol), so revsymbol() is
appropriate here.
Differential Revision: https://phab.mercurial-scm.org/D3055
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 03 Apr 2018 15:08:09 -0700 |
parents | 0dfb5672f015 |
children | 836867586b83 |
comparison
equal
deleted
inserted
replaced
37314:8474005fcfe2 | 37315:0a1fb171dc1d |
---|---|
1019 raise error.RepoLookupError(_("unknown branch '%s'") % branch) | 1019 raise error.RepoLookupError(_("unknown branch '%s'") % branch) |
1020 else: | 1020 else: |
1021 pass | 1021 pass |
1022 | 1022 |
1023 def lookup(self, key): | 1023 def lookup(self, key): |
1024 return self[key].node() | 1024 return scmutil.revsymbol(self, key).node() |
1025 | 1025 |
1026 def lookupbranch(self, key, remote=None): | 1026 def lookupbranch(self, key, remote=None): |
1027 repo = remote or self | 1027 repo = remote or self |
1028 if key in repo.branchmap(): | 1028 if key in repo.branchmap(): |
1029 return key | 1029 return key |