Differences From:
File
tools/cvs2fossil/lib/c2f_repository.tcl
part of check-in
[89e9b357ed]
- Fixed saving of authors, log messages, meta data. This was wrong since revision 99e165d5c4, when the id databases were introduced. Simplified meta saving due to changed trunk coding (no NULL).
by
aku on
2007-10-25 05:16:57.
[view]
To:
File
tools/cvs2fossil/lib/c2f_repository.tcl
part of check-in
[c3d5104084]
- Added code for the loading of pass II data (currently only the smybols) from the state when pass II is skipped.
by
aku on
2007-11-02 04:26:32.
[view]
@@ -139,21 +139,23 @@
return
}
typemethod load {} {
- array set pr {}
state transaction {
foreach {pid name} [state run {
SELECT pid, name FROM project ;
}] {
+ set project [project %AUTO% $name $type]
+
lappend myprojpaths $name
- lappend myprojects [set pr($pid) [project %AUTO% $name $type]]
- $pr($pid) setid $pid
+ lappend myprojects $project
+ set myprojmap($pid) $project
+ $project setid $pid
}
foreach {fid pid name visible exec} [state run {
SELECT fid, pid, name, visible, exec FROM file ;
}] {
- $pr($pid) addfile $name $visible $exec $fid
+ $myprojmap($pid) addfile $name $visible $exec $fid
}
}
return
}
@@ -178,8 +180,40 @@
}
return
}
+ typemethod loadsymbols {} {
+ state transaction {
+ # We load the symbol ids at large to have the mapping
+ # right from the beginning.
+
+ foreach {sid pid name tc bc cc} [state run {
+ SELECT sid, pid, name, tag_count, branch_count, commit_count
+ FROM symbol
+ ;
+ }] {
+ $mysymbol map $sid [list $pid $name]
+ set project $myprojmap($pid)
+
+ set force [$project hassymbol $name]
+ set symbol [$project getsymbol $name]
+
+ # Forcing happens only for the trunks.
+ if {$force} { $symbol forceid $sid }
+
+ # Set the loaded counts.
+ $symbol defcounts $tc $bc $cc
+
+ # Note: The type is neither retrieved nor set, for
+ # this is used to load the pass II data, which means
+ # that everything is 'undefined' at this point anyway.
+
+ # future: $symbol load (blockers, and parents)
+ }
+ }
+ return
+ }
+
# # ## ### ##### ######## #############
## State
typevariable mybase {} ; # Base path to CVS repository.
@@ -186,8 +220,10 @@
typevariable myprojpaths {} ; # List of paths to all declared
# projects, relative to mybase.
typevariable myprojects {} ; # List of objects for all
# declared projects.
+ typevariable myprojmap -array {} ; # Map from project ids to their
+ # objects.
typevariable myauthor {} ; # Names of all authors found,
# maps to their ids.
typevariable mycmsg {} ; # All commit messages found,
# maps to their ids.