Fossil SCM

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.

aku 2008-02-16 06:45 trunk
Commit 7b71f64766ac8089576c02bce1f513cef4f2603a
--- tools/cvs2fossil/lib/c2f_option.tcl
+++ tools/cvs2fossil/lib/c2f_option.tcl
@@ -20,10 +20,11 @@
2020
2121
package require Tcl 8.4 ; # Required runtime.
2222
package require snit ; # OO system.
2323
package require vc::tools::trouble ; # Error reporting.
2424
package require vc::tools::log ; # User feedback.
25
+package require vc::tools::mem ; # Memory tracking.
2526
package require vc::tools::misc ; # Misc. path reformatting.
2627
package require vc::fossil::import::cvs::fossil ; # Fossil repository access
2728
package require vc::fossil::import::cvs::pass ; # Pass management
2829
package require vc::fossil::import::cvs::pass::collar ; # Pass I.
2930
package require vc::fossil::import::cvs::repository ; # Repository management
@@ -87,10 +88,12 @@
8788
--batch { log noprogress }
8889
--dots { cyclebreaker dotsto [Value arguments] }
8990
--watch { cyclebreaker watch [Value arguments] }
9091
--statesavequeriesto { state savequeriesto [Value arguments] }
9192
--fossil { fossil setlocation [Value arguments] }
93
+ --memory-limit { mem::setlimit [Value arguments] }
94
+ --memory-track { mem::track }
9295
default {
9396
Usage $badoption$option\n$gethelp
9497
}
9598
}
9699
}
@@ -249,10 +252,13 @@
249252
namespace import ::vc::fossil::import::cvs::state
250253
namespace import ::vc::fossil::import::cvs::integrity
251254
namespace eval project {
252255
namespace import ::vc::fossil::import::cvs::project::sym
253256
}
257
+ namespace eval mem {
258
+ namespace import ::vc::tools::mem::setlimit
259
+ }
254260
namespace import ::vc::tools::trouble
255261
namespace import ::vc::tools::log
256262
}
257263
}
258264
259265
--- tools/cvs2fossil/lib/c2f_option.tcl
+++ tools/cvs2fossil/lib/c2f_option.tcl
@@ -20,10 +20,11 @@
20
21 package require Tcl 8.4 ; # Required runtime.
22 package require snit ; # OO system.
23 package require vc::tools::trouble ; # Error reporting.
24 package require vc::tools::log ; # User feedback.
 
25 package require vc::tools::misc ; # Misc. path reformatting.
26 package require vc::fossil::import::cvs::fossil ; # Fossil repository access
27 package require vc::fossil::import::cvs::pass ; # Pass management
28 package require vc::fossil::import::cvs::pass::collar ; # Pass I.
29 package require vc::fossil::import::cvs::repository ; # Repository management
@@ -87,10 +88,12 @@
87 --batch { log noprogress }
88 --dots { cyclebreaker dotsto [Value arguments] }
89 --watch { cyclebreaker watch [Value arguments] }
90 --statesavequeriesto { state savequeriesto [Value arguments] }
91 --fossil { fossil setlocation [Value arguments] }
 
 
92 default {
93 Usage $badoption$option\n$gethelp
94 }
95 }
96 }
@@ -249,10 +252,13 @@
249 namespace import ::vc::fossil::import::cvs::state
250 namespace import ::vc::fossil::import::cvs::integrity
251 namespace eval project {
252 namespace import ::vc::fossil::import::cvs::project::sym
253 }
 
 
 
254 namespace import ::vc::tools::trouble
255 namespace import ::vc::tools::log
256 }
257 }
258
259
--- tools/cvs2fossil/lib/c2f_option.tcl
+++ tools/cvs2fossil/lib/c2f_option.tcl
@@ -20,10 +20,11 @@
20
21 package require Tcl 8.4 ; # Required runtime.
22 package require snit ; # OO system.
23 package require vc::tools::trouble ; # Error reporting.
24 package require vc::tools::log ; # User feedback.
25 package require vc::tools::mem ; # Memory tracking.
26 package require vc::tools::misc ; # Misc. path reformatting.
27 package require vc::fossil::import::cvs::fossil ; # Fossil repository access
28 package require vc::fossil::import::cvs::pass ; # Pass management
29 package require vc::fossil::import::cvs::pass::collar ; # Pass I.
30 package require vc::fossil::import::cvs::repository ; # Repository management
@@ -87,10 +88,12 @@
88 --batch { log noprogress }
89 --dots { cyclebreaker dotsto [Value arguments] }
90 --watch { cyclebreaker watch [Value arguments] }
91 --statesavequeriesto { state savequeriesto [Value arguments] }
92 --fossil { fossil setlocation [Value arguments] }
93 --memory-limit { mem::setlimit [Value arguments] }
94 --memory-track { mem::track }
95 default {
96 Usage $badoption$option\n$gethelp
97 }
98 }
99 }
@@ -249,10 +252,13 @@
252 namespace import ::vc::fossil::import::cvs::state
253 namespace import ::vc::fossil::import::cvs::integrity
254 namespace eval project {
255 namespace import ::vc::fossil::import::cvs::project::sym
256 }
257 namespace eval mem {
258 namespace import ::vc::tools::mem::setlimit
259 }
260 namespace import ::vc::tools::trouble
261 namespace import ::vc::tools::log
262 }
263 }
264
265
--- tools/cvs2fossil/lib/log.tcl
+++ tools/cvs2fossil/lib/log.tcl
@@ -13,12 +13,13 @@
1313
## Utility package, basic user feedback
1414
1515
# # ## ### ##### ######## ############# #####################
1616
## Requirements
1717
18
-package require Tcl 8.4 ; # Required runtime
19
-package require snit ; # OO system.
18
+package require Tcl 8.4 ; # Required runtime
19
+package require snit ; # OO system.
20
+package require vc::tools::mem ; # Memory tracking.
2021
2122
# # ## ### ##### ######## ############# #####################
2223
##
2324
2425
snit::type ::vc::tools::log {
@@ -136,11 +137,14 @@
136137
}
137138
138139
# Write handler. Each message is a line.
139140
140141
proc OUT/write {system text} {
141
- puts "$system [join [split $text \n] "\n$system "]"
142
+ set m [mlog]
143
+ regsub -all {[^ ]} $m { } b
144
+ puts "$m$system [join [split $text \n] "\n$b$system "]"
145
+ mlimit
142146
return
143147
}
144148
145149
# Progress handler. Uses \r to return to the beginning of the
146150
# current line without advancing.
@@ -165,12 +169,16 @@
165169
# # ## ### ##### ######## #############
166170
}
167171
168172
namespace eval ::vc::tools {
169173
namespace export log
174
+ namespace eval log {
175
+ namespace import ::vc::tools::mem::mlog
176
+ namespace import ::vc::tools::mem::mlimit
177
+ }
170178
}
171179
172180
# -----------------------------------------------------------------------------
173181
# Ready
174182
175183
package provide vc::tools::log 1.0
176184
return
177185
--- tools/cvs2fossil/lib/log.tcl
+++ tools/cvs2fossil/lib/log.tcl
@@ -13,12 +13,13 @@
13 ## Utility package, basic user feedback
14
15 # # ## ### ##### ######## ############# #####################
16 ## Requirements
17
18 package require Tcl 8.4 ; # Required runtime
19 package require snit ; # OO system.
 
20
21 # # ## ### ##### ######## ############# #####################
22 ##
23
24 snit::type ::vc::tools::log {
@@ -136,11 +137,14 @@
136 }
137
138 # Write handler. Each message is a line.
139
140 proc OUT/write {system text} {
141 puts "$system [join [split $text \n] "\n$system "]"
 
 
 
142 return
143 }
144
145 # Progress handler. Uses \r to return to the beginning of the
146 # current line without advancing.
@@ -165,12 +169,16 @@
165 # # ## ### ##### ######## #############
166 }
167
168 namespace eval ::vc::tools {
169 namespace export log
 
 
 
 
170 }
171
172 # -----------------------------------------------------------------------------
173 # Ready
174
175 package provide vc::tools::log 1.0
176 return
177
--- tools/cvs2fossil/lib/log.tcl
+++ tools/cvs2fossil/lib/log.tcl
@@ -13,12 +13,13 @@
13 ## Utility package, basic user feedback
14
15 # # ## ### ##### ######## ############# #####################
16 ## Requirements
17
18 package require Tcl 8.4 ; # Required runtime
19 package require snit ; # OO system.
20 package require vc::tools::mem ; # Memory tracking.
21
22 # # ## ### ##### ######## ############# #####################
23 ##
24
25 snit::type ::vc::tools::log {
@@ -136,11 +137,14 @@
137 }
138
139 # Write handler. Each message is a line.
140
141 proc OUT/write {system text} {
142 set m [mlog]
143 regsub -all {[^ ]} $m { } b
144 puts "$m$system [join [split $text \n] "\n$b$system "]"
145 mlimit
146 return
147 }
148
149 # Progress handler. Uses \r to return to the beginning of the
150 # current line without advancing.
@@ -165,12 +169,16 @@
169 # # ## ### ##### ######## #############
170 }
171
172 namespace eval ::vc::tools {
173 namespace export log
174 namespace eval log {
175 namespace import ::vc::tools::mem::mlog
176 namespace import ::vc::tools::mem::mlimit
177 }
178 }
179
180 # -----------------------------------------------------------------------------
181 # Ready
182
183 package provide vc::tools::log 1.0
184 return
185

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button