chiark / gitweb /
Refactor the Commitdata class to CommitData
[stgit] / stgit / commands / status.py
index 5763d09356408160c7bae23c2d44475c1d4b6697..6da45160d5a8100a66d8a7a5c0f9a497fccaabba 100644 (file)
@@ -40,7 +40,7 @@ under revision control. The files are prefixed as follows:
 A 'refresh' command clears the status of the modified, new and deleted
 files."""
 
-directory = DirectoryHasRepository()
+directory = DirectoryHasRepository(needs_current_series = False)
 options = [make_option('-m', '--modified',
                        help = 'show modified files only',
                        action = 'store_true'),
@@ -59,16 +59,14 @@ options = [make_option('-m', '--modified',
            make_option('-x', '--noexclude',
                        help = 'do not exclude any files from listing',
                        action = 'store_true'),
-           make_option('-O', '--diff-opts',
-                       help = 'options to pass to git-diff'),
            make_option('--reset',
                        help = 'reset the current tree changes',
-                       action = 'store_true')]
+                       action = 'store_true')
+           ] + make_diff_opts_option()
 
 
-def status(files = None, modified = False, new = False, deleted = False,
-           conflict = False, unknown = False, noexclude = False,
-           diff_flags = []):
+def status(files, modified, new, deleted, conflict, unknown, noexclude,
+           diff_flags):
     """Show the tree status
     """
     cache_files = git.tree_status(files,
@@ -109,18 +107,13 @@ def func(parser, options, args):
 
     if options.reset:
         if args:
-            for f in args:
-                resolved(f)
+            conflicts = git.get_conflicts()
+            git.resolved(fn for fn in args if fn in conflicts)
             git.reset(args)
         else:
             resolved_all()
             git.reset()
     else:
-        if options.diff_opts:
-            diff_flags = options.diff_opts.split()
-        else:
-            diff_flags = []
-
         status(args, options.modified, options.new, options.deleted,
                options.conflict, options.unknown, options.noexclude,
-               diff_flags = diff_flags)
+               options.diff_flags)