--- trunk/svn-rt-comment.pl 2008/09/28 15:31:03 90 +++ trunk/svn-rt-comment.pl 2008/10/23 21:45:59 93 @@ -11,7 +11,7 @@ # Request Tracker my ( $server, $username, $password ) = ( 'https://bugs.example.com/rt', 'rtuser', 'rtpasswd' ); # patternt to recognize RT references in commits log or diff -my $rt_re = qr/rt\s*#\s*(\d+)/i; +my $rt_re = qr/rt\s*#?\s*(\d+)/i; my $svnweb = 'https://svn.example.com/svnweb/index.cgi/strix/revision/?rev='; die "usage: $0 repo rev\n" unless @ARGV; @@ -20,7 +20,9 @@ sub svnlook { my $command = shift; - `svnlook $command --revision $rev $repo` + my $txt = `svnlook $command --revision $rev $repo`; + chomp( $txt ); + return $txt; } my $log = svnlook 'log'; @@ -35,11 +37,11 @@ my $ticket = RT::Client::REST::Ticket->new( rt => $rt, id => $id ); my $message = - svnlook 'author' . "\t" . svnlook 'date' . "\n" . - $svnweb . $rev . "\n\n" . - svnlook 'changed --copy-info' . "\n" . + $svnweb . $rev . "\n" . + svnlook('author') . "\t" . svnlook('date') . "\n\n" . + svnlook('changed --copy-info') . "\n\n" . $log ; - + $ticket->comment( message => $message ); }