11 |
# Request Tracker |
# Request Tracker |
12 |
my ( $server, $username, $password ) = ( 'https://bugs.example.com/rt', 'rtuser', 'rtpasswd' ); |
my ( $server, $username, $password ) = ( 'https://bugs.example.com/rt', 'rtuser', 'rtpasswd' ); |
13 |
# patternt to recognize RT references in commits log or diff |
# patternt to recognize RT references in commits log or diff |
14 |
my $rt_re = qr/rt\s*#\s*(\d+)/i; |
my $rt_re = qr/rt\s*#?\s*(\d+)/i; |
15 |
my $svnweb = 'https://svn.example.com/svnweb/index.cgi/strix/revision/?rev='; |
my $svnweb = 'https://svn.example.com/svnweb/index.cgi/strix/revision/?rev='; |
16 |
|
|
17 |
die "usage: $0 repo rev\n" unless @ARGV; |
die "usage: $0 repo rev\n" unless @ARGV; |
20 |
|
|
21 |
sub svnlook { |
sub svnlook { |
22 |
my $command = shift; |
my $command = shift; |
23 |
`svnlook $command --revision $rev $repo` |
my $txt = `svnlook $command --revision $rev $repo`; |
24 |
|
chomp( $txt ); |
25 |
|
return $txt; |
26 |
} |
} |
27 |
|
|
28 |
my $log = svnlook 'log'; |
my $log = svnlook 'log'; |
37 |
my $ticket = RT::Client::REST::Ticket->new( rt => $rt, id => $id ); |
my $ticket = RT::Client::REST::Ticket->new( rt => $rt, id => $id ); |
38 |
|
|
39 |
my $message = |
my $message = |
40 |
svnlook 'author' . "\t" . svnlook 'date' . "\n" . |
$svnweb . $rev . "\n" . |
41 |
$svnweb . $rev . "\n\n" . |
svnlook('author') . "\t" . svnlook('date') . "\n\n" . |
42 |
svnlook 'changed --copy-info' . "\n" . |
svnlook('changed --copy-info') . "\n\n" . |
43 |
$log |
$log |
44 |
; |
; |
45 |
|
|
46 |
$ticket->comment( message => $message ); |
$ticket->comment( message => $message ); |
47 |
} |
} |