Diff
Not logged in

Differences From:

File tools/cvs2fossil/lib/c2f_prev.tcl part of check-in [8c9030e3e8] - Bugfix in the changeset class. The index from revisions to containing changesets is not 1:1, but 1:n. While only one revision changeset is possible there can also be zero or more symbol changesets. by aku on 2007-11-24 04:29:30. [view]

To:

File tools/cvs2fossil/lib/c2f_prev.tcl part of check-in [17ec2d682c] - Bugfix in changeset class. Forgot to update the map from revisions to containing changesets when breaking the internal dependencies of the initial changesets. This affected only the first fragment as all the revisions put into separate fragments where still pointing to the original changeset. This lead to bogus links at the level of changesets, the changeset was seemingly still referencing itself. by aku on 2007-11-24 04:34:26. [view]

@@ -232,8 +232,15 @@
 	}
 
 	log write 6 csets ". . .. ... ..... ........ ............."
 
+	# (*) We clear out the associated part of the myrevmap
+	# in-memory index in preparation for new data. A simple unset
+	# is enough, we have no symbol changesets at this time, and
+	# thus never more than one reference in the list.
+
+	foreach r $myrevisions { unset myrevmap($r) }
+
 	# Create changesets for the fragments, reusing the current one
 	# for the first fragment. We sort them in order to allow
 	# checking for gaps and nice messages.
 
@@ -264,10 +271,17 @@
 	if {$laste != ([llength $myrevisions]-1)} {
 	    trouble internal "Bad fragment end @ $laste, gap, or beyond end of the range"
 	}
 
-	# Put the first fragment into the current changeset.
+	# Put the first fragment into the current changeset, and
+	# update the in-memory index. We can simply (re)add the
+	# revisions because we cleared the previously existing
+	# information, see (*) above. Persistence does not matter
+	# here, none of the changesets has been saved to the
+	# persistent state yet.
+
 	set myrevisions [lrange $myrevisions 0 $firste]
+	foreach r $myrevisions { lappend myrevmap($r) $self }
 
 	return 1
     }