Add the 'log --number' option to limit the output
[stgit] / stgit / commands / delete.py
index 515f4b7..1696cb9 100644 (file)
@@ -21,6 +21,7 @@ from optparse import OptionParser, make_option
 
 from stgit.commands.common import *
 from stgit.utils import *
+from stgit.out import *
 from stgit import stack, git
 
 
@@ -35,6 +36,7 @@ patches are deleted, they are popped from the stack.
 
 Note that the 'delete' operation is irreversible."""
 
+directory = DirectoryGotoToplevel()
 options = [make_option('-b', '--branch',
                        help = 'use BRANCH instead of the default one')]
 
@@ -46,7 +48,7 @@ def func(parser, options, args):
     all_patches = applied_patches + unapplied_patches
 
     if args:
-        patches = parse_patches(args, all_patches)
+        patches = parse_patches(args, all_patches, len(applied_patches))
     else:
         parser.error('No patches specified')
 
@@ -69,12 +71,12 @@ def func(parser, options, args):
     if applied and not options.branch:
         check_local_changes()
         check_conflicts()
-        check_head_top_equal()
+        check_head_top_equal(crt_series)
 
     # delete the patches
     for patch in applied + patches:
         crt_series.delete_patch(patch)
-        print 'Patch "%s" successfully deleted' % patch
+        out.info('Patch "%s" successfully deleted' % patch)
 
     if not options.branch:
-        print_crt_patch()
+        print_crt_patch(crt_series)