Check-in [7b71f64766]
Not logged in
Overview

SHA1 Hash:7b71f64766ac8089576c02bce1f513cef4f2603a
Date: 2008-02-16 06:45:03
User: aku
Comment:Integrated memory tracking into the option processor for activation and configuration, and into the log system for use. The latter means that each actual output to the log is an introspection point.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified tools/cvs2fossil/lib/c2f_option.tcl from [be274ee796] to [525f34a1bc].

@@ -20,10 +20,11 @@
 
 package require Tcl 8.4                               ; # Required runtime.
 package require snit                                  ; # OO system.
 package require vc::tools::trouble                    ; # Error reporting.
 package require vc::tools::log                        ; # User feedback.
+package require vc::tools::mem                        ; # Memory tracking.
 package require vc::tools::misc                       ; # Misc. path reformatting.
 package require vc::fossil::import::cvs::fossil       ; # Fossil repository access
 package require vc::fossil::import::cvs::pass         ; # Pass management
 package require vc::fossil::import::cvs::pass::collar ; # Pass I.
 package require vc::fossil::import::cvs::repository   ; # Repository management
@@ -87,10 +88,12 @@
 		--batch                     { log noprogress }
 		--dots                      { cyclebreaker dotsto [Value arguments] }
 		--watch                     { cyclebreaker watch  [Value arguments] }
 		--statesavequeriesto        { state savequeriesto [Value arguments] }
 		--fossil                    { fossil setlocation  [Value arguments] }
+		--memory-limit              { mem::setlimit [Value arguments] }
+		--memory-track              { mem::track }
 		default {
 		    Usage $badoption$option\n$gethelp
 		}
 	    }
 	}
@@ -248,10 +251,13 @@
 	namespace import ::vc::fossil::import::cvs::repository
 	namespace import ::vc::fossil::import::cvs::state
 	namespace import ::vc::fossil::import::cvs::integrity
 	namespace eval project {
 	    namespace import ::vc::fossil::import::cvs::project::sym
+	}
+	namespace eval mem {
+	    namespace import ::vc::tools::mem::setlimit
 	}
 	namespace import ::vc::tools::trouble
 	namespace import ::vc::tools::log
     }
 }

Modified tools/cvs2fossil/lib/log.tcl from [63d56912ab] to [c2ee0c0574].

@@ -13,12 +13,13 @@
 ## Utility package, basic user feedback
 
 # # ## ### ##### ######## ############# #####################
 ## Requirements
 
-package require Tcl 8.4 ; # Required runtime
-package require snit    ; # OO system.
+package require Tcl 8.4        ; # Required runtime
+package require snit           ; # OO system.
+package require vc::tools::mem ; # Memory tracking.
 
 # # ## ### ##### ######## ############# #####################
 ##
 
 snit::type ::vc::tools::log {
@@ -136,11 +137,14 @@
     }
 
     # Write handler. Each message is a line.
 
     proc OUT/write {system text} {
-	puts "$system [join [split $text \n] "\n$system "]"
+	set m [mlog]
+	regsub -all {[^	]} $m { } b
+	puts "$m$system [join [split $text \n] "\n$b$system "]"
+	mlimit
 	return
     }
 
     # Progress handler. Uses \r to return to the beginning of the
     # current line without advancing.
@@ -165,12 +169,16 @@
     # # ## ### ##### ######## #############
 }
 
 namespace eval ::vc::tools {
     namespace export log
+    namespace eval log {
+	namespace import ::vc::tools::mem::mlog
+	namespace import ::vc::tools::mem::mlimit
+    }
 }
 
 # -----------------------------------------------------------------------------
 # Ready
 
 package provide vc::tools::log 1.0
 return