Exercise "stg pull" on patches just appending lines.
[stgit] / stgit / commands / series.py
index a843307..5710558 100644 (file)
@@ -34,11 +34,14 @@ prefixed with a '>'. Empty patches are prefixed with a '0'."""
 options = [make_option('-b', '--branch',
                        help = 'use BRANCH instead of the default one'),
            make_option('-d', '--description',
-                       help = 'show a show description for each patch',
+                       help = 'show a short description for each patch',
                        action = 'store_true'),
            make_option('-e', '--empty',
                        help = 'check whether patches are empty '
                        '(much slower)',
+                       action = 'store_true'),
+           make_option('-s', '--short',
+                       help = 'list just the patches around the topmost patch',
                        action = 'store_true') ]
 
 
@@ -66,6 +69,13 @@ def func(parser, options, args):
 
     applied = crt_series.get_applied()
     unapplied = crt_series.get_unapplied()
+
+    if options.short:
+        if len(applied) > 5:
+            applied = applied[-6:]
+        if len(unapplied) > 5:
+            unapplied = unapplied[:5]
+
     patches = applied + unapplied
 
     max_len = 0