Fossil SCM

Fix in pass 3, do not compute prefered parents for the excluded symbols. Exclude them from the final check as well due to this.

aku 2007-11-06 04:53 trunk
Commit 4c8a5a44afb8f45d5e0740efe09ffac647aac950
--- tools/cvs2fossil/lib/c2f_pcollsym.tcl
+++ tools/cvs2fossil/lib/c2f_pcollsym.tcl
@@ -60,11 +60,16 @@
6060
}
6161
return
6262
}
6363
6464
typemethod load {} {
65
- # TODO
65
+ # Pass manager interface. Executed to load data computed by
66
+ # this pass into memory when this pass is skipped instead of
67
+ # executed.
68
+
69
+ # The results of this pass are fully in the persistent state,
70
+ # there is nothing to load.
6671
return
6772
}
6873
6974
typemethod run {} {
7075
# Pass manager interface. Executed to perform the
@@ -202,22 +207,28 @@
202207
return
203208
}
204209
205210
proc DeterminePreferedParents {} {
206211
array set prefered {}
212
+
213
+ set excl [project::sym excluded]
207214
208215
# Phase I: Pull the possible parents, using sorting to put the
209216
# prefered parent of each symbol last among all
210217
# candidates, allowing us get the prefered one by
211
- # each candidate overwriting all previous selections.
218
+ # each candidate overwriting all previous
219
+ # selections. Note that we ignore excluded symbol, we
220
+ # do not care about their prefered parents and do not
221
+ # attempt to compute them.
212222
213223
foreach {s p sname pname prname} [state run {
214224
SELECT S.sid, P.pid, S.name, SB.name, PR.name
215225
FROM symbol S, parent P, symbol SB, project PR
216226
WHERE S.sid = P.sid
217227
AND P.pid = SB.sid
218228
AND S.pid = PR.pid
229
+ AND S.type != $excl
219230
ORDER BY P.n ASC, P.pid DESC
220231
-- Higher votes and smaller ids (= earlier branches) last
221232
-- We simply keep the last possible parent for each
222233
-- symbol. This parent will have the max number of votes
223234
-- for its symbol and will be the earliest created branch
@@ -238,21 +249,24 @@
238249
239250
log write 3 pcollsym "$prname : '$sname's prefered parent is '$pname'"
240251
}
241252
242253
# Phase III: Check the result that all symbols except for
243
- # trunks have a prefered parent.
254
+ # trunks have a prefered parent. We also ignore
255
+ # excluded symbols, as we intentionally did not
256
+ # compute a prefered parent for them, see phase I.
244257
245258
foreach {pname sname} [state run {
246
- SELECT S.name, PR.name
259
+ SELECT PR.name, S.name
247260
FROM project PR, symbol S LEFT OUTER JOIN preferedparent P
248261
ON S.sid = P.sid
249262
WHERE P.pid IS NULL
250263
AND S.name != ':trunk:'
251264
AND S.pid = PR.pid
265
+ AND S.type != $excl
252266
}] {
253
- trouble fatal "$prname : '$sname' has no prefered parent."
267
+ trouble fatal "$pname : '$sname' has no prefered parent."
254268
}
255269
256270
# The reverse, having prefered parents for unknown symbols
257271
# cannot occur.
258272
return
259273
--- tools/cvs2fossil/lib/c2f_pcollsym.tcl
+++ tools/cvs2fossil/lib/c2f_pcollsym.tcl
@@ -60,11 +60,16 @@
60 }
61 return
62 }
63
64 typemethod load {} {
65 # TODO
 
 
 
 
 
66 return
67 }
68
69 typemethod run {} {
70 # Pass manager interface. Executed to perform the
@@ -202,22 +207,28 @@
202 return
203 }
204
205 proc DeterminePreferedParents {} {
206 array set prefered {}
 
 
207
208 # Phase I: Pull the possible parents, using sorting to put the
209 # prefered parent of each symbol last among all
210 # candidates, allowing us get the prefered one by
211 # each candidate overwriting all previous selections.
 
 
 
212
213 foreach {s p sname pname prname} [state run {
214 SELECT S.sid, P.pid, S.name, SB.name, PR.name
215 FROM symbol S, parent P, symbol SB, project PR
216 WHERE S.sid = P.sid
217 AND P.pid = SB.sid
218 AND S.pid = PR.pid
 
219 ORDER BY P.n ASC, P.pid DESC
220 -- Higher votes and smaller ids (= earlier branches) last
221 -- We simply keep the last possible parent for each
222 -- symbol. This parent will have the max number of votes
223 -- for its symbol and will be the earliest created branch
@@ -238,21 +249,24 @@
238
239 log write 3 pcollsym "$prname : '$sname's prefered parent is '$pname'"
240 }
241
242 # Phase III: Check the result that all symbols except for
243 # trunks have a prefered parent.
 
 
244
245 foreach {pname sname} [state run {
246 SELECT S.name, PR.name
247 FROM project PR, symbol S LEFT OUTER JOIN preferedparent P
248 ON S.sid = P.sid
249 WHERE P.pid IS NULL
250 AND S.name != ':trunk:'
251 AND S.pid = PR.pid
 
252 }] {
253 trouble fatal "$prname : '$sname' has no prefered parent."
254 }
255
256 # The reverse, having prefered parents for unknown symbols
257 # cannot occur.
258 return
259
--- tools/cvs2fossil/lib/c2f_pcollsym.tcl
+++ tools/cvs2fossil/lib/c2f_pcollsym.tcl
@@ -60,11 +60,16 @@
60 }
61 return
62 }
63
64 typemethod load {} {
65 # Pass manager interface. Executed to load data computed by
66 # this pass into memory when this pass is skipped instead of
67 # executed.
68
69 # The results of this pass are fully in the persistent state,
70 # there is nothing to load.
71 return
72 }
73
74 typemethod run {} {
75 # Pass manager interface. Executed to perform the
@@ -202,22 +207,28 @@
207 return
208 }
209
210 proc DeterminePreferedParents {} {
211 array set prefered {}
212
213 set excl [project::sym excluded]
214
215 # Phase I: Pull the possible parents, using sorting to put the
216 # prefered parent of each symbol last among all
217 # candidates, allowing us get the prefered one by
218 # each candidate overwriting all previous
219 # selections. Note that we ignore excluded symbol, we
220 # do not care about their prefered parents and do not
221 # attempt to compute them.
222
223 foreach {s p sname pname prname} [state run {
224 SELECT S.sid, P.pid, S.name, SB.name, PR.name
225 FROM symbol S, parent P, symbol SB, project PR
226 WHERE S.sid = P.sid
227 AND P.pid = SB.sid
228 AND S.pid = PR.pid
229 AND S.type != $excl
230 ORDER BY P.n ASC, P.pid DESC
231 -- Higher votes and smaller ids (= earlier branches) last
232 -- We simply keep the last possible parent for each
233 -- symbol. This parent will have the max number of votes
234 -- for its symbol and will be the earliest created branch
@@ -238,21 +249,24 @@
249
250 log write 3 pcollsym "$prname : '$sname's prefered parent is '$pname'"
251 }
252
253 # Phase III: Check the result that all symbols except for
254 # trunks have a prefered parent. We also ignore
255 # excluded symbols, as we intentionally did not
256 # compute a prefered parent for them, see phase I.
257
258 foreach {pname sname} [state run {
259 SELECT PR.name, S.name
260 FROM project PR, symbol S LEFT OUTER JOIN preferedparent P
261 ON S.sid = P.sid
262 WHERE P.pid IS NULL
263 AND S.name != ':trunk:'
264 AND S.pid = PR.pid
265 AND S.type != $excl
266 }] {
267 trouble fatal "$pname : '$sname' has no prefered parent."
268 }
269
270 # The reverse, having prefered parents for unknown symbols
271 # cannot occur.
272 return
273

Keyboard Shortcuts

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