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.
Commit
4c8a5a44afb8f45d5e0740efe09ffac647aac950
Parent
efc78b7a429e75f…
1 file changed
+19
-5
| --- tools/cvs2fossil/lib/c2f_pcollsym.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_pcollsym.tcl | ||
| @@ -60,11 +60,16 @@ | ||
| 60 | 60 | } |
| 61 | 61 | return |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | 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. | |
| 66 | 71 | return |
| 67 | 72 | } |
| 68 | 73 | |
| 69 | 74 | typemethod run {} { |
| 70 | 75 | # Pass manager interface. Executed to perform the |
| @@ -202,22 +207,28 @@ | ||
| 202 | 207 | return |
| 203 | 208 | } |
| 204 | 209 | |
| 205 | 210 | proc DeterminePreferedParents {} { |
| 206 | 211 | array set prefered {} |
| 212 | + | |
| 213 | + set excl [project::sym excluded] | |
| 207 | 214 | |
| 208 | 215 | # Phase I: Pull the possible parents, using sorting to put the |
| 209 | 216 | # prefered parent of each symbol last among all |
| 210 | 217 | # 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. | |
| 212 | 222 | |
| 213 | 223 | foreach {s p sname pname prname} [state run { |
| 214 | 224 | SELECT S.sid, P.pid, S.name, SB.name, PR.name |
| 215 | 225 | FROM symbol S, parent P, symbol SB, project PR |
| 216 | 226 | WHERE S.sid = P.sid |
| 217 | 227 | AND P.pid = SB.sid |
| 218 | 228 | AND S.pid = PR.pid |
| 229 | + AND S.type != $excl | |
| 219 | 230 | ORDER BY P.n ASC, P.pid DESC |
| 220 | 231 | -- Higher votes and smaller ids (= earlier branches) last |
| 221 | 232 | -- We simply keep the last possible parent for each |
| 222 | 233 | -- symbol. This parent will have the max number of votes |
| 223 | 234 | -- for its symbol and will be the earliest created branch |
| @@ -238,21 +249,24 @@ | ||
| 238 | 249 | |
| 239 | 250 | log write 3 pcollsym "$prname : '$sname's prefered parent is '$pname'" |
| 240 | 251 | } |
| 241 | 252 | |
| 242 | 253 | # 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. | |
| 244 | 257 | |
| 245 | 258 | foreach {pname sname} [state run { |
| 246 | - SELECT S.name, PR.name | |
| 259 | + SELECT PR.name, S.name | |
| 247 | 260 | FROM project PR, symbol S LEFT OUTER JOIN preferedparent P |
| 248 | 261 | ON S.sid = P.sid |
| 249 | 262 | WHERE P.pid IS NULL |
| 250 | 263 | AND S.name != ':trunk:' |
| 251 | 264 | AND S.pid = PR.pid |
| 265 | + AND S.type != $excl | |
| 252 | 266 | }] { |
| 253 | - trouble fatal "$prname : '$sname' has no prefered parent." | |
| 267 | + trouble fatal "$pname : '$sname' has no prefered parent." | |
| 254 | 268 | } |
| 255 | 269 | |
| 256 | 270 | # The reverse, having prefered parents for unknown symbols |
| 257 | 271 | # cannot occur. |
| 258 | 272 | return |
| 259 | 273 |
| --- 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 |