Diff
Not logged in

Differences From:

File tools/cvs2fossil/lib/c2f_file.tcl part of check-in [aa04ac9d10] - Extended the collection of revisions for a file with a separate blob store to manage the text ranges of revisions and their dependencies separate from the revisions. This will be used later (upcoming) to properly expand a file even if revisions were removed as irrelevant during the collection and filter passes. by aku on 2008-02-03 00:04:37. [view]

To:

File tools/cvs2fossil/lib/c2f_file.tcl part of check-in [83d75a6c23] - Modified filtering pass to drop the blobs of excluded revisions, for them we can be sure that we will not need them later, as whole branches are dropped. Modified the file import to use the new blob information to setup the expansion graph. This fixes the trouble we had with archive files in bwidget. They are now properly expanded. by aku on 2008-02-03 00:45:57. [view]

@@ -307,45 +307,46 @@
 	set earcs   {} ; # Arcs for expansion graph
 	set zarcs   {} ; # Arcs for zip graph
 	set revmap  {} ; # path -> rid map to later merge uuid information
 
-	foreach {rid revnr parent child coff clen} [state run {
-	    SELECT R.rid, R.rev, R.parent, R.child, R.coff, R.clen
-	    FROM   revision R
-	    WHERE  R.fid = $myid
+	foreach {rid revnr parent child coff clen cid cparent} [state run {
+	    SELECT B.rid, R.rev, R.parent, R.child, B.coff, B.clen, B.bid, B.pid
+	    FROM            blob B
+	    LEFT OUTER JOIN revision R
+	    ON              B.rid = R.rid
+	    WHERE  B.fid = $myid
 	}] {
-	    lappend revmap r$revnr $rid
-
-	    $zp node insert $rid
-	    $zp node set    $rid revnr $revnr
-	    $zp node set    $rid label <$revnr>
-
-	    if {$child ne ""} {
-		lappend zarcs $child $rid
-	    }
-
-	    $ex node insert $rid
-	    $ex node set    $rid text  [list $coff $clen]
-	    $ex node set    $rid revnr $revnr
-	    $ex node set    $rid label <$revnr>
-
-	    if {[rev istrunkrevnr $revnr]} {
-		# On the trunk, this revision is a delta based on the
-		# child. That makes the child our predecessor.
-
-		if {$child eq ""} continue
-		lappend earcs $child $rid
+	    # Main data are blobs, most will have revisions, but not
+	    # all. The expansion graph is blob based, whereas the
+	    # recompression graph is revision based.
+
+	    if {$revnr ne ""} {
+		lappend revmap r$revnr $rid
+
+		$zp node insert $rid
+		$zp node set    $rid revnr $revnr
+		$zp node set    $rid label <$revnr>
+
+		if {$child ne ""} {
+		    lappend zarcs $child $rid
+		}
 	    } else {
-		# On a branch this revision is a delta based on the
-		# parent. That makes the parent our predecessor.
-
-		if {$parent eq ""} {
-		    # Detached branch root, this is a patch based on
-		    # the empty string.
-		    $ex node set $rid __base__ r__empty__
-		    continue
-		}
-		lappend earcs $parent $rid
+		# We fake a revnr for the blobs which have no
+		# revision, for use in the expansion graph.
+		set revnr ghost$cid
+	    }
+
+	    # Now the expansion graph.
+
+	    $ex node insert $cid
+	    $ex node set    $cid text  [list $coff $clen]
+	    $ex node set    $cid revnr $revnr
+	    $ex node set    $cid label <$revnr>
+
+	    if {$cparent ne ""} {
+		# The expansion arcs go from baseline to delta
+		# descendant, based on the blob information.
+		lappend earcs $cparent $cid
 	    }
 	}
 
 	# Phase II: Insert the accumulated dependencies