from stgit.commands.common import *
from stgit.utils import *
+from stgit.out import *
from stgit import stack, git, templates
%(commemail)s - committer's e-mail
"""
+directory = DirectoryHasRepository()
options = [make_option('-d', '--dir',
help = 'export patches to DIR instead of the default'),
make_option('-p', '--patch',
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')]
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;'
os.makedirs(dirname)
series = file(os.path.join(dirname, 'series'), 'w+')
- if options.binary:
- diff_flags = [ '--binary' ]
+ if options.diff_opts:
+ diff_flags = options.diff_opts.split()
else:
diff_flags = []
print patch.get_name()
print '-'*79
- # write description
f.write(descr)
- # write the diff
- git.diff(rev1 = patch.get_bottom(),
- rev2 = patch.get_top(),
- out_fd = f,
- diff_flags = diff_flags )
+ f.write(git.diff(rev1 = patch.get_bottom(),
+ rev2 = patch.get_top(),
+ diff_flags = diff_flags))
if not options.stdout:
f.close()
patch_no += 1