public inbox for gnats-devel@sourceware.org
 help / color / mirror / Atom feed
* faking an append-only field
@ 2002-08-01 12:33 Mike Hoolehan
  2002-08-01 14:07 ` Dirk Bergstrom
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Hoolehan @ 2002-08-01 12:33 UTC (permalink / raw)
  To: Help-gnats

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 

_______________________________________________
Help-gnats mailing list
Help-gnats@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnats

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-08-01 19:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-01 12:33 faking an append-only field Mike Hoolehan
2002-08-01 14:07 ` Dirk Bergstrom
2002-08-04  4:01   ` Mike Hoolehan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).