Make "empty patch" checking optional in "series"
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Fri, 16 Sep 2005 19:35:13 +0000 (21:35 +0200)
committerCatalin Marinas <catalin.marinas@gmail.com>
Sat, 17 Sep 2005 07:54:54 +0000 (08:54 +0100)
That's just too slow, and quilt doesn't do it, so user will live with it.
Don't know if there's a reason to allow dropping the fanciness here
entirely, but I think there's no user doing one-liner scripts with quilt
series. And anyway, for that you can do "stg applied; stg unapplied".

Actually, with this patch you must ask explicitly the checking.

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

index 263f393..7ed88c0 100644 (file)
@@ -33,6 +33,10 @@ prefixed with a '>'. Empty patches are prefixed with a '0'."""
 
 options = [make_option('-b', '--branch',
                        help = 'use BRANCH instead of the default one')]
+options = [make_option('-e', '--empty',
+                       help = 'check whether patches are empty '
+                       '(much slower)',
+                       action = 'store_true') ]
 
 
 def func(parser, options, args):
@@ -44,19 +48,19 @@ def func(parser, options, args):
     applied = crt_series.get_applied()
     if len(applied) > 0:
         for p in applied [0:-1]:
-            if crt_series.empty_patch(p):
+            if options.empty and crt_series.empty_patch(p):
                 print '0', p
             else:
                 print '+', p
         p = applied[-1]
 
-        if crt_series.empty_patch(p):
+        if options.empty and crt_series.empty_patch(p):
             print '0>%s' % p
         else:
             print '> %s' % p
 
     for p in crt_series.get_unapplied():
-        if crt_series.empty_patch(p):
+        if options.empty and crt_series.empty_patch(p):
             print '0', p
         else:
             print '-', p