chiark / gitweb /
Don't have a global crt_series in stgit.commans.common
[stgit] / stgit / commands / clean.py
index 7b57526f0691561c3e30c269f16de946d466aaa4..4484ecd53624c13e9929d601c59a8ed7b49dc04f 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
 
 
@@ -30,6 +31,7 @@ Delete the empty patches in the whole series or only those applied or
 unapplied. A patch is considered empty if the two commit objects
 representing its boundaries refer to the same tree object."""
 
+directory = DirectoryHasRepository()
 options = [make_option('-a', '--applied',
                        help = 'delete the empty applied patches',
                        action = 'store_true'),
@@ -59,7 +61,7 @@ def func(parser, options, args):
 
     check_local_changes()
     check_conflicts()
-    check_head_top_equal()
+    check_head_top_equal(crt_series)
 
     if not (options.applied or options.unapplied):
         options.applied = options.unapplied = True
@@ -72,4 +74,4 @@ def func(parser, options, args):
         unapplied = crt_series.get_unapplied()
         __delete_empty(unapplied, False)
 
-    print_crt_patch()
+    print_crt_patch(crt_series)