Fossil

Check-in [930ec162]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:930ec162ce0db00d35d29069a5cd11135b9abee1
User & Date: aku 2007-11-22 06:03:47
Context
2007-11-22
07:21
Tweaked the log output for the statistics a bit. check-in: 2630e506 user: aku tags: trunk
06:03
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. check-in: 930ec162 user: aku tags: trunk
04:56
Fixed bug in the initialization of mybranchcode for changesets. check-in: 47e271a4 user: aku tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tools/cvs2fossil/lib/c2f_file.tcl.

1048
1049
1050
1051
1052
1053
1054






1055
1056
1057
1058
1059
1060
1061

	    $lod countasbranch
	    $lod countacommit

	    if {[$root hasparentbranch]} {
		# Note lod == [$root parentbranch]
		$lod possibleparents






	    }

	    # For the revisions in the line we register their branches
	    # and tags as blockers for the lod, and update the type
	    # counters as well. As branch symbols without commits on
	    # them are not listed as lines of development, we have to
	    # count them here as well, as plain branches. At last we







>
>
>
>
>
>







1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067

	    $lod countasbranch
	    $lod countacommit

	    if {[$root hasparentbranch]} {
		# Note lod == [$root parentbranch]
		$lod possibleparents
	    } elseif {![$lod istrunk] && [$root isondefaultbranch]} {
		# This is the root revision of a detached NTDB. We
		# have to manually set the only possible parent for
		# this LOD, the trunk itself.

		[$lod symbol] possibleparent $mytrunk
	    }

	    # For the revisions in the line we register their branches
	    # and tags as blockers for the lod, and update the type
	    # counters as well. As branch symbols without commits on
	    # them are not listed as lines of development, we have to
	    # count them here as well, as plain branches. At last we

Changes to tools/cvs2fossil/lib/c2f_pcollsym.tcl.

216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236


237
238
239
240
241
242
243
	#          prefered parent of each symbol last among all
	#          candidates, allowing us get the prefered one by
	#          each candidate overwriting all previous
	#          selections. Note that we ignore excluded symbol, we
	#          do not care about their prefered parents and do not
	#          attempt to compute them.

	foreach {s p sname pname prname} [state run {
	    SELECT   S.sid, P.pid, S.name, SB.name, PR.name
	    FROM     symbol S, parent P, symbol SB, project PR
	    WHERE    S.sid = P.sid
	    AND      P.pid = SB.sid
	    AND      S.pid = PR.pid
	    AND      S.type != $excl
	    ORDER BY P.n ASC, P.pid DESC
	    -- Higher votes and smaller ids (= earlier branches) last
	    -- We simply keep the last possible parent for each
	    -- symbol.  This parent will have the max number of votes
	    -- for its symbol and will be the earliest created branch
	    -- possible among all with many votes.
	}] {


	    set prefered($s) [list $p $sname $pname $prname]
	}

	# Phase II: Write the found preferences back into the table
	#           this pass defined for it.

	foreach {s x} [array get prefered] {







|
|












>
>







216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
	#          prefered parent of each symbol last among all
	#          candidates, allowing us get the prefered one by
	#          each candidate overwriting all previous
	#          selections. Note that we ignore excluded symbol, we
	#          do not care about their prefered parents and do not
	#          attempt to compute them.

	foreach {s p sname pname prname votes} [state run {
	    SELECT   S.sid, P.pid, S.name, SB.name, PR.name, P.n
	    FROM     symbol S, parent P, symbol SB, project PR
	    WHERE    S.sid = P.sid
	    AND      P.pid = SB.sid
	    AND      S.pid = PR.pid
	    AND      S.type != $excl
	    ORDER BY P.n ASC, P.pid DESC
	    -- Higher votes and smaller ids (= earlier branches) last
	    -- We simply keep the last possible parent for each
	    -- symbol.  This parent will have the max number of votes
	    -- for its symbol and will be the earliest created branch
	    -- possible among all with many votes.
	}] {
	    log write 9 pcollsym "Voting $votes for Parent($sname) = $pname"

	    set prefered($s) [list $p $sname $pname $prname]
	}

	# Phase II: Write the found preferences back into the table
	#           this pass defined for it.

	foreach {s x} [array get prefered] {

Changes to tools/cvs2fossil/lib/c2f_psym.tcl.

103
104
105
106
107
108
109


110
111
112
113
114
115
116
	# on this symbol.

	struct::set include myblockers $symbol
	return
    }

    method possibleparent {symbol} {


	if {[info exists mypparent($symbol)]} {
	    incr mypparent($symbol)
	} else {
	    set  mypparent($symbol) 1
	}
	return
    }







>
>







103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
	# on this symbol.

	struct::set include myblockers $symbol
	return
    }

    method possibleparent {symbol} {
	log write 9 symbol "Possible parent ($myname) = [$symbol name]"

	if {[info exists mypparent($symbol)]} {
	    incr mypparent($symbol)
	} else {
	    set  mypparent($symbol) 1
	}
	return
    }