From patchwork Mon Dec 15 03:35:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3,of,3] namespaces: add branches From: Ryan McElroy X-Patchwork-Id: 7113 Message-Id: <39cead85fd58ae669359.1418614533@devbig105.prn2.facebook.com> To: Date: Sun, 14 Dec 2014 19:35:33 -0800 # HG changeset patch # User Sean Farley # Date 1413584832 25200 # Fri Oct 17 15:27:12 2014 -0700 # Node ID 39cead85fd58ae6693592074656b284ed736d9bc # Parent 8b7c99b4d8ef8cd40712ad4c154111a51871e1b4 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 --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -414,11 +414,6 @@ class changectx(basectx): 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 --git a/mercurial/namespaces.py b/mercurial/namespaces.py --- a/mercurial/namespaces.py +++ b/mercurial/namespaces.py @@ -44,6 +44,9 @@ class namespaces(object): 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