chiark / gitweb /
Fix "stg branch --delete" on a nonexistent branch
authorToby Allsopp <Toby.Allsopp@navman.co.nz>
Mon, 24 Mar 2008 18:53:13 +0000 (18:53 +0000)
committerCatalin Marinas <catalin.marinas@gmail.com>
Mon, 24 Mar 2008 18:53:13 +0000 (18:53 +0000)
commit03a1b83c50c7d056e21a0217b9086593b3a5a717
tree89f0180f627bec249d0897c2f949aba2f8d33d1e
parentb85450f9de77183fd9fc7900bb0d290adaaaf9fd
Fix "stg branch --delete" on a nonexistent branch

Before this patch, I get the following:

 $ stg branch --delete tmp
 Deleting branch "tmp" ... Traceback (most recent call last):
   File "/usr/bin/stg", line 43, in ?
     main()
   File "/var/lib/python-support/python2.4/stgit/main.py", line 281, in main
     command.func(parser, options, args)
   File "/var/lib/python-support/python2.4/stgit/commands/branch.py", line 190, in func
     __delete_branch(args[0], options.force)
   File "/var/lib/python-support/python2.4/stgit/commands/branch.py", line 100, in __delete_branch
     doomed.delete(force)
   File "/var/lib/python-support/python2.4/stgit/stack.py", line 758, in delete
     except GitException:
 NameError: global name 'GitException' is not defined

After it, I get:

 Deleting branch "tmp" ...
   Warning: Could not delete branch "tmp"
 done

Signed-off-by: Toby Allsopp <toby.allsopp@navman.co.nz>
Signed-off-by: Karl Hasselström <kha@treskal.com>
stgit/stack.py
t/t1005-branch-delete.sh