[Rt-commit] r2222 - in RT-Integration-SVN: . html/SVN
jesse at bestpractical.com
jesse at bestpractical.com
Thu Feb 10 21:00:13 EST 2005
Author: jesse
Date: Thu Feb 10 21:00:12 2005
New Revision: 2222
Modified:
RT-Integration-SVN/ (props changed)
RT-Integration-SVN/html/SVN/PullUpdate.html
Log:
r4681 at hualien: jesse | 2005-02-11T01:12:55.633130Z
From Dave Rolsky
This patch adds the following:
RT-Owner: foo
RT-TicketProperty: X
^^ doesn't work with custom fields though, but it's darn handy to set
TimeWorked
Output when it's successful, which makes testing way easier.
Modified: RT-Integration-SVN/html/SVN/PullUpdate.html
==============================================================================
--- RT-Integration-SVN/html/SVN/PullUpdate.html (original)
+++ RT-Integration-SVN/html/SVN/PullUpdate.html Thu Feb 10 21:00:12 2005
@@ -48,6 +48,8 @@
my $update_msg = '';
my $update_type = 'comment';
my $update_status = '';
+my $update_owner = '';
+my %set;
foreach my $line (@msg) {
if ( $line =~ /^\s*RT-Ticket:\s*(\w*?)(?:\#?)(\d*)/ ) {
next if ($1 && $1 !~ /^$RT::rtname$/i);
@@ -60,6 +62,12 @@
elsif ( $line =~ /^\s*RT-(?:Update|Action):\s*(comment|correspond)/i ) {
$update_type = lc($1);
}
+ elsif ( $line =~ /^\s*RT-Owner:\s*(\w+)/i ) {
+ $update_owner = $1;
+ }
+ elsif ( $line =~ /^\s*RT-(\w+):\s*(\w+)/i ) {
+ $set{$1} = $2;
+ }
else {
$update_msg .= $line;
}
@@ -78,12 +86,30 @@
}
}
$ticket->AddLink( Type => 'RefersTo', Target => $CHANGE_URI );
+ $m->out( "Added link to $CHANGE_URI\n" );
$update_msg = "Subversion update $REPO\@$rev \n" . $update_msg;
$update_type = ucfirst($update_type);
$ticket->$update_type( Content => $update_msg );
+ $m->out( "Added commit text as $update_type\n" );
+
+ if ($update_owner) {
+ my ($status, $msg) = $ticket->SetOwner($update_owner);
+ $m->out( "Set owner to $update_owner\n" );
+ $m->out( "Failed: $msg\n" ) unless $status;
+ }
+
if ($update_status && $ticket->QueueObj->IsValidStatus($update_status)) {
$ticket->SetStatus($update_status);
+ $m->out( "Set status to $update_status\n" );
+ }
+
+ if (keys %set) {
+ for my $k (keys %set) {
+ my $meth = "Set$k";
+ $ticket->$meth($set{$k});
+ $m->out( "Set $k to $set{$k}\n" );
+ }
}
}
$m->abort();
More information about the Rt-commit
mailing list