Fossil SCM

Continued work on pass 4. Added code bringing the file level symbol data into compliance with the project level symbol types, converting tags to branches and vice versa.

aku 2007-11-06 07:14 trunk
Commit ffafc0bd6541fe2995248374de37293c0dd2a6e4
--- tools/cvs2fossil/lib/c2f_pfiltersym.tcl
+++ tools/cvs2fossil/lib/c2f_pfiltersym.tcl
@@ -69,10 +69,14 @@
6969
# The removal of excluded symbols and everything referencing
7070
# to them is done completely in the database.
7171
7272
state transaction {
7373
FilterExcludedSymbols
74
+ MutateTagsToBranch
75
+ MutateBranchesToTag
76
+
77
+ # Consider a rerun of the pass 2 paranoia checks.
7478
}
7579
7680
log write 1 filtersym "Filtering completed"
7781
return
7882
}
@@ -86,10 +90,12 @@
8690
8791
# # ## ### ##### ######## #############
8892
## Internal methods
8993
9094
proc FilterExcludedSymbols {} {
95
+ log write 3 filtersym "Filter out excluded symbols and users"
96
+
9197
# We pull all the excluded symbols together into a table for
9298
# easy reference by the upcoming DELETE and other statements.
9399
# ('x IN table' clauses).
94100
95101
set excl [project::sym excluded]
@@ -175,10 +181,60 @@
175181
DELETE FROM tag WHERE sid IN excludedsymbols;
176182
DELETE FROM branch WHERE lod IN excludedsymbols;
177183
DELETE FROM branch WHERE sid IN excludedsymbols;
178184
179185
DROP TABLE excludedsymbols;
186
+ }
187
+ return
188
+ }
189
+
190
+ proc MutateTagsToBranch {} {
191
+ log write 3 filtersym "Mutate tags to branches"
192
+
193
+ # Next, now that we know which symbols are what we look for
194
+ # file level tags which are actually converted as branches
195
+ # (project level), and put them into the correct table.
196
+
197
+ set branch [project::sym branch]
198
+
199
+ set tagstomutate [state run {
200
+ SELECT T.tid, T.fid, T.lod, T.sid, T.rev
201
+ FROM tag T, symbol S
202
+ WHERE T.sid = S.sid
203
+ AND S.type = $branch
204
+ }]
205
+ foreach {id fid lod sid rev} $tagstomutate {
206
+ state run {
207
+ DELETE FROM tag WHERE tid = $id ;
208
+ INSERT INTO branch (bid, fid, lod, sid, root, first, bra)
209
+ VALUES ($id, $fid, $lod, $sid, $rev, NULL, '');
210
+ }
211
+ }
212
+ return
213
+ }
214
+
215
+ proc MutateBranchesToTag {} {
216
+ log write 3 filtersym "Mutate branches to tags"
217
+
218
+ # Next, now that we know which symbols are what we look for
219
+ # file level branches which are actually converted as tags
220
+ # (project level), and put them into the correct table.
221
+
222
+ set tag [project::sym tag]
223
+
224
+ set branchestomutate [state run {
225
+ SELECT B.bid, B.fid, B.lod, B.sid, B.root, B.first, B.bra
226
+ FROM branch B, symbol S
227
+ WHERE B.sid = S.sid
228
+ AND S.type = $tag
229
+ }]
230
+ foreach {id fid lod sid root first bra} $branchestomutate {
231
+ state run {
232
+ DELETE FROM branch WHERE bid = $id ;
233
+ INSERT INTO tag (tid, fid, lod, sid, rev)
234
+ VALUES ($id, $fid, $lod, $sid, $root);
235
+ }
180236
}
181237
return
182238
}
183239
184240
# # ## ### ##### ######## #############
185241
--- tools/cvs2fossil/lib/c2f_pfiltersym.tcl
+++ tools/cvs2fossil/lib/c2f_pfiltersym.tcl
@@ -69,10 +69,14 @@
69 # The removal of excluded symbols and everything referencing
70 # to them is done completely in the database.
71
72 state transaction {
73 FilterExcludedSymbols
 
 
 
 
74 }
75
76 log write 1 filtersym "Filtering completed"
77 return
78 }
@@ -86,10 +90,12 @@
86
87 # # ## ### ##### ######## #############
88 ## Internal methods
89
90 proc FilterExcludedSymbols {} {
 
 
91 # We pull all the excluded symbols together into a table for
92 # easy reference by the upcoming DELETE and other statements.
93 # ('x IN table' clauses).
94
95 set excl [project::sym excluded]
@@ -175,10 +181,60 @@
175 DELETE FROM tag WHERE sid IN excludedsymbols;
176 DELETE FROM branch WHERE lod IN excludedsymbols;
177 DELETE FROM branch WHERE sid IN excludedsymbols;
178
179 DROP TABLE excludedsymbols;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180 }
181 return
182 }
183
184 # # ## ### ##### ######## #############
185
--- tools/cvs2fossil/lib/c2f_pfiltersym.tcl
+++ tools/cvs2fossil/lib/c2f_pfiltersym.tcl
@@ -69,10 +69,14 @@
69 # The removal of excluded symbols and everything referencing
70 # to them is done completely in the database.
71
72 state transaction {
73 FilterExcludedSymbols
74 MutateTagsToBranch
75 MutateBranchesToTag
76
77 # Consider a rerun of the pass 2 paranoia checks.
78 }
79
80 log write 1 filtersym "Filtering completed"
81 return
82 }
@@ -86,10 +90,12 @@
90
91 # # ## ### ##### ######## #############
92 ## Internal methods
93
94 proc FilterExcludedSymbols {} {
95 log write 3 filtersym "Filter out excluded symbols and users"
96
97 # We pull all the excluded symbols together into a table for
98 # easy reference by the upcoming DELETE and other statements.
99 # ('x IN table' clauses).
100
101 set excl [project::sym excluded]
@@ -175,10 +181,60 @@
181 DELETE FROM tag WHERE sid IN excludedsymbols;
182 DELETE FROM branch WHERE lod IN excludedsymbols;
183 DELETE FROM branch WHERE sid IN excludedsymbols;
184
185 DROP TABLE excludedsymbols;
186 }
187 return
188 }
189
190 proc MutateTagsToBranch {} {
191 log write 3 filtersym "Mutate tags to branches"
192
193 # Next, now that we know which symbols are what we look for
194 # file level tags which are actually converted as branches
195 # (project level), and put them into the correct table.
196
197 set branch [project::sym branch]
198
199 set tagstomutate [state run {
200 SELECT T.tid, T.fid, T.lod, T.sid, T.rev
201 FROM tag T, symbol S
202 WHERE T.sid = S.sid
203 AND S.type = $branch
204 }]
205 foreach {id fid lod sid rev} $tagstomutate {
206 state run {
207 DELETE FROM tag WHERE tid = $id ;
208 INSERT INTO branch (bid, fid, lod, sid, root, first, bra)
209 VALUES ($id, $fid, $lod, $sid, $rev, NULL, '');
210 }
211 }
212 return
213 }
214
215 proc MutateBranchesToTag {} {
216 log write 3 filtersym "Mutate branches to tags"
217
218 # Next, now that we know which symbols are what we look for
219 # file level branches which are actually converted as tags
220 # (project level), and put them into the correct table.
221
222 set tag [project::sym tag]
223
224 set branchestomutate [state run {
225 SELECT B.bid, B.fid, B.lod, B.sid, B.root, B.first, B.bra
226 FROM branch B, symbol S
227 WHERE B.sid = S.sid
228 AND S.type = $tag
229 }]
230 foreach {id fid lod sid root first bra} $branchestomutate {
231 state run {
232 DELETE FROM branch WHERE bid = $id ;
233 INSERT INTO tag (tid, fid, lod, sid, rev)
234 VALUES ($id, $fid, $lod, $sid, $root);
235 }
236 }
237 return
238 }
239
240 # # ## ### ##### ######## #############
241
--- tools/cvs2fossil/lib/c2f_psym.tcl
+++ tools/cvs2fossil/lib/c2f_psym.tcl
@@ -246,10 +246,11 @@
246246
typevariable mysymtype -array {} ; # Map from type code to label for the log.
247247
248248
typemethod undef {} { return $myundef }
249249
typemethod excluded {} { return $myexcluded }
250250
typemethod tag {} { return $mytag }
251
+ typemethod branch {} { return $mybranch }
251252
252253
typemethod printrulestatistics {} {
253254
log write 2 symbol "Rule usage statistics:"
254255
255256
set fmt %[string length $mynum]s
256257
--- tools/cvs2fossil/lib/c2f_psym.tcl
+++ tools/cvs2fossil/lib/c2f_psym.tcl
@@ -246,10 +246,11 @@
246 typevariable mysymtype -array {} ; # Map from type code to label for the log.
247
248 typemethod undef {} { return $myundef }
249 typemethod excluded {} { return $myexcluded }
250 typemethod tag {} { return $mytag }
 
251
252 typemethod printrulestatistics {} {
253 log write 2 symbol "Rule usage statistics:"
254
255 set fmt %[string length $mynum]s
256
--- tools/cvs2fossil/lib/c2f_psym.tcl
+++ tools/cvs2fossil/lib/c2f_psym.tcl
@@ -246,10 +246,11 @@
246 typevariable mysymtype -array {} ; # Map from type code to label for the log.
247
248 typemethod undef {} { return $myundef }
249 typemethod excluded {} { return $myexcluded }
250 typemethod tag {} { return $mytag }
251 typemethod branch {} { return $mybranch }
252
253 typemethod printrulestatistics {} {
254 log write 2 symbol "Rule usage statistics:"
255
256 set fmt %[string length $mynum]s
257

Keyboard Shortcuts

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