Mercurial > hg-stable
changeset 4231:83153299aab5
avoid a traceback with hg branch newbranch; hg up
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Fri, 16 Mar 2007 00:22:59 -0300 |
parents | c93562fb12cc |
children | 0d51eb296fb9 ce6c364ebb2a |
files | mercurial/commands.py tests/test-newbranch tests/test-newbranch.out |
diffstat | 3 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Fri Mar 16 00:22:58 2007 -0300 +++ b/mercurial/commands.py Fri Mar 16 00:22:59 2007 -0300 @@ -2563,7 +2563,10 @@ 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):