Fossil SCM

Extended pass manager to handle the skipped and defered passes coming before and after the actually executed passes. Extended passes I and II to have the required methods. Implemented loading (for skipped passes) as skeletons, implemented discarding (for defered passes) completely. Extended state manager with ability to discard state.

aku 2007-10-13 23:29 trunk
Commit ae19c0fcb4c72ed82a4bb6354cbbbced11aeed74
--- tools/cvs2fossil/lib/c2f_pass.tcl
+++ tools/cvs2fossil/lib/c2f_pass.tcl
@@ -95,27 +95,38 @@
9595
}
9696
}
9797
9898
typemethod run {} {
9999
if {$mystart < 0} {set mystart 0}
100
- if {$myend < 0} {set myend end}
100
+ if {$myend < 0} {set myend [expr {[llength $mypasses] - 1}]}
101101
102
- set runlist [lrange $mypasses $mystart $myend]
103102
# TODO: Timing statistics for the passes.
104103
# TODO: Artifact manager (clean after pass?. need to know skipped/defered passes ?)
105104
# TODO:
106105
# TODO:
107106
108
- foreach p $runlist {
107
+ set skipped [lrange $mypasses 0 [expr {$mystart - 1}]]
108
+ set run [lrange $mypasses $mystart $myend]
109
+ set defered [lrange $mypasses [expr {$myend + 1}] end]
110
+
111
+ foreach p $skipped {
112
+ log write 0 pass "Skip $p"
113
+ Call $p load
114
+ }
115
+ foreach p $run {
109116
log write 0 pass "Setup $p"
110117
Call $p setup
111118
}
112
- foreach p $runlist {
119
+ foreach p $run {
113120
log write 0 pass "Begin $p"
114121
Call $p run
115122
log write 0 pass "Done $p"
116123
trouble abort?
124
+ }
125
+ foreach p $defered {
126
+ log write 0 pass "Defer $p"
127
+ Call $p discard
117128
}
118129
119130
state release
120131
return
121132
}
122133
--- tools/cvs2fossil/lib/c2f_pass.tcl
+++ tools/cvs2fossil/lib/c2f_pass.tcl
@@ -95,27 +95,38 @@
95 }
96 }
97
98 typemethod run {} {
99 if {$mystart < 0} {set mystart 0}
100 if {$myend < 0} {set myend end}
101
102 set runlist [lrange $mypasses $mystart $myend]
103 # TODO: Timing statistics for the passes.
104 # TODO: Artifact manager (clean after pass?. need to know skipped/defered passes ?)
105 # TODO:
106 # TODO:
107
108 foreach p $runlist {
 
 
 
 
 
 
 
 
109 log write 0 pass "Setup $p"
110 Call $p setup
111 }
112 foreach p $runlist {
113 log write 0 pass "Begin $p"
114 Call $p run
115 log write 0 pass "Done $p"
116 trouble abort?
 
 
 
 
117 }
118
119 state release
120 return
121 }
122
--- tools/cvs2fossil/lib/c2f_pass.tcl
+++ tools/cvs2fossil/lib/c2f_pass.tcl
@@ -95,27 +95,38 @@
95 }
96 }
97
98 typemethod run {} {
99 if {$mystart < 0} {set mystart 0}
100 if {$myend < 0} {set myend [expr {[llength $mypasses] - 1}]}
101
 
102 # TODO: Timing statistics for the passes.
103 # TODO: Artifact manager (clean after pass?. need to know skipped/defered passes ?)
104 # TODO:
105 # TODO:
106
107 set skipped [lrange $mypasses 0 [expr {$mystart - 1}]]
108 set run [lrange $mypasses $mystart $myend]
109 set defered [lrange $mypasses [expr {$myend + 1}] end]
110
111 foreach p $skipped {
112 log write 0 pass "Skip $p"
113 Call $p load
114 }
115 foreach p $run {
116 log write 0 pass "Setup $p"
117 Call $p setup
118 }
119 foreach p $run {
120 log write 0 pass "Begin $p"
121 Call $p run
122 log write 0 pass "Done $p"
123 trouble abort?
124 }
125 foreach p $defered {
126 log write 0 pass "Defer $p"
127 Call $p discard
128 }
129
130 state release
131 return
132 }
133
--- tools/cvs2fossil/lib/c2f_pcollar.tcl
+++ tools/cvs2fossil/lib/c2f_pcollar.tcl
@@ -77,12 +77,25 @@
7777
exec INTEGER NOT NULL, -- boolean, 'file executable'.
7878
UNIQUE (pid, name) -- file names are unique within a project
7979
}
8080
return
8181
}
82
+
83
+ typemethod load {} {
84
+ # Pass manager interface. Executed for all passes before the
85
+ # run passes, to load all data of their pass from the state,
86
+ # as if it had been computed by the pass itself.
87
+
88
+ state reading project
89
+ state reading file
90
+ return
91
+ }
8292
8393
typemethod run {} {
94
+ # Pass manager interface. Executed to perform the
95
+ # functionality of the pass.
96
+
8497
set rbase [repository base?]
8598
foreach project [repository projects] {
8699
set base [file join $rbase [$project base]]
87100
log write 1 collar "Scan $base"
88101
@@ -126,10 +139,20 @@
126139
repository persist
127140
128141
log write 1 collar "Scan completed"
129142
return
130143
}
144
+
145
+ typemethod discard {} {
146
+ # Pass manager interface. Executed for all passes after the
147
+ # run passes, to remove all data of this pass from the state,
148
+ # as being out of date.
149
+
150
+ state discard project
151
+ state discard file
152
+ return
153
+ }
131154
132155
typemethod ignore_conflicting_attics {} {
133156
set myignore 1
134157
return
135158
}
136159
--- tools/cvs2fossil/lib/c2f_pcollar.tcl
+++ tools/cvs2fossil/lib/c2f_pcollar.tcl
@@ -77,12 +77,25 @@
77 exec INTEGER NOT NULL, -- boolean, 'file executable'.
78 UNIQUE (pid, name) -- file names are unique within a project
79 }
80 return
81 }
 
 
 
 
 
 
 
 
 
 
82
83 typemethod run {} {
 
 
 
84 set rbase [repository base?]
85 foreach project [repository projects] {
86 set base [file join $rbase [$project base]]
87 log write 1 collar "Scan $base"
88
@@ -126,10 +139,20 @@
126 repository persist
127
128 log write 1 collar "Scan completed"
129 return
130 }
 
 
 
 
 
 
 
 
 
 
131
132 typemethod ignore_conflicting_attics {} {
133 set myignore 1
134 return
135 }
136
--- tools/cvs2fossil/lib/c2f_pcollar.tcl
+++ tools/cvs2fossil/lib/c2f_pcollar.tcl
@@ -77,12 +77,25 @@
77 exec INTEGER NOT NULL, -- boolean, 'file executable'.
78 UNIQUE (pid, name) -- file names are unique within a project
79 }
80 return
81 }
82
83 typemethod load {} {
84 # Pass manager interface. Executed for all passes before the
85 # run passes, to load all data of their pass from the state,
86 # as if it had been computed by the pass itself.
87
88 state reading project
89 state reading file
90 return
91 }
92
93 typemethod run {} {
94 # Pass manager interface. Executed to perform the
95 # functionality of the pass.
96
97 set rbase [repository base?]
98 foreach project [repository projects] {
99 set base [file join $rbase [$project base]]
100 log write 1 collar "Scan $base"
101
@@ -126,10 +139,20 @@
139 repository persist
140
141 log write 1 collar "Scan completed"
142 return
143 }
144
145 typemethod discard {} {
146 # Pass manager interface. Executed for all passes after the
147 # run passes, to remove all data of this pass from the state,
148 # as being out of date.
149
150 state discard project
151 state discard file
152 return
153 }
154
155 typemethod ignore_conflicting_attics {} {
156 set myignore 1
157 return
158 }
159
--- tools/cvs2fossil/lib/c2f_pcollrev.tcl
+++ tools/cvs2fossil/lib/c2f_pcollrev.tcl
@@ -180,12 +180,20 @@
180180
# other. I.e. items may not refer to items or symbols which
181181
# belong to a different project than their own.
182182
183183
return
184184
}
185
+
186
+ typemethod load {} {
187
+ # TODO
188
+ return
189
+ }
185190
186191
typemethod run {} {
192
+ # Pass manager interface. Executed to perform the
193
+ # functionality of the pass.
194
+
187195
set rbase [repository base?]
188196
foreach project [repository projects] {
189197
set base [file join $rbase [$project base]]
190198
log write 1 collrev "Processing $base"
191199
@@ -210,10 +218,29 @@
210218
repository persistrev
211219
212220
log write 1 collrev "Scan completed"
213221
return
214222
}
223
+
224
+ typemethod discard {} {
225
+ # Pass manager interface. Executed for all passes after the
226
+ # run passes, to remove all data of this pass from the state,
227
+ # as being out of date.
228
+
229
+ state discard rcs
230
+ state discard item
231
+ state discard revision
232
+ state discard tag
233
+ state discard branch
234
+ state discard symbol
235
+ state discard blocker
236
+ state discard parent
237
+ state discard meta
238
+ state discard author
239
+ state discard cmessage
240
+ return
241
+ }
215242
216243
# # ## ### ##### ######## #############
217244
## Internal methods
218245
219246
# # ## ### ##### ######## #############
220247
--- tools/cvs2fossil/lib/c2f_pcollrev.tcl
+++ tools/cvs2fossil/lib/c2f_pcollrev.tcl
@@ -180,12 +180,20 @@
180 # other. I.e. items may not refer to items or symbols which
181 # belong to a different project than their own.
182
183 return
184 }
 
 
 
 
 
185
186 typemethod run {} {
 
 
 
187 set rbase [repository base?]
188 foreach project [repository projects] {
189 set base [file join $rbase [$project base]]
190 log write 1 collrev "Processing $base"
191
@@ -210,10 +218,29 @@
210 repository persistrev
211
212 log write 1 collrev "Scan completed"
213 return
214 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
215
216 # # ## ### ##### ######## #############
217 ## Internal methods
218
219 # # ## ### ##### ######## #############
220
--- tools/cvs2fossil/lib/c2f_pcollrev.tcl
+++ tools/cvs2fossil/lib/c2f_pcollrev.tcl
@@ -180,12 +180,20 @@
180 # other. I.e. items may not refer to items or symbols which
181 # belong to a different project than their own.
182
183 return
184 }
185
186 typemethod load {} {
187 # TODO
188 return
189 }
190
191 typemethod run {} {
192 # Pass manager interface. Executed to perform the
193 # functionality of the pass.
194
195 set rbase [repository base?]
196 foreach project [repository projects] {
197 set base [file join $rbase [$project base]]
198 log write 1 collrev "Processing $base"
199
@@ -210,10 +218,29 @@
218 repository persistrev
219
220 log write 1 collrev "Scan completed"
221 return
222 }
223
224 typemethod discard {} {
225 # Pass manager interface. Executed for all passes after the
226 # run passes, to remove all data of this pass from the state,
227 # as being out of date.
228
229 state discard rcs
230 state discard item
231 state discard revision
232 state discard tag
233 state discard branch
234 state discard symbol
235 state discard blocker
236 state discard parent
237 state discard meta
238 state discard author
239 state discard cmessage
240 return
241 }
242
243 # # ## ### ##### ######## #############
244 ## Internal methods
245
246 # # ## ### ##### ######## #############
247
--- tools/cvs2fossil/lib/c2f_state.tcl
+++ tools/cvs2fossil/lib/c2f_state.tcl
@@ -126,10 +126,22 @@
126126
127127
if {$found} return
128128
129129
trouble internal "The required table \"$name\" is not defined."
130130
# Not reached
131
+ return
132
+ }
133
+
134
+ typemethod discard {name} {
135
+ # Method for a user to remove outdated information from the
136
+ # persistent state, table by table.
137
+
138
+ log write 0 state "discard $name" ; # TODO move to level 5 or so
139
+
140
+ $mystate transaction {
141
+ catch { $mystate eval "DROP TABLE $name" }
142
+ }
131143
return
132144
}
133145
134146
typemethod run {args} {
135147
return [uplevel 1 [linsert $args 0 $mystate eval]]
136148
--- tools/cvs2fossil/lib/c2f_state.tcl
+++ tools/cvs2fossil/lib/c2f_state.tcl
@@ -126,10 +126,22 @@
126
127 if {$found} return
128
129 trouble internal "The required table \"$name\" is not defined."
130 # Not reached
 
 
 
 
 
 
 
 
 
 
 
 
131 return
132 }
133
134 typemethod run {args} {
135 return [uplevel 1 [linsert $args 0 $mystate eval]]
136
--- tools/cvs2fossil/lib/c2f_state.tcl
+++ tools/cvs2fossil/lib/c2f_state.tcl
@@ -126,10 +126,22 @@
126
127 if {$found} return
128
129 trouble internal "The required table \"$name\" is not defined."
130 # Not reached
131 return
132 }
133
134 typemethod discard {name} {
135 # Method for a user to remove outdated information from the
136 # persistent state, table by table.
137
138 log write 0 state "discard $name" ; # TODO move to level 5 or so
139
140 $mystate transaction {
141 catch { $mystate eval "DROP TABLE $name" }
142 }
143 return
144 }
145
146 typemethod run {args} {
147 return [uplevel 1 [linsert $args 0 $mystate eval]]
148

Keyboard Shortcuts

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