Differences From:
File
tools/cvs2fossil/lib/c2f_pfiltersym.tcl
part of check-in
[69bf6ab99b]
- Continued work on pass 4. Implemented the deletion of excluded symbols and all parts referencing them. The complex part is the regrafting of NTDB revisions should a NTDB branch be excluded. This is like 'GraftNTDB2Trunk' in 'file' when excluding everything but the trunk.
by
aku on
2007-11-06 06:47:26.
[view]
To:
File
tools/cvs2fossil/lib/c2f_pfiltersym.tcl
part of check-in
[ffafc0bd65]
- 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.
by
aku on
2007-11-06 07:14:07.
[view]
@@ -70,8 +70,12 @@
# to them is done completely in the database.
state transaction {
FilterExcludedSymbols
+ MutateTagsToBranch
+ MutateBranchesToTag
+
+ # Consider a rerun of the pass 2 paranoia checks.
}
log write 1 filtersym "Filtering completed"
return
@@ -87,8 +91,10 @@
# # ## ### ##### ######## #############
## Internal methods
proc FilterExcludedSymbols {} {
+ log write 3 filtersym "Filter out excluded symbols and users"
+
# We pull all the excluded symbols together into a table for
# easy reference by the upcoming DELETE and other statements.
# ('x IN table' clauses).
@@ -176,8 +182,58 @@
DELETE FROM branch WHERE lod IN excludedsymbols;
DELETE FROM branch WHERE sid IN excludedsymbols;
DROP TABLE excludedsymbols;
+ }
+ return
+ }
+
+ proc MutateTagsToBranch {} {
+ log write 3 filtersym "Mutate tags to branches"
+
+ # Next, now that we know which symbols are what we look for
+ # file level tags which are actually converted as branches
+ # (project level), and put them into the correct table.
+
+ set branch [project::sym branch]
+
+ set tagstomutate [state run {
+ SELECT T.tid, T.fid, T.lod, T.sid, T.rev
+ FROM tag T, symbol S
+ WHERE T.sid = S.sid
+ AND S.type = $branch
+ }]
+ foreach {id fid lod sid rev} $tagstomutate {
+ state run {
+ DELETE FROM tag WHERE tid = $id ;
+ INSERT INTO branch (bid, fid, lod, sid, root, first, bra)
+ VALUES ($id, $fid, $lod, $sid, $rev, NULL, '');
+ }
+ }
+ return
+ }
+
+ proc MutateBranchesToTag {} {
+ log write 3 filtersym "Mutate branches to tags"
+
+ # Next, now that we know which symbols are what we look for
+ # file level branches which are actually converted as tags
+ # (project level), and put them into the correct table.
+
+ set tag [project::sym tag]
+
+ set branchestomutate [state run {
+ SELECT B.bid, B.fid, B.lod, B.sid, B.root, B.first, B.bra
+ FROM branch B, symbol S
+ WHERE B.sid = S.sid
+ AND S.type = $tag
+ }]
+ foreach {id fid lod sid root first bra} $branchestomutate {
+ state run {
+ DELETE FROM branch WHERE bid = $id ;
+ INSERT INTO tag (tid, fid, lod, sid, rev)
+ VALUES ($id, $fid, $lod, $sid, $root);
+ }
}
return
}