Hi all,

In response to my own mail. 
I've created a little patch, so that tagging will only be done in the 
Bugtracker when 'valid_product_name' is enabled.
The patch is against release 0.19.13 (see attachment).

Regards,
Marcel Loose

--- /usr/share/scmbug/lib/Scmbug/Daemon/Integration.pm.org      2007-08-29 
10:57:43.000000000 +0000
+++ /usr/share/scmbug/lib/Scmbug/Daemon/Integration.pm  2007-08-29 
13:41:22.000000000 +0000
@@ -167,40 +167,43 @@
 
     $self->bugtracker()->integration_connect_database();
 
-    if ( $request->{ type }->{ tag }->{ operation } eq $TAG_OPERATION_ADD ) {
-       # Add the tag if it's not already there
-       if ( $self->bugtracker()->integration_tag_exists( $request->{ 
product_name },
-                                                         $request->{ type }->{ 
tag }->{ name } ) == 0) {
-           # This tag does not exist already for this product. Add it
+    # Apply policy valid_product_name
+    if ( $request->{ policies }->{ valid_product_name }->{ enabled } ) {
+       if ( $request->{ type }->{ tag }->{ operation } eq $TAG_OPERATION_ADD ) 
{
+           # Add the tag if it's not already there
+           if ( $self->bugtracker()->integration_tag_exists( $request->{ 
product_name },
+                                                             $request->{ type 
}->{ tag }->{ name } ) == 0) {
+               # This tag does not exist already for this product. Add it
+               my $ret;
+               $ret = $self->bugtracker()->integration_add_tag( $request->{ 
product_name },
+                                                                $request->{ 
type }->{ tag }->{ name },
+                                                                $request->{ 
original_log_message } );
+
+               if ( $ret != 0) {
+                   $ret_message = "Tag '" . $request->{ type }->{ tag }->{ 
name } . 
+                       "' could not be added on product '" . $request->{ 
product_name } . "\n";
+                   $request->add_result( 1, $ret_message );
+               }
+           } else {
+               # An SCM system mistakenly issued multiple tag activities
+               # (e.g. CVS). Do not add the tag again.
+               $self->bugtracker()->integration_disconnect_database();
+               return 0;
+           }
+       } elsif ( $request->{ type }->{ tag }->{ operation } eq 
$TAG_OPERATION_DELETE ) {
+           # Delete the tag
            my $ret;
-           $ret = $self->bugtracker()->integration_add_tag( $request->{ 
product_name },
-                                                            $request->{ type 
}->{ tag }->{ name },
-                                                            $request->{ 
original_log_message } );
-           
+           $ret = $self->bugtracker()->integration_delete_tag( $request->{ 
product_name },
+                                                               $request->{ 
type }->{ tag }->{ name } );
+
            if ( $ret != 0) {
                $ret_message = "Tag '" . $request->{ type }->{ tag }->{ name } 
. 
-                   "' could not be added on product '" . $request->{ 
product_name } . "\n";
+                   "' could not be deleted from product '" . $request->{ 
product_name } . "'\n";
                $request->add_result( 1, $ret_message );
            }
-       } else {
-           # An SCM system mistakenly issued multiple tag activities
-           # (e.g. CVS). Do not add the tag again.
-           $self->bugtracker()->integration_disconnect_database();
-           return 0;
-       }
-    } elsif ( $request->{ type }->{ tag }->{ operation } eq 
$TAG_OPERATION_DELETE ) {
-       # Delete the tag
-       my $ret;
-       $ret = $self->bugtracker()->integration_delete_tag( $request->{ 
product_name },
-                                                           $request->{ type 
}->{ tag }->{ name } );
-       
-       if ( $ret != 0) {
-           $ret_message = "Tag '" . $request->{ type }->{ tag }->{ name } . 
-               "' could not be deleted from product '" . $request->{ 
product_name } . "'\n";
-           $request->add_result( 1, $ret_message );
+       } elsif ( $request->{ type }->{ tag }->{ operation } eq 
$TAG_OPERATION_MOVE ) {
+           # Do nothing
        }
-    } elsif ( $request->{ type }->{ tag }->{ operation } eq 
$TAG_OPERATION_MOVE ) {
-       # Do nothing
     }
 
     $self->bugtracker()->integration_disconnect_database();
_______________________________________________
scmbug-users mailing list
[email protected]
http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users

Reply via email to