mercurial/commands.py
changeset 4231 83153299aab5
parent 4229 24c22a3f2ef8
child 4232 0d51eb296fb9
child 4249 89075f106414
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2563,7 +2563,10 @@ def _lookup(repo, node, branch=None):
             node = repo.lookup(node)
         else:
             wc = repo.workingctx()
-            node = repo.branchtags()[wc.branch()]
+            try:
+                node = repo.branchtags()[wc.branch()]
+            except KeyError:
+                raise util.Abort(_("branch %s not found") % wc.branch())
     return node
 
 def verify(ui, repo):