Overview
SHA1 Hash: | 86a7f249c1f950d84dbfe93ec3acaa7715519f49 |
---|---|
Date: | 2007-09-09 00:58:18 |
User: | aku |
Comment: | Started to restructure the namespace hierarchy, beginning at the bottom, with the log module. |
Timelines: | ancestors | descendants | both | trunk |
Other Links: | files | ZIP archive | manifest |
Tags And Properties
- branch=trunk inherited from [a28c83647d]
- sym-trunk inherited from [a28c83647d]
Changes
[hide diffs]Modified tools/import-cvs.tcl from [059d2512cc] to [ddccc2da01].
@@ -40,12 +40,12 @@ # ----------------------------------------------------------------------------- # Requirements package require Tcl 8.4 -package require tools::log ; # User Feedback -package require import::cvs ; # Importer Control +package require vc::tools::log ; # User Feedback +package require import::cvs ; # Importer Control # ----------------------------------------------------------------------------- proc main {} { commandline -> cvs fossil @@ -65,11 +65,11 @@ while {[string match "-*" [set opt [this]]]} { switch -exact -- $opt { --nosign { import::cvs::configure -nosign 1 } --debugcommit { import::cvs::configure -debugcommit 1 } --stopat { next ; import::cvs::configure -stopat [this] } - -v { incr verbosity ; ::tools::log::verbosity $verbosity } + -v { incr verbosity ; ::vc::tools::log::verbosity $verbosity } default usage } next }
Modified tools/lib/cvs.tcl from [8597d1c1ae] to [e04bcf97f2].
@@ -3,18 +3,18 @@ # ----------------------------------------------------------------------------- # Requirements package require Tcl 8.4 -package require fileutil ; # Tcllib (traverse directory hierarchy) -package require rcsparser ; # Handling the RCS archive files. -package require tools::log ; # User feedback +package require fileutil ; # Tcllib (traverse directory hierarchy) +package require rcsparser ; # Handling the RCS archive files. +package require vc::tools::log ; # User feedback package require struct::tree namespace eval ::cvs { - tools::log::system cvs - namespace import ::tools::log::write + vc::tools::log::system cvs + namespace import ::vc::tools::log::write } # ----------------------------------------------------------------------------- # API
Modified tools/lib/fossil.tcl from [c547c7c383] to [71d028abee].
@@ -3,15 +3,15 @@ # ----------------------------------------------------------------------------- # Requirements package require Tcl 8.4 -package require tools::log ; # User feedback +package require vc::tools::log ; # User feedback namespace eval ::fossil { - tools::log::system fossil - namespace import ::tools::log::write + vc::tools::log::system fossil + namespace import ::vc::tools::log::write } # ----------------------------------------------------------------------------- # API
Modified tools/lib/importcvs.tcl from [5121bc9587] to [d9f32d3964].
@@ -3,17 +3,17 @@ # ----------------------------------------------------------------------------- # Requirements package require Tcl 8.4 -package require cvs ; # Frontend, reading from source repository -package require fossil ; # Backend, writing to destination repository. -package require tools::log ; # User feedback +package require cvs ; # Frontend, reading from source repository +package require fossil ; # Backend, writing to destination repository. +package require vc::tools::log ; # User feedback namespace eval ::import::cvs { - tools::log::system import - namespace import ::tools::log::write + vc::tools::log::system import + namespace import ::vc::tools::log::write } # ----------------------------------------------------------------------------- # API @@ -83,11 +83,11 @@ set ntrunk [cvs::ntrunk] ; set ntfmt %[string length $ntrunk]s set nmax [cvs::ncsets] ; set nmfmt %[string length $nmax]s cvs::foreach_cset cset [cvs::root] { - ::tools::log::write 0 import "ChangeSet [format $nmfmt $cset] @ [format $ntfmt $nto]/$ntrunk ([format %6.2f [expr {$nto*100.0/$ntrunk}]]%)" + ::vc::tools::log::write 0 import "ChangeSet [format $nmfmt $cset] @ [format $ntfmt $nto]/$ntrunk ([format %6.2f [expr {$nto*100.0/$ntrunk}]]%)" Statistics [OneChangeSet $cset] } write 0 import "========= [string repeat = 61]" write 0 import "Imported $nto [expr {($nto == 1) ? "changeset" : "changesets"}]" @@ -115,14 +115,14 @@ set tot [expr {$tot + $sec}] set avg [expr {$tot/$nto}] set max [expr {$ntrunk * $avg}] set rem [expr {$max - $tot}] - ::tools::log::write 3 import "st avg [format %.2f $avg] sec" - ::tools::log::write 3 import "st run [format %7.2f $tot] sec [format %6.2f [expr {$tot/60}]] min [format %5.2f [expr {$tot/3600}]] hr" - ::tools::log::write 3 import "st end [format %7.2f $max] sec [format %6.2f [expr {$max/60}]] min [format %5.2f [expr {$max/3600}]] hr" - ::tools::log::write 3 import "st rem [format %7.2f $rem] sec [format %6.2f [expr {$rem/60}]] min [format %5.2f [expr {$rem/3600}]] hr" + ::vc::tools::log::write 3 import "st avg [format %.2f $avg] sec" + ::vc::tools::log::write 3 import "st run [format %7.2f $tot] sec [format %6.2f [expr {$tot/60}]] min [format %5.2f [expr {$tot/3600}]] hr" + ::vc::tools::log::write 3 import "st end [format %7.2f $max] sec [format %6.2f [expr {$max/60}]] min [format %5.2f [expr {$max/3600}]] hr" + ::vc::tools::log::write 3 import "st rem [format %7.2f $rem] sec [format %6.2f [expr {$rem/60}]] min [format %5.2f [expr {$rem/3600}]] hr" return } proc ::import::cvs::OneChangeSet {cset} { variable nosign @@ -143,12 +143,12 @@ } 1] 0] cvs::uuid $cset $uuid set sec [expr {$usec/1e6}] - ::tools::log::write 2 import "== $uuid +${ad}-${rm}*${ch}" - ::tools::log::write 2 import "st in [format %.2f $sec] sec" + ::vc::tools::log::write 2 import "== $uuid +${ad}-${rm}*${ch}" + ::vc::tools::log::write 2 import "st in [format %.2f $sec] sec" return $sec } # -----------------------------------------------------------------------------
Modified tools/lib/log.tcl from [5fe2d143d0] to [a68dbe32df].
@@ -3,26 +3,26 @@ # ----------------------------------------------------------------------------- # Requirements package require Tcl 8.4 -namespace eval ::tools::log {} +namespace eval ::vc::tools::log {} # ----------------------------------------------------------------------------- # API # Feedback generation. # -# tools::log::write verbosity system text - Write message to the log. -# tools::log::progress verbosity system n max - Drive a progress display. +# vc::tools::log::write verbosity system text - Write message to the log. +# vc::tools::log::progress verbosity system n max - Drive a progress display. # Administrative operations. # -# tools::log::verbosity level - Set the verbosity level of the application. -# tools::log::verbosity? - Query the verbosity level of the application. -# tools::log::setCmd cmdprefix - Set callback for output -# tools::log::system name - Register a system (enables tabular log formatting). +# vc::tools::log::verbosity level - Set the verbosity level of the application. +# vc::tools::log::verbosity? - Query the verbosity level of the application. +# vc::tools::log::setCmd cmdprefix - Set callback for output +# vc::tools::log::system name - Register a system (enables tabular log formatting). # Callback API ( Executed at the global level). # # cmdprefix 'write' system text # cmdprefix 'progress' system n max @@ -34,11 +34,11 @@ # Write the message 'text' to log, for the named 'system'. The message # is written if and only if the message verbosity is less or equal the # chosen verbosity. A message of verbosity 0 cannot be blocked. -proc ::tools::log::write {verbosity system text} { +proc ::vc::tools::log::write {verbosity system text} { variable loglevel variable logcmd variable sysfmt if {$verbosity > $loglevel} return uplevel #0 [linsert $logcmd end write [format $sysfmt $system] $text] @@ -47,11 +47,11 @@ # Similar to write, especially in the handling of the verbosity, to # drive progress displays. It signals that for some long running # operation we are at tick 'n' of at most 'max' ticks. -proc ::tools::log::progress {verbosity system n max} { +proc ::vc::tools::log::progress {verbosity system n max} { variable loglevel variable logcmd variable sysfmt if {$verbosity > $loglevel} return uplevel #0 [linsert $logcmd end progress [format $sysfmt $system] $n $max] @@ -62,38 +62,38 @@ # API Implementation - Administrative operations. # Set verbosity to the chosen 'level'. Only messages with a level less # or equal to this one will be shown. -proc ::tools::log::verbosity {level} { +proc ::vc::tools::log::verbosity {level} { variable loglevel if {$level < 1} {set level 0} set loglevel $level return } # Query the currently set verbosity. -proc ::tools::log::verbosity? {} { +proc ::vc::tools::log::verbosity? {} { variable loglevel return $loglevel } # Set the log callback handling the actual output of messages going # through the package. -proc ::tools::log::setCmd {cmdprefix} { +proc ::vc::tools::log::setCmd {cmdprefix} { variable logcmd $cmdprefix return } # Register a system name, to enable tabular formatting. This is done # by setting up a format specifier with a proper width. This is # handled in the generation command, before the output callback is # invoked. -proc ::tools::log::system {name} { +proc ::vc::tools::log::system {name} { variable sysfmt variable syslen set nlen [string length $name] if {$nlen < $syslen} return @@ -106,42 +106,42 @@ # ----------------------------------------------------------------------------- # Internal operations - Standard output operation # Dispatch to the handlers of the possible operations. -proc ::tools::log::OUT {op args} { - eval [linsert $args 0 ::tools::log::OUT/$op] +proc ::vc::tools::log::OUT {op args} { + eval [linsert $args 0 ::vc::tools::log::OUT/$op] return } # Write handler. Each message is a line. -proc ::tools::log::OUT/write {system text} { +proc ::vc::tools::log::OUT/write {system text} { puts "$system $text" return } -# Progress handler. Using \r to return to the beginning of the current +# Progress handler. Uses \r to return to the beginning of the current # line without advancing. -proc ::tools::log::OUT/progress {system n max} { +proc ::vc::tools::log::OUT/progress {system n max} { puts -nonewline "$system [format %[string length $max]s $n]/$max\r" flush stdout return } # ----------------------------------------------------------------------------- -namespace eval ::tools::log { - variable loglevel 0 ; # Allow only uninteruptible messages. - variable logcmd ::tools::log::OUT ; # Standard output to stdout. - variable sysfmt %s ; # Non-tabular formatting. - variable syslen 0 ; # Ditto. +namespace eval ::vc::tools::log { + variable loglevel 0 ; # Allow only uninteruptible messages. + variable logcmd ::vc::tools::log::OUT ; # Standard output to stdout. + variable sysfmt %s ; # Non-tabular formatting. + variable syslen 0 ; # Ditto. namespace export write progress } # ----------------------------------------------------------------------------- # Ready -package provide tools::log 1.0 +package provide vc::tools::log 1.0 return
Modified tools/lib/pkgIndex.tcl from [a4908f4528] to [bb0d5bc884].
@@ -1,6 +1,6 @@ if {![package vsatisfies [package require Tcl] 8.4]} return package ifneeded rcsparser 1.0 [list source [file join $dir rcsparser.tcl]] package ifneeded cvs 1.0 [list source [file join $dir cvs.tcl]] package ifneeded fossil 1.0 [list source [file join $dir fossil.tcl]] -package ifneeded tools::log 1.0 [list source [file join $dir log.tcl]] package ifneeded import::cvs 1.0 [list source [file join $dir importcvs.tcl]] +package ifneeded vc::tools::log 1.0 [list source [file join $dir log.tcl]]
Modified tools/lib/rcsparser.tcl from [ba9e03a5e7] to [ac06de305c].
@@ -10,16 +10,16 @@ # ----------------------------------------------------------------------------- # Requirements package require Tcl 8.4 -package require fileutil ; # Tcllib (cat) -package require tools::log ; # User feedback +package require fileutil ; # Tcllib (cat) +package require vc::tools::log ; # User feedback namespace eval ::rcsparser { - tools::log::system rcs - namespace import ::tools::log::progress + vc::tools::log::system rcs + namespace import ::vc::tools::log::progress } # ----------------------------------------------------------------------------- # API