diff mercurial/namespaces.py @ 23775:885c0290f7d5

localrepo: add ignoremissing parameter to branchtip Previously, in the namespaces api, the only caller of branchtip was singlenode which happened to raise the same exception that branchtip raised: KeyError. This is a minor change but will allow upcoming patches to use repo.branchtip to not raise an exception if a branch doesn't exist. After that, it will be possible for extensions to use the namespace api in a stable way.
author Sean Farley <sean.michael.farley@gmail.com>
date Thu, 16 Oct 2014 21:49:28 -0700
parents b9537ee87961
children 9f48242929a9
line wrap: on
line diff
--- a/mercurial/namespaces.py	Mon Dec 15 14:46:04 2014 -0800
+++ b/mercurial/namespaces.py	Thu Oct 16 21:49:28 2014 -0700
@@ -41,7 +41,7 @@
 
         n = ns("branches", "branch",
                lambda repo: repo.branchmap().keys(),
-               lambda repo, name: tolist(repo.branchtip(name)),
+               lambda repo, name: tolist(repo.branchtip(name, True)),
                lambda repo, node: [repo[node].branch()])
         self.addnamespace(n)