Use get/set_name for a stack's name.
[stgit] / stgit / commands / export.py
index cafcbe3..8424f9d 100644 (file)
@@ -62,9 +62,8 @@ options = [make_option('-d', '--dir',
                        help = 'Use FILE as a template'),
            make_option('-b', '--branch',
                        help = 'use BRANCH instead of the default one'),
-           make_option('--binary',
-                       help = 'output a diff even for binary files',
-                       action = 'store_true'),
+           make_option('-O', '--diff-opts',
+                       help = 'options to pass to git-diff'),
            make_option('-s', '--stdout',
                        help = 'dump the patches to the standard output',
                        action = 'store_true')]
@@ -76,7 +75,7 @@ def func(parser, options, args):
     if options.dir:
         dirname = options.dir
     else:
-        dirname = 'patches-%s' % crt_series.get_branch()
+        dirname = 'patches-%s' % crt_series.get_name()
 
     if not options.branch and git.local_changes():
         out.warn('Local changes in the tree;'
@@ -87,6 +86,11 @@ def func(parser, options, args):
             os.makedirs(dirname)
         series = file(os.path.join(dirname, 'series'), 'w+')
 
+    if options.diff_opts:
+        diff_flags = options.diff_opts.split()
+    else:
+        diff_flags = []
+
     applied = crt_series.get_applied()
     if len(args) != 0:
         patches = parse_patches(args, applied)
@@ -175,7 +179,8 @@ def func(parser, options, args):
         # write the diff
         git.diff(rev1 = patch.get_bottom(),
                  rev2 = patch.get_top(),
-                 out_fd = f, binary = options.binary)
+                 out_fd = f,
+                 diff_flags = diff_flags )
         if not options.stdout:
             f.close()
         patch_no += 1