chiark / gitweb /
Merge branch 'stable'
authorCatalin Marinas <catalin.marinas@gmail.com>
Wed, 28 Jan 2009 23:07:37 +0000 (23:07 +0000)
committerCatalin Marinas <catalin.marinas@gmail.com>
Wed, 28 Jan 2009 23:07:37 +0000 (23:07 +0000)
Conflicts:
stgit/commands/files.py
stgit/commands/mail.py
stgit/git.py

1  2 
stgit/commands/files.py
stgit/commands/mail.py

index 84925afc5b3eab71242a9cf3b9a12549a4d6e50e,af772b8dc22df38e72ffbbf37d07cd0f7c78c846..a2ed6a25bbeeabb0eb18ef19bff3df6a9cafdfaf
@@@ -55,16 -57,18 +55,17 @@@ def func(parser, options, args)
      else:
          parser.error('incorrect number of arguments')
  
 -    if options.diff_opts:
 -        diff_flags = options.diff_opts.split()
 -    else:
 -        diff_flags = []
 -
 -    rev1 = git_id(crt_series, '%s//bottom' % patch)
 -    rev2 = git_id(crt_series, '%s//top' % patch)
 +    rev1 = git_id(crt_series, '%s^' % patch)
 +    rev2 = git_id(crt_series, '%s' % patch)
  
      if options.stat:
-         output = gitlib.diffstat(git.diff(rev1 = rev1, rev2 = rev2))
 -        out.stdout_raw(git.diffstat(rev1 = rev1, rev2 = rev2,
 -                                    diff_flags = diff_flags) + '\n')
++        output = gitlib.diffstat(git.diff(rev1 = rev1, rev2 = rev2,
++                                          diff_flags = options.diff_flags))
      elif options.bare:
 -        out.stdout_raw(git.barefiles(rev1, rev2) + '\n')
 +        output = git.barefiles(rev1, rev2)
      else:
 -        out.stdout_raw(git.files(rev1, rev2, diff_flags = diff_flags) + '\n')
 +        output = git.files(rev1, rev2, diff_flags = options.diff_flags)
 +    if output:
 +        if not output.endswith('\n'):
 +            output += '\n'
 +        out.stdout_raw(output)
index cab896bad5c50e9a4cbf699027e71ddee0ade512,2230d2a82bcc27796cb1f839a463c022f59f6804..46e4b559a8477d4deb70a0b9336bbedfdb683e4e
@@@ -402,9 -366,10 +402,10 @@@ def __build_cover(tmpl, patches, msg_id
                   'number':       number_str,
                   'shortlog':     stack.shortlog(crt_series.get_patch(p)
                                                  for p in patches),
 -                 'diffstat':     git.diffstat(
 -                     rev1 = git_id(crt_series, '%s//bottom' % patches[0]),
 -                     rev2 = git_id(crt_series, '%s//top' % patches[-1]),
 -                     diff_flags = diff_flags)}
 +                 'diffstat':     gitlib.diffstat(git.diff(
 +                     rev1 = git_id(crt_series, '%s^' % patches[0]),
-                      rev2 = git_id(crt_series, '%s' % patches[-1])))}
++                     rev2 = git_id(crt_series, '%s' % patches[-1]),
++                     diff_flags = options.diff_flags))}
  
      try:
          msg_string = tmpl % tmpl_dict