Infrastructure for current directory handling
[stgit] / stgit / commands / delete.py
index 515f4b7..8462857 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 = DirectoryHasRepository()
 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')
 
@@ -74,7 +76,7 @@ def func(parser, options, args):
     # 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()