Skip to content
Snippets Groups Projects
Commit 36b93e98 authored by deuce's avatar deuce
Browse files

If state or responsible is being changed, use the CVS message as the change

reason and don't separately append to the audit trail.
Remove trailing newlines from state and responsible before testing against
new value.
Do a send_followup() if neither responsible nor state is being changed.
parent 54536dbe
Branches
Tags
No related merge requests found
......@@ -31,21 +31,29 @@ while((pr=myRe.exec(logmsg))!=undefined) {
stateprs[pr[1]]=pr[2];
}
for(pr in auditprs) {
if(name != gnats.get_field(pr,"Responsible")) {
log("Changeing responsible to "+name+" for PR: "+pr);
if(!gnats.replace(pr, "Responsible", name, "CVS Commit"))
for(pr in stateprs) {
var oldstate = gnats.get_field(pr,"State");
oldstate = oldstate.replace(/[\r\n]/g,'');
if(stateprs[pr] != oldstate) {
log("Changeing state of PR: "+pr+" to "+stateprs[pr]);
if(!gnats.replace(pr, "State", stateprs[pr], logmsg))
handle_error();
else
delete auditprs[pr];
}
log("Appending log info to PR: "+pr);
if(!gnats.append(pr,"Audit-Trail", logmsg, "CVS Commit"))
handle_error();
}
for(pr in stateprs) {
if(stateprs[pr] != gnats.get_field(pr,"State")) {
log("Changeing state of PR: "+pr+" to "+stateprs[pr]);
if(!gnats.replace(pr, "State", stateprs[pr], "CVS Commit"))
for(pr in auditprs) {
var oldname = gnats.get_field(pr,"Responsible");
oldname = oldname.replace(/[\r\n]/g,'');
if(name != oldname) {
log("Changeing responsible to "+name+" for PR: "+pr);
if(!gnats.replace(pr, "Responsible", name, logmsg))
handle_error();
}
else {
log("Sending followup to PR: "+pr);
if(!gnats.send_followup(pr, name, name, logmsg))
handle_error();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment