process_bug.cgi as backend and dontchange

Christian Reis kiko at async.com.br
Fri Oct 25 19:50:27 UTC 2002


So, I'm hacking away at this CVS->Bugzilla client. 

Context: it's a *pure* HTTP client - all it does is connect to
process_bug.cgi, and send in a well-formed form that updates a single
bug. If I want to add a comment to many bugs, I'll do multiple HTTP
requests, no problem.

Problem: there is no way to specify dontchange if you are changing a
single bug. What I want is to add a single comment - and process_bug
wants *all* the fields defined. dontchange would be a nice way to work
around that, except for the fact that the tests in process_bug only look
at dontchange if it's a multiple bug change. 

I *think* this could be fixed by changing the way process_bug handles
the tests for dontchange. I'll exemplify with a small patch:

Index: process_bug.cgi
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/process_bug.cgi,v
retrieving revision 1.159
diff -u -r1.159 process_bug.cgi
--- process_bug.cgi     25 Oct 2002 03:59:28 -0000      1.159
+++ process_bug.cgi     25 Oct 2002 19:42:37 -0000
@@ -199,8 +199,9 @@
             "WHERE products.id = bugs.product_id AND bug_id =
$::FORM{'id'}");
     $::oldproduct = FetchSQLData();
 }
-if ((($::FORM{'id'} && $::FORM{'product'} ne $::oldproduct) 
-     || (!$::FORM{'id'} && $::FORM{'product'} ne $::FORM{'dontchange'}))
+
+if (($::FORM{'id'} && $::FORM{'product'} ne $::oldproduct) 
+    && ( $::FORM{'product'} ne $::FORM{'dontchange'})
     && CheckonComment( "reassignbycomponent" ))
 {
     CheckFormField(\%::FORM, 'product', \@::legal_product);

This way, if dontchange is specified, it will simply skip that check. Is
that sane?

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL



More information about the developers mailing list