Overview
SHA1 Hash: | 9671b65174e6ac8b17c2e048259bbc7d3e102cca |
---|---|
Date: | 2007-09-13 05:43:56 |
User: | aku |
Comment: | Continued restructuring of the code (namespace hierarchy, import control). |
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 [ddccc2da01] to [5138f35894].
@@ -40,18 +40,22 @@ # ----------------------------------------------------------------------------- # Requirements package require Tcl 8.4 -package require vc::tools::log ; # User Feedback -package require import::cvs ; # Importer Control +package require vc::tools::log ; # User Feedback +package require vc::fossil::import::cvs ; # Importer Control + +namespace eval ::import { + namespace import ::vc::fossil::import::cvs::* +} # ----------------------------------------------------------------------------- proc main {} { - commandline -> cvs fossil - import::cvs::run $cvs $fossil + commandline -> cvs fossil + import::run $cvs $fossil return } # ----------------------------------------------------------------------------- @@ -62,13 +66,13 @@ set verbosity 0 clinit 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] } + --nosign { import::configure -nosign 1 } + --debugcommit { import::configure -debugcommit 1 } + --stopat { next ; import::configure -stopat [this] } -v { incr verbosity ; ::vc::tools::log::verbosity $verbosity } default usage } next }
Modified tools/lib/importcvs.tcl from [d9f32d3964] to [b9cf7cd8df].
@@ -7,34 +7,34 @@ package require Tcl 8.4 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 { +namespace eval ::vc::fossil::import::cvs { vc::tools::log::system import namespace import ::vc::tools::log::write } # ----------------------------------------------------------------------------- # API # Configuration # -# import::cvs::configure key value - Set configuration +# vc::fossil::import::cvs::configure key value - Set configuration # # Legal keys: -nosign <bool>, default false # -debugcommit <bool>, default false # -stopat <int>, default :none: # # Functionality # -# import::cvs::run src dst - Perform an import. +# vc::fossil::import::cvs::run src dst - Perform an import. # ----------------------------------------------------------------------------- # API Implementation - Functionality -proc ::import::cvs::configure {key value} { +proc ::vc::fossil::import::cvs::configure {key value} { variable nosign variable stopat switch -exact -- $key { -debugcommit { @@ -61,11 +61,11 @@ } # Import the CVS repository found at directory 'src' into the new # fossil repository at 'dst'. -proc ::import::cvs::run {src dst} { +proc ::vc::fossil::import::cvs::run {src dst} { variable stopat cvs::at $src ; # Define location of CVS repository cvs::scan ; # Gather revision data from the archives @@ -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] { - ::vc::tools::log::write 0 import "ChangeSet [format $nmfmt $cset] @ [format $ntfmt $nto]/$ntrunk ([format %6.2f [expr {$nto*100.0/$ntrunk}]]%)" + 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"}]" @@ -102,11 +102,11 @@ } # ----------------------------------------------------------------------------- # Internal operations - Import a single changeset. -proc ::import::cvs::Statistics {sec} { +proc ::vc::fossil::import::cvs::Statistics {sec} { upvar 1 tot tot nto nto ntrunk ntrunk # No statistics if the commit was stopped before it was run if {$sec eq ""} return @@ -115,18 +115,18 @@ set tot [expr {$tot + $sec}] set avg [expr {$tot/$nto}] set max [expr {$ntrunk * $avg}] set rem [expr {$max - $tot}] - ::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" + write 3 import "st avg [format %.2f $avg] sec" + write 3 import "st run [format %7.2f $tot] sec [format %6.2f [expr {$tot/60}]] min [format %5.2f [expr {$tot/3600}]] hr" + write 3 import "st end [format %7.2f $max] sec [format %6.2f [expr {$max/60}]] min [format %5.2f [expr {$max/3600}]] hr" + 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} { +proc ::vc::fossil::import::cvs::OneChangeSet {cset} { variable nosign variable stopat if {$stopat == $cset} { fossil::commit 1 cvs2fossil $nosign \ @@ -143,24 +143,26 @@ } 1] 0] cvs::uuid $cset $uuid set sec [expr {$usec/1e6}] - ::vc::tools::log::write 2 import "== $uuid +${ad}-${rm}*${ch}" - ::vc::tools::log::write 2 import "st in [format %.2f $sec] sec" + write 2 import "== $uuid +${ad}-${rm}*${ch}" + write 2 import "st in [format %.2f $sec] sec" return $sec } # ----------------------------------------------------------------------------- -namespace eval ::import::cvs { +namespace eval ::vc::fossil::import::cvs { variable debugcommit 0 ; # Debug the commit operation. variable nosign 0 ; # Require signing variable stopat {} ; # Stop nowhere + + namespace export run configure } # ----------------------------------------------------------------------------- # Ready -package provide import::cvs 1.0 +package provide vc::fossil::import::cvs 1.0 return
Modified tools/lib/pkgIndex.tcl from [bb0d5bc884] to [8aad5ceaab].
@@ -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 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]] +package ifneeded vc::fossil::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]]