Fossil SCM

Completed loading of pass I from persistent state when skipped.

aku 2007-10-13 23:57 trunk
Commit 54ac684df7feaa0ab5e0945386faa453b707968a
--- tools/cvs2fossil/lib/c2f_pcollar.tcl
+++ tools/cvs2fossil/lib/c2f_pcollar.tcl
@@ -85,10 +85,12 @@
8585
# run passes, to load all data of their pass from the state,
8686
# as if it had been computed by the pass itself.
8787
8888
state reading project
8989
state reading file
90
+
91
+ repository load
9092
return
9193
}
9294
9395
typemethod run {} {
9496
# Pass manager interface. Executed to perform the
9597
--- tools/cvs2fossil/lib/c2f_pcollar.tcl
+++ tools/cvs2fossil/lib/c2f_pcollar.tcl
@@ -85,10 +85,12 @@
85 # run passes, to load all data of their pass from the state,
86 # as if it had been computed by the pass itself.
87
88 state reading project
89 state reading file
 
 
90 return
91 }
92
93 typemethod run {} {
94 # Pass manager interface. Executed to perform the
95
--- tools/cvs2fossil/lib/c2f_pcollar.tcl
+++ tools/cvs2fossil/lib/c2f_pcollar.tcl
@@ -85,10 +85,12 @@
85 # run passes, to load all data of their pass from the state,
86 # as if it had been computed by the pass itself.
87
88 state reading project
89 state reading file
90
91 repository load
92 return
93 }
94
95 typemethod run {} {
96 # Pass manager interface. Executed to perform the
97
--- tools/cvs2fossil/lib/c2f_project.tcl
+++ tools/cvs2fossil/lib/c2f_project.tcl
@@ -50,11 +50,10 @@
5050
method filenames {} {
5151
return [lsort -dict [array names myfiles]]
5252
}
5353
5454
method files {} {
55
- # TODO: Loading from state
5655
return [TheFiles]
5756
}
5857
5958
delegate method author to myrepository
6059
delegate method cmessage to myrepository
6160
--- tools/cvs2fossil/lib/c2f_project.tcl
+++ tools/cvs2fossil/lib/c2f_project.tcl
@@ -50,11 +50,10 @@
50 method filenames {} {
51 return [lsort -dict [array names myfiles]]
52 }
53
54 method files {} {
55 # TODO: Loading from state
56 return [TheFiles]
57 }
58
59 delegate method author to myrepository
60 delegate method cmessage to myrepository
61
--- tools/cvs2fossil/lib/c2f_project.tcl
+++ tools/cvs2fossil/lib/c2f_project.tcl
@@ -50,11 +50,10 @@
50 method filenames {} {
51 return [lsort -dict [array names myfiles]]
52 }
53
54 method files {} {
 
55 return [TheFiles]
56 }
57
58 delegate method author to myrepository
59 delegate method cmessage to myrepository
60
--- tools/cvs2fossil/lib/c2f_repository.tcl
+++ tools/cvs2fossil/lib/c2f_repository.tcl
@@ -50,13 +50,10 @@
5050
lappend myprojpaths $path
5151
return
5252
}
5353
5454
typemethod projects {} {
55
- # TODO: Loading from the state database if CollAr is skipped
56
- # in a run.
57
-
5855
return [TheProjects]
5956
}
6057
6158
typemethod base? {} { return $mybase }
6259
@@ -135,10 +132,28 @@
135132
state transaction {
136133
foreach p [TheProjects] { $p persist }
137134
}
138135
return
139136
}
137
+
138
+ typemethod load {} {
139
+ array set pr {}
140
+ state transaction {
141
+ foreach {pid name} [state run {
142
+ SELECT pid, name FROM project ;
143
+ }] {
144
+ lappend myprojpaths $name
145
+ lappend myprojects [set pr($pid) [project %AUTO% $name $type]]
146
+ }
147
+ foreach {fid pid name visible exec} [state run {
148
+ SELECT fid, pid, name, visible, exec FROM file ;
149
+ }] {
150
+ $pr($pid) addfile $name $visible $exec
151
+ }
152
+ }
153
+ return
154
+ }
140155
141156
# pass II results
142157
typemethod printrevstatistics {} {
143158
log write 2 repository "Scanned ..."
144159
# number of revisions, symbols, repository wide, per project ...
@@ -198,11 +213,10 @@
198213
199214
proc TheProjects {} {
200215
upvar 1 type type
201216
::variable myprojects
202217
::variable myprojpaths
203
- ::variable mybase
204218
205219
if {![llength $myprojects]} {
206220
set myprojects [EmptyProjects $myprojpaths]
207221
}
208222
return $myprojects
209223
--- tools/cvs2fossil/lib/c2f_repository.tcl
+++ tools/cvs2fossil/lib/c2f_repository.tcl
@@ -50,13 +50,10 @@
50 lappend myprojpaths $path
51 return
52 }
53
54 typemethod projects {} {
55 # TODO: Loading from the state database if CollAr is skipped
56 # in a run.
57
58 return [TheProjects]
59 }
60
61 typemethod base? {} { return $mybase }
62
@@ -135,10 +132,28 @@
135 state transaction {
136 foreach p [TheProjects] { $p persist }
137 }
138 return
139 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
141 # pass II results
142 typemethod printrevstatistics {} {
143 log write 2 repository "Scanned ..."
144 # number of revisions, symbols, repository wide, per project ...
@@ -198,11 +213,10 @@
198
199 proc TheProjects {} {
200 upvar 1 type type
201 ::variable myprojects
202 ::variable myprojpaths
203 ::variable mybase
204
205 if {![llength $myprojects]} {
206 set myprojects [EmptyProjects $myprojpaths]
207 }
208 return $myprojects
209
--- tools/cvs2fossil/lib/c2f_repository.tcl
+++ tools/cvs2fossil/lib/c2f_repository.tcl
@@ -50,13 +50,10 @@
50 lappend myprojpaths $path
51 return
52 }
53
54 typemethod projects {} {
 
 
 
55 return [TheProjects]
56 }
57
58 typemethod base? {} { return $mybase }
59
@@ -135,10 +132,28 @@
132 state transaction {
133 foreach p [TheProjects] { $p persist }
134 }
135 return
136 }
137
138 typemethod load {} {
139 array set pr {}
140 state transaction {
141 foreach {pid name} [state run {
142 SELECT pid, name FROM project ;
143 }] {
144 lappend myprojpaths $name
145 lappend myprojects [set pr($pid) [project %AUTO% $name $type]]
146 }
147 foreach {fid pid name visible exec} [state run {
148 SELECT fid, pid, name, visible, exec FROM file ;
149 }] {
150 $pr($pid) addfile $name $visible $exec
151 }
152 }
153 return
154 }
155
156 # pass II results
157 typemethod printrevstatistics {} {
158 log write 2 repository "Scanned ..."
159 # number of revisions, symbols, repository wide, per project ...
@@ -198,11 +213,10 @@
213
214 proc TheProjects {} {
215 upvar 1 type type
216 ::variable myprojects
217 ::variable myprojpaths
 
218
219 if {![llength $myprojects]} {
220 set myprojects [EmptyProjects $myprojpaths]
221 }
222 return $myprojects
223

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button