Infrastructure for current directory handling
[stgit] / stgit / commands / rename.py
index ca799c3..e2b0fa4 100644 (file)
@@ -20,6 +20,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
 
 
@@ -28,6 +29,7 @@ usage = """%prog [options] <oldpatch> <newpatch>
 
 Rename <oldpatch> into <newpatch> in a series."""
 
+directory = DirectoryHasRepository()
 options = [make_option('-b', '--branch',
                        help = 'use BRANCH instead of the default one')]
 
@@ -38,7 +40,6 @@ def func(parser, options, args):
     if len(args) != 2:
         parser.error('incorrect number of arguments')
 
-    print 'Renaming patch "%s" -> "%s"...' % (args[0], args[1]),
-    sys.stdout.flush()
+    out.start('Renaming patch "%s" to "%s"' % (args[0], args[1]))
     crt_series.rename_patch(args[0], args[1])
-    print 'done'
+    out.done()