#!/usr/bonsaitools/bin/mysqltcl # -*- Mode: tcl; indent-tabs-mode: nil -*- # # The contents of this file are subject to the Netscape Public License # Version 1.0 (the "License"); you may not use this file except in # compliance with the License. You may obtain a copy of the License at # http://www.mozilla.org/NPL/ # # Software distributed under the License is distributed on an "AS IS" # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the # License for the specific language governing rights and limitations # under the License. # # The Original Code is the Bonsai CVS tool. # # The Initial Developer of the Original Code is Netscape Communications # Corporation. Portions created by Netscape are Copyright (C) 1998 # Netscape Communications Corporation. All Rights Reserved. source CGI.tcl Lock LoadCheckins LoadMOTD LoadWhiteboard LoadTreeConfig Unlock if {$treeopen} { set openword Open } else { set openword Closed } puts "Content-type: text/html Refresh: 300 ($openword) Bonsai -- the art of effectively controlling trees

Bonsai -- Tree Control

foreach t $treelist { if {![info exists treeinfo($t,nobonsai)]} { if {[cequal $t $treeid]} { set c "SELECTED" } else { set c "" } puts "

" if {$readonly} { puts "

Be aware that you are looking at an old hook!

" } puts "[fmtclock [getclock] "%R"]: The tree is currently " if {$treeopen} { puts "OPEN
" } else { puts "CLOSED
" } if {!$treeopen} { puts "The tree has been closed since [MyFmtClock $closetimestamp]." } puts "
" puts "The last known good tree had a timestamp " puts "of [fmtclock $lastgoodtimestamp "%D %T %Z"].
" puts "
$motd

" puts "
" # if {[info exists FORM(whitedelta)]} { # set delta $FORM(whitedelta) # } else { # set delta [expr 24 * 60 * 60] # } # # set fileok 0 # set filename [DataDir]/whitedelta-$delta # if {[file exists $filename]} { # if {[file mtime $filename] > [file mtime [DataDir]/whiteboard]} { # set fileok 1 # } # } # # if {!$fileok} { # set tmp [DataDir]/tmpwhite.[id process] # Lock # set date [fmtclock [expr [getclock] - $delta] "%a %b %d %H:%M:%S LT %Y"] # catch {exec co -q -d$date -p [DataDir]/whiteboard > $tmp 2> /dev/null} # catch {chmod 0666 $tmp} # exec ./changebar.tcl $tmp [DataDir]/whiteboard > $filename # unlink $tmp # catch {chmod 0666 $filename} # Unlock # } #puts "Free-for-all whiteboard: (Changebars indicate changes within last [PrettyDelta $delta])
[html_quote [read_file $filename]]

" puts "Free-for-all whiteboard:
[html_quote $whiteboard]

" foreach c $checkinlist { upvar #0 $c info lappend people($info(person)) $c if {!$info(treeopen)} { lappend closedcheckin($info(person)) $c } } if {[info exists people]} { puts "The following people are on \"the hook\", since they have made" puts "checkins to the tree since it last opened: " puts "

" set peoplelist [lsort [array names people]] set query "(| " foreach p $peoplelist { append query "(mail=$p@netscape.com) " set fullname($p) "" set curcontact($p) "" } append query ")" set ldaperror 0 if {[catch {set fid [open "|./data/ldapsearch -b \"o=Netscape Communications Corp.,c=US\" -h $ldapserver -p $ldapport -s sub -S mail \"$query\" mail cn nscpcurcontactinfo" r]} errvar]} { set ldaperror 1 } else { set doingcontactinfo 0 while {[gets $fid line] >= 0} { if {$doingcontactinfo} { if {[regexp -- {^ (.*)$} $line foo n]} { append curcontact($curperson) $n continue } set doingcontactinfo 0 } if {[regexp -- {^mail: (.*)@} $line foo n]} { set curperson $n } elseif {[regexp -- {^cn: (.*)$} $line foo n]} { set fullname($curperson) $n } elseif {[regexp -- {^nscpcurcontactinfo: (.*)$} $line foo n]} { set curcontact($curperson) $n set doingcontactinfo 1 } } if {[catch {close $fid} errvar]} { set ldaperror 1 } } if {$ldaperror} { puts "Can't contact the directory server at $ldapserver:$ldapport -- $errvar" } puts "" puts "" foreach p $peoplelist { if {[info exists closedcheckin($p)]} { set extra " ([llength $closedcheckin($p)] while tree closed!)" } else { set extra "" } puts " " puts " " } puts "
WhoWhatHow to contact
$fullname($p) $p [llength $people($p)] [Pluralize change [llength $people($p)]]$extra$curcontact($p)
" puts "[llength $checkinlist] checkins." if {[cequal $treeid default]} { set mailaddr "bonsai-hook" } else { set f [open data/$treeid/hooklist r] set fileEOF [gets $f hookentry] set theHookList {} while { $fileEOF != -1 } { set theHookList [concat $theHookList $hookentry] set fileEOF [gets $f hookentry] } set mailaddr "$theHookList" } puts "

" puts "Show all checkins.
" if {[cequal $treeid default]} { puts "" } else { puts "" } puts "Send mail to \"the hook\".
" } else { puts "Nobody seems to have made any changes since the tree opened." } set cvsqueryurl "cvsqueryform.cgi?cvsroot=$treeinfo($treeid,repository)&module=$treeinfo($treeid,module)" if {[clength $treeinfo($treeid,branch)] > 0} { append cvsqueryurl "&branch=$treeinfo($treeid,branch)" } puts "


Useful links Help corner
CVS Query Tool
Tinderbox continuous builds
Switch to look at a different tree or branch
Look at the Busted Tree Newsgroup
Look up someone in the phonebook.
Time warp -- view a different day's hook.
See some stupid statistics about recent checkins.
Administration menu.
Introduction to Bonsai.
Overview of our source tree strategy.
Changing someone else's contact info (yes you can!)
Dogbert build lore
" exit