chiark / gitweb /
Merge branch 'stable'
authorCatalin Marinas <catalin.marinas@gmail.com>
Mon, 19 May 2008 21:56:31 +0000 (22:56 +0100)
committerCatalin Marinas <catalin.marinas@gmail.com>
Mon, 19 May 2008 21:56:31 +0000 (22:56 +0100)
1  2 
contrib/stgit-completion.bash
stgit/commands/export.py

index b02eb64d1ced5e70feae395b67e6714c7a00c5bb,8d49e218097bf17ab6c1f3a1d588c745d10c0c2b..1867e6bd5de20d5311963984f838a6335dcdc232
@@@ -18,7 -18,6 +18,7 @@@ _stg_commands=
      diff
      clean
      clone
 +    coalesce
      commit
      cp
      edit
@@@ -239,7 -238,6 +239,7 @@@ _stg (
          # repository commands
          id)     _stg_patches $command _all_patches ;;
          # stack commands
 +        coalesce) _stg_patches $command _applied_patches ;;
          float)  _stg_patches $command _all_patches ;;
          goto)   _stg_patches $command _all_other_patches ;;
          hide)   _stg_patches $command _unapplied_patches ;;
          # patch commands
          delete) _stg_patches $command _all_patches ;;
          edit)   _stg_patches $command _applied_patches ;;
-         export) _stg_patches $command _applied_patches ;;
+         export) _stg_patches $command _all_patches ;;
          files)  _stg_patches $command _all_patches ;;
          log)    _stg_patches $command _all_patches ;;
          mail)   _stg_patches $command _all_patches ;;
diff --combined stgit/commands/export.py
index 50f6f671a979ef7bca12fa2900ada64679546670,4e5259810f9e5bae592ea66a93f26680ec587b38..6ebfd2aecf910d0d151d0fdff13f23df2ba0a2df
@@@ -64,10 -64,11 +64,10 @@@ 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('-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')]
 +                       action = 'store_true')
 +           ] + make_diff_opts_option()
  
  
  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()
+     unapplied = crt_series.get_unapplied()
      if len(args) != 0:
-         patches = parse_patches(args, applied)
+         patches = parse_patches(args, applied + unapplied, len(applied))
      else:
          patches = applied
  
          long_descr = reduce(lambda x, y: x + '\n' + y,
                              descr_lines[1:], '').strip()
  
 +        diff = git.diff(rev1 = patch.get_bottom(),
 +                        rev2 = patch.get_top(),
 +                        diff_flags = options.diff_flags)
          tmpl_dict = {'description': patch.get_description().rstrip(),
                       'shortdescr': short_descr,
                       'longdescr': long_descr,
 -                     'diffstat': git.diffstat(rev1 = patch.get_bottom(),
 -                                              rev2 = patch.get_top()),
 +                     'diffstat': git.diffstat(diff),
                       'authname': patch.get_authname(),
                       'authemail': patch.get_authemail(),
                       'authdate': patch.get_authdate(),
              print '-'*79
  
          f.write(descr)
 -        f.write(git.diff(rev1 = patch.get_bottom(),
 -                         rev2 = patch.get_top(),
 -                         diff_flags = diff_flags))
 +        f.write(diff)
          if not options.stdout:
              f.close()
          patch_no += 1