Subject: | (feature request) --svnlook-diff option |
Date: | Wed, 03 Oct 2007 16:13:52 +0900 |
To: | bug-SVN-Notify [...] rt.cpan.org |
From: | kin <kaneyuki [...] eva.hi-ho.ne.jp> |
Hello,
Our development team are big fans of SVN::Notify.
It is much helpful if we can specify "svnlook diff" filter program by
command line option, like this:
--svnlook-diff /usr/local/bin/svnlook_diff_sjis
In above example, we use following filter script as svnlook_diff_sjis:
#!/bin/sh
PATH=/bin:/usr/bin
env LANG=C svnlook "$@" | iconv -f SHIFT-JIS -t UTF-8
Can you take this feature in?
Here is the patch against v2.66, w/o documentation part:
--- Notify.pm.org 2007-09-05 09:35:16.000000000 +0900
+++ Notify.pm 2007-09-05 10:29:50.000000000 +0900
@@ -647,16 +647,17 @@
$params{svnlook} ||= $ENV{SVNLOOK} || $class->find_exe('svnlook');
$params{with_diff} ||= $params{attach_diff};
$params{verbose} ||= 0;
$params{charset} ||= 'UTF-8';
$params{io_layer} ||= "encoding($params{charset})";
$params{smtp_authtype} ||= 'PLAIN';
$params{sendmail} ||= $ENV{SENDMAIL} || $class->find_exe('sendmail')
unless $params{smtp};
+ $params{svnlook_diff} ||= $params{svnlook};
die qq{Cannot find sendmail and no "smtp" parameter specified}
unless $params{sendmail} || $params{smtp};
# Set up the revision URL.
$params{revision_url} ||= delete $params{svnweb_url}
|| delete $params{viewcvs_url};
if ($params{revision_url} && $params{revision_url} !~ /%s/) {
@@ -767,16 +768,17 @@
'repos-path|p=s' => \$opts->{repos_path},
'revision|r=s' => \$opts->{revision},
'to|t=s@' => \$opts->{to},
'to-regex-map|x=s%' => \$opts->{to_regex_map},
'to-email-map=s%' => \$opts->{to_email_map},
'from|f=s' => \$opts->{from},
'user-domain|D=s' => \$opts->{user_domain},
'svnlook|l=s' => \$opts->{svnlook},
+ 'svnlook-diff=s' => \$opts->{svnlook_diff},
'sendmail|s=s' => \$opts->{sendmail},
'set-sender|E' => \$opts->{set_sender},
'smtp=s' => \$opts->{smtp},
'charset|c=s' => \$opts->{charset},
'io-layer|o=s' => \$opts->{io_layer},
'language|g=s' => \$opts->{language},
'with-diff|d' => \$opts->{with_diff},
'attach-diff|a' => \$opts->{attach_diff},
@@ -1549,17 +1551,17 @@
will usually be passed as the second argument to C<output_diff()> or
C<output_attached_diff()>.
=cut
sub diff_handle {
my $self = shift;
return $self->_pipe(
- '-|' => $self->{svnlook},
+ '-|' => $self->{svnlook_diff},
'diff' => $self->{repos_path},
'-r' => $self->{revision},
( $self->{diff_switches}
? grep { defined && $_ ne '' }
# Allow quoting of arguments, but strip out the quotes.
split /(?:'([^']+)'|"([^"]+)")?\s+(?:'([^']+)'|"([^"]+)")?/,
$self->{diff_switches}
: ()
@@ -1607,16 +1609,17 @@
__PACKAGE__->_accessors(qw(
repos_path
revision
to_regex_map
to_email_map
from
user_domain
svnlook
+ svnlook_diff
sendmail
set_sender
add_headers
smtp
charset
io_layer
language
with_diff
Thanks in advance.
================
Toshikazu Kinkoh
kaneyuki@eva.hi-ho.ne.jp