chiark / gitweb /
Use separate column for zero in output of stg series -e
authorDavid Kågedal <davidk@lysator.liu.se>
Mon, 8 Dec 2008 20:24:44 +0000 (21:24 +0100)
committerKarl Hasselström <kha@treskal.com>
Mon, 8 Dec 2008 20:39:39 +0000 (21:39 +0100)
This will make the output more regular and easier to parse. It no longer
overwrites the +/-/! status flag with a zero for empty patches, and
instead puts the zero before it.

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
stgit/commands/series.py

index 95196d3b3843eed48a15b0957ae80bb58cf36630..b93abc44639d75ebdcdaafe59aefc0fef83c149b 100644 (file)
@@ -79,13 +79,16 @@ def __get_author(stack, patch):
     cd = stack.patches.get(patch).commit.data
     return cd.author.name
 
     cd = stack.patches.get(patch).commit.data
     return cd.author.name
 
-def __print_patch(stack, patch, branch_str, prefix, empty_prefix, length, options):
+def __print_patch(stack, patch, branch_str, prefix, length, options):
     """Print a patch name, description and various markers.
     """
     if options.noprefix:
         prefix = ''
     """Print a patch name, description and various markers.
     """
     if options.noprefix:
         prefix = ''
-    elif options.empty and stack.patches.get(patch).is_empty():
-        prefix = empty_prefix
+    elif options.empty:
+        if stack.patches.get(patch).is_empty():
+            prefix = '0' + prefix
+        else:
+            prefix = ' ' + prefix
 
     patch_str = branch_str + patch
 
 
     patch_str = branch_str + patch
 
@@ -180,12 +183,12 @@ def func(parser, options, args):
 
     if applied:
         for p in applied[:-1]:
 
     if applied:
         for p in applied[:-1]:
-            __print_patch(stack, p, branch_str, '+ ', '0 ', max_len, options)
-        __print_patch(stack, applied[-1], branch_str, '> ', '0>', max_len,
+            __print_patch(stack, p, branch_str, '+ ', max_len, options)
+        __print_patch(stack, applied[-1], branch_str, '> ', max_len,
                       options)
 
     for p in unapplied:
                       options)
 
     for p in unapplied:
-        __print_patch(stack, p, branch_str, '- ', '0 ', max_len, options)
+        __print_patch(stack, p, branch_str, '- ', max_len, options)
 
     for p in hidden:
 
     for p in hidden:
-        __print_patch(stack, p, branch_str, '! ', '! ', max_len, options)
+        __print_patch(stack, p, branch_str, '! ', max_len, options)