help-gnats
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

faking an append-only field


From: Mike Hoolehan
Subject: faking an append-only field
Date: Thu, 1 Aug 2002 14:27:42 -0400
User-agent: Mutt/1.2.5.1i

With the gnats 4 beta, I'm attempting to mimic the audit trail behavior I'm
used to in bugzilla (basically an append-only field).  Here's my attempt,
that works mostly:


field "Add-To-Audit-Trail" {
    description "Add a log entry to Audit Trail"
    multitext
    on-change {
        add-audit-trail
        audit-trail-format {
        format "--------- Comments by %s on %s ---------\n %s\n\n"
        fields { "$EditUserEmailAddr" "$CurrentDate" "$NewValue" }
        }
    }   
    on-change { 
        set-field "Add-To-Audit-Trail" { "\n" }
    }
}   
    
Then I just made the original Audit-Trail field 'read-only'.   

This strategy works correctly except after the PR has just been created 
and the PR is edited the first time.  Even if the user doesn't change the 
"Add-To-Audit-Trail" field on the gnatsweb interface, the on-change 
stuff is being run (It inserts the "Comments by" line with no $NewValue
showing up).  I've experimented with conditional 'on-change' using
regexes, but nothing seemed to help.  

So the specific question is:  How do I prevent the on-change stuff for this
field from being run the first time a PR is edited?  But if you have any
better ideas on how to implement what I want, I'll take those too.

This may just be an artifact of gnatsweb, in which case I'm sorry for
posting to the wrong list.

Thanks,
Mike 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]