136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
state transaction {
foreach p [TheProjects] { $p persist }
}
return
}
typemethod load {} {
array set pr {}
state transaction {
foreach {pid name} [state run {
SELECT pid, name FROM project ;
}] {
lappend myprojpaths $name
lappend myprojects [set pr($pid) [project %AUTO% $name $type]]
$pr($pid) 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
}
}
return
}
# pass II results
typemethod printrevstatistics {} {
|
<
>
>
|
>
|
|
|
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
|
state transaction {
foreach p [TheProjects] { $p persist }
}
return
}
typemethod load {} {
state transaction {
foreach {pid name} [state run {
SELECT pid, name FROM project ;
}] {
set project [project %AUTO% $name $type]
lappend myprojpaths $name
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 ;
}] {
$myprojmap($pid) addfile $name $visible $exec $fid
}
}
return
}
# pass II results
typemethod printrevstatistics {} {
|
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
|
# in the projects, as they are referenced by the meta
# tuples)
SaveMeta
foreach p [TheProjects] { $p persistrev }
}
return
}
# # ## ### ##### ######## #############
## State
typevariable mybase {} ; # Base path to CVS repository.
typevariable myprojpaths {} ; # List of paths to all declared
# projects, relative to mybase.
typevariable myprojects {} ; # List of objects for all
# declared projects.
typevariable myauthor {} ; # Names of all authors found,
# maps to their ids.
typevariable mycmsg {} ; # All commit messages found,
# maps to their ids.
typevariable mymeta {} ; # Maps all meta data tuples
# (project, branch, author,
# cmessage) to their ids.
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
|
# in the projects, as they are referenced by the meta
# tuples)
SaveMeta
foreach p [TheProjects] { $p persistrev }
}
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.
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.
typevariable mymeta {} ; # Maps all meta data tuples
# (project, branch, author,
# cmessage) to their ids.
|