Check-in [ffafc0bd65]
Not logged in
Overview

SHA1 Hash:ffafc0bd6541fe2995248374de37293c0dd2a6e4
Date: 2007-11-06 07:14:07
User: aku
Comment: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.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified tools/cvs2fossil/lib/c2f_pfiltersym.tcl from [cdbbe0703f] to [b01480659e].

@@ -69,10 +69,14 @@
 	# The removal of excluded symbols and everything referencing
 	# 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
     }
@@ -86,10 +90,12 @@
 
     # # ## ### ##### ######## #############
     ## 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).
 
 	set excl [project::sym excluded]
@@ -175,10 +181,60 @@
 	    DELETE FROM tag      WHERE sid IN excludedsymbols;
 	    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
     }
 
     # # ## ### ##### ######## #############

Modified tools/cvs2fossil/lib/c2f_psym.tcl from [69d3d4a188] to [e97d1e5410].

@@ -246,10 +246,11 @@
     typevariable mysymtype -array {} ; # Map from type code to label for the log.
 
     typemethod undef    {} { return $myundef    }
     typemethod excluded {} { return $myexcluded }
     typemethod tag      {} { return $mytag      }
+    typemethod branch   {} { return $mybranch   }
 
     typemethod printrulestatistics {} {
 	log write 2 symbol "Rule usage statistics:"
 
 	set fmt %[string length $mynum]s