# HG changeset patch # User Sean Farley # Date 1413584832 25200 # Node ID 1149920416256c6ad689de23d6e1acab28e7fdb6 # Parent 59e703aecaf601a122890de58ad829b630a567c9 namespaces: add branches Note that the exception-catching from the previous branchtip check is moved up to catch exceptions from the try block surrounding the namespace lookup. diff -r 59e703aecaf6 -r 114992041625 mercurial/context.py --- a/mercurial/context.py Fri Oct 17 15:27:33 2014 -0700 +++ b/mercurial/context.py Fri Oct 17 15:27:12 2014 -0700 @@ -414,11 +414,6 @@ return except KeyError: pass - - try: - self._node = repo.branchtip(changeid) - self._rev = repo.changelog.rev(self._node) - return except error.FilteredRepoLookupError: raise except error.RepoLookupError: diff -r 59e703aecaf6 -r 114992041625 mercurial/namespaces.py --- a/mercurial/namespaces.py Fri Oct 17 15:27:33 2014 -0700 +++ b/mercurial/namespaces.py Fri Oct 17 15:27:12 2014 -0700 @@ -44,6 +44,9 @@ addns("tags", lambda repo, name: tolist(repo._tagscache.tags.get(name))) + addns("branches", + lambda repo, name: tolist(repo.branchtip(name))) + def addnamespace(self, namespace, namemap, order=None): """ register a namespace