Permalink
Browse files

Add --diff-content-type parameter

This parameter sets the Content-Type header for attached diffs, which is
useful for some mailers.  It defaults to 'text/plain'.
  • Loading branch information...
1 parent da61b83 commit 29c7a7bc71a17e169bc46a3eb3afc19294abe1f2 @dpwright dpwright committed Jul 23, 2012
Showing with 4 additions and 1 deletion.
  1. +3 −1 lib/SVN/Notify.pm
  2. +1 −0 t/options.t
View
@@ -728,6 +728,7 @@ sub new {
$params{encoding} ||= $params{charset} || 'UTF-8';
$params{svn_encoding} ||= $params{encoding};
$params{diff_encoding} ||= $params{svn_encoding};
+ $params{diff_content_type} ||= $params{diff_content_type} || 'text/plain';
$params{sendmail} ||= $ENV{SENDMAIL} || $class->find_exe('sendmail')
unless $params{smtp};
@@ -880,6 +881,7 @@ sub get_options {
'with-diff|d' => \$opts->{with_diff},
'attach-diff|a' => \$opts->{attach_diff},
'diff-switches|w=s' => \$opts->{diff_switches},
+ 'diff-content-type=s' => \$opts->{diff_content_type},
'reply-to|R=s' => \$opts->{reply_to},
'subject-prefix|P=s' => \$opts->{subject_prefix},
'subject-cx|C' => \$opts->{subject_cx},
@@ -1704,7 +1706,7 @@ sub output_attached_diff {
print $out "\n--$self->{boundary}\n",
"Content-Disposition: attachment; filename=",
"r$self->{revision}-$self->{user}.diff\n",
- "Content-Type: text/plain; charset=$self->{encoding}\n",
+ "Content-Type: $self->{diff_content_type}; charset=$self->{encoding}\n",
($self->{language} ? "Content-Language: $self->{language}\n" : ()),
"Content-Transfer-Encoding: 8bit\n\n";
$self->_dump_diff($out, $diff);
View
@@ -36,6 +36,7 @@ my %params = (
with_diff => undef,
attach_diff => undef,
diff_switches => undef,
+ diff_content_type => undef,
reply_to => undef,
subject_prefix => undef,
subject_cx => undef,

0 comments on commit 29c7a7b

Please sign in to comment.