Infrastructure for current directory handling
[stgit] / stgit / commands / show.py
index a270efd..7efb4e1 100644 (file)
@@ -30,12 +30,17 @@ Show the commit log and the diff corresponding to the given
 patches. The output is similar to that generated by the 'git show'
 command."""
 
-options = [make_option('-a', '--applied',
+directory = DirectoryHasRepository()
+options = [make_option('-b', '--branch',
+                       help = 'use BRANCH instead of the default one'),
+           make_option('-a', '--applied',
                        help = 'show the applied patches',
                        action = 'store_true'),
            make_option('-u', '--unapplied',
                        help = 'show the unapplied patches',
-                       action = 'store_true')]
+                       action = 'store_true'),
+           make_option('-O', '--diff-opts',
+                       help = 'options to pass to git-diff')]
 
 
 def func(parser, options, args):
@@ -56,10 +61,16 @@ def func(parser, options, args):
             # it might be just a commit id
             patches = args
         else:
-            patches = parse_patches(args, applied + unapplied, len(applied))
+            patches = parse_patches(args, applied + unapplied +\
+                                crt_series.get_hidden(), len(applied))
+
+    if options.diff_opts:
+        diff_flags = options.diff_opts.split()
+    else:
+        diff_flags = []
 
     commit_ids = [git_id(patch) for patch in patches]
-    commit_str = '\n'.join([git.pretty_commit(commit_id)
+    commit_str = '\n'.join([git.pretty_commit(commit_id, diff_flags=diff_flags)
                             for commit_id in commit_ids])
     if commit_str:
         pager(commit_str)