mercurial/merge.py
changeset 4232 0d51eb296fb9
parent 4209 dbc3846c09a1
child 4309 09c5f734ff6a
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -450,7 +450,10 @@ def update(repo, node, branchmerge, forc
     wc = repo.workingctx()
     if node is None:
         # tip of current branch
-        node = repo.branchtags()[wc.branch()]
+        try:
+            node = repo.branchtags()[wc.branch()]
+        except KeyError:
+            raise util.Abort(_("branch %s not found") % wc.branch())
     overwrite = force and not branchmerge
     forcemerge = force and branchmerge
     pl = wc.parents()