Overview
SHA1 Hash: | 3a530ef9473884c08bb9303099f77f9f84af354c |
---|---|
Date: | 2007-11-06 08:05:40 |
User: | aku |
Comment: | Continued work on pass 4. Now propagating the project level information about prefered parents down to the file level tags. Same for the file level branches is not yet done. |
Timelines: | ancestors | descendants | both | trunk |
Other Links: | files | ZIP archive | manifest |
Tags And Properties
- branch=trunk inherited from [a28c83647d]
- sym-trunk inherited from [a28c83647d]
Changes
[hide diffs]Modified tools/cvs2fossil/lib/c2f_pfiltersym.tcl from [b01480659e] to [7a61a65c10].
@@ -71,10 +71,12 @@ state transaction { FilterExcludedSymbols MutateTagsToBranch MutateBranchesToTag + AdjustTagParents + AdjustBranchParents # Consider a rerun of the pass 2 paranoia checks. } log write 1 filtersym "Filtering completed" @@ -194,17 +196,16 @@ # 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 { + foreach {id fid lod sid rev} [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, ''); } @@ -219,23 +220,78 @@ # 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 { + foreach {id fid lod sid root first bra} [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 + } + + # Adjust the parents of symbols to their preferred parents. + + # If a file level ymbol has a preferred parent that is different + # than its current parent, and if the preferred parent is an + # allowed parent of the symbol in this file, then we graft the + # aSymbol onto its preferred parent. + + proc AdjustTagParents {} { + log write 3 filtersym "Adjust tag parents" + + # Find the tags whose current parent (lod) is not the prefered + # parent, the prefered parent is not the trunk, and the + # prefered parent is a possible parent per the tag's file (). + + foreach {id fid lod pid preferedname revnr} [state run { + SELECT T.tid, T.fid, T.lod, P.pid, S.name, R.rev + FROM tag T, preferedparent P, symbol S, revision R + WHERE T.sid = P.sid + AND T.lod != P.pid + AND P.pid = S.sid + AND S.name != ':trunk:' + AND T.rev = R.rid + AND P.pid IN (SELECT B.sid FROM branch B WHERE B.root = R.rid) + }] { + # The names for use in the log output are retrieved + # separately, to keep the join selecting the adjustable + # tags small, not burdened with the dereferencing of links + # to name. + + set tagname [lindex [state run { + SELECT S.name FROM tag T, symbol S WHERE T.sid = S.sid AND T.tid = $id + }] 0] + set oldname [lindex [state run { + SELECT L.name FROM symbol L WHERE L.sid = $lod + }] 0] + struct::list assign [state run { + SELECT F.name, P.name + FROM file F, project P + WHERE F.fid = $fid AND F.pid = P.pid + }] fname prname + + # Do the grafting. + + log write 3 filtersym "$prname : Grafting tag '$tagname' on $fname/$revnr from '$oldname' onto '$preferedname'" + state run { + UPDATE tag SET lod = $pid WHERE tid = $id ; + } + } + return + } + + proc AdjustBranchParents {} { + log write 3 filtersym "Adjust branch parents" return } # # ## ### ##### ######## ############# ## Configuration