Fossil SCM

Fixed the calculation of possible parents for a detached NTDB. Has to be trunk. The symbols were skipped before, causing them to have no parents at all later on, forcing an abort after CollateSymbols. Added some high verbosity log commands for debugging of this area.

aku 2007-11-22 06:03 trunk
Commit 930ec162ce0db00d35d29069a5cd11135b9abee1
--- tools/cvs2fossil/lib/c2f_file.tcl
+++ tools/cvs2fossil/lib/c2f_file.tcl
@@ -1050,10 +1050,16 @@
10501050
$lod countacommit
10511051
10521052
if {[$root hasparentbranch]} {
10531053
# Note lod == [$root parentbranch]
10541054
$lod possibleparents
1055
+ } elseif {![$lod istrunk] && [$root isondefaultbranch]} {
1056
+ # This is the root revision of a detached NTDB. We
1057
+ # have to manually set the only possible parent for
1058
+ # this LOD, the trunk itself.
1059
+
1060
+ [$lod symbol] possibleparent $mytrunk
10551061
}
10561062
10571063
# For the revisions in the line we register their branches
10581064
# and tags as blockers for the lod, and update the type
10591065
# counters as well. As branch symbols without commits on
10601066
--- tools/cvs2fossil/lib/c2f_file.tcl
+++ tools/cvs2fossil/lib/c2f_file.tcl
@@ -1050,10 +1050,16 @@
1050 $lod countacommit
1051
1052 if {[$root hasparentbranch]} {
1053 # Note lod == [$root parentbranch]
1054 $lod possibleparents
 
 
 
 
 
 
1055 }
1056
1057 # For the revisions in the line we register their branches
1058 # and tags as blockers for the lod, and update the type
1059 # counters as well. As branch symbols without commits on
1060
--- tools/cvs2fossil/lib/c2f_file.tcl
+++ tools/cvs2fossil/lib/c2f_file.tcl
@@ -1050,10 +1050,16 @@
1050 $lod countacommit
1051
1052 if {[$root hasparentbranch]} {
1053 # Note lod == [$root parentbranch]
1054 $lod possibleparents
1055 } elseif {![$lod istrunk] && [$root isondefaultbranch]} {
1056 # This is the root revision of a detached NTDB. We
1057 # have to manually set the only possible parent for
1058 # this LOD, the trunk itself.
1059
1060 [$lod symbol] possibleparent $mytrunk
1061 }
1062
1063 # For the revisions in the line we register their branches
1064 # and tags as blockers for the lod, and update the type
1065 # counters as well. As branch symbols without commits on
1066
--- tools/cvs2fossil/lib/c2f_pcollsym.tcl
+++ tools/cvs2fossil/lib/c2f_pcollsym.tcl
@@ -218,12 +218,12 @@
218218
# each candidate overwriting all previous
219219
# selections. Note that we ignore excluded symbol, we
220220
# do not care about their prefered parents and do not
221221
# attempt to compute them.
222222
223
- foreach {s p sname pname prname} [state run {
224
- SELECT S.sid, P.pid, S.name, SB.name, PR.name
223
+ foreach {s p sname pname prname votes} [state run {
224
+ SELECT S.sid, P.pid, S.name, SB.name, PR.name, P.n
225225
FROM symbol S, parent P, symbol SB, project PR
226226
WHERE S.sid = P.sid
227227
AND P.pid = SB.sid
228228
AND S.pid = PR.pid
229229
AND S.type != $excl
@@ -232,10 +232,12 @@
232232
-- We simply keep the last possible parent for each
233233
-- symbol. This parent will have the max number of votes
234234
-- for its symbol and will be the earliest created branch
235235
-- possible among all with many votes.
236236
}] {
237
+ log write 9 pcollsym "Voting $votes for Parent($sname) = $pname"
238
+
237239
set prefered($s) [list $p $sname $pname $prname]
238240
}
239241
240242
# Phase II: Write the found preferences back into the table
241243
# this pass defined for it.
242244
--- tools/cvs2fossil/lib/c2f_pcollsym.tcl
+++ tools/cvs2fossil/lib/c2f_pcollsym.tcl
@@ -218,12 +218,12 @@
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
@@ -232,10 +232,12 @@
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
235 -- possible among all with many votes.
236 }] {
 
 
237 set prefered($s) [list $p $sname $pname $prname]
238 }
239
240 # Phase II: Write the found preferences back into the table
241 # this pass defined for it.
242
--- tools/cvs2fossil/lib/c2f_pcollsym.tcl
+++ tools/cvs2fossil/lib/c2f_pcollsym.tcl
@@ -218,12 +218,12 @@
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 votes} [state run {
224 SELECT S.sid, P.pid, S.name, SB.name, PR.name, P.n
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
@@ -232,10 +232,12 @@
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
235 -- possible among all with many votes.
236 }] {
237 log write 9 pcollsym "Voting $votes for Parent($sname) = $pname"
238
239 set prefered($s) [list $p $sname $pname $prname]
240 }
241
242 # Phase II: Write the found preferences back into the table
243 # this pass defined for it.
244
--- tools/cvs2fossil/lib/c2f_psym.tcl
+++ tools/cvs2fossil/lib/c2f_psym.tcl
@@ -105,10 +105,12 @@
105105
struct::set include myblockers $symbol
106106
return
107107
}
108108
109109
method possibleparent {symbol} {
110
+ log write 9 symbol "Possible parent ($myname) = [$symbol name]"
111
+
110112
if {[info exists mypparent($symbol)]} {
111113
incr mypparent($symbol)
112114
} else {
113115
set mypparent($symbol) 1
114116
}
115117
--- tools/cvs2fossil/lib/c2f_psym.tcl
+++ tools/cvs2fossil/lib/c2f_psym.tcl
@@ -105,10 +105,12 @@
105 struct::set include myblockers $symbol
106 return
107 }
108
109 method possibleparent {symbol} {
 
 
110 if {[info exists mypparent($symbol)]} {
111 incr mypparent($symbol)
112 } else {
113 set mypparent($symbol) 1
114 }
115
--- tools/cvs2fossil/lib/c2f_psym.tcl
+++ tools/cvs2fossil/lib/c2f_psym.tcl
@@ -105,10 +105,12 @@
105 struct::set include myblockers $symbol
106 return
107 }
108
109 method possibleparent {symbol} {
110 log write 9 symbol "Possible parent ($myname) = [$symbol name]"
111
112 if {[info exists mypparent($symbol)]} {
113 incr mypparent($symbol)
114 } else {
115 set mypparent($symbol) 1
116 }
117

Keyboard Shortcuts

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