Add an option to delete a patch from a certain branch
authorPaolo \'Blaisorblade\' Giarrusso <blaisorblade@yahoo.it>
Mon, 31 Oct 2005 20:54:47 +0000 (21:54 +0100)
committerCatalin Marinas <catalin.marinas@gmail.com>
Wed, 2 Nov 2005 21:20:23 +0000 (21:20 +0000)
From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

Actually, simply adding the option is enough...
Restrict print_crt_patch() to the case when we didn't specify --branch (as it's
useless otherwise).

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
stgit/commands/delete.py

index 01bea62..c97d8ed 100644 (file)
@@ -32,8 +32,8 @@ be part of the unapplied list or be the topmost one, in the latter
 case the command also popping it from the stack. Note that the
 'delete' operation is irreversible."""
 
 case the command also popping it from the stack. Note that the
 'delete' operation is irreversible."""
 
-options = []
-
+options = [make_option('-b', '--branch',
+                       help = 'use BRANCH instead of the default one')]
 
 def func(parser, options, args):
     """Deletes a patch
 
 def func(parser, options, args):
     """Deletes a patch
@@ -48,4 +48,6 @@ def func(parser, options, args):
 
     crt_series.delete_patch(args[0])
     print 'Patch "%s" successfully deleted' % args[0]
 
     crt_series.delete_patch(args[0])
     print 'Patch "%s" successfully deleted' % args[0]
-    print_crt_patch()
+
+    if not options.branch:
+        print_crt_patch()