Diff
Not logged in

Differences From:

File tools/cvs2fossil/lib/c2f_file.tcl part of check-in [e5ae612c8d] - Added high-verbosity (level 11) logging to trace the application of rcs patches. by aku on 2008-01-31 07:14:20. [view]

To:

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]

@@ -19,8 +19,9 @@
 package require Tcl 8.4                             ; # Required runtime.
 package require snit                                ; # OO system.
 package require struct::set                         ; # Set operations.
 package require struct::list                        ; # Higher order operations.
+package require vc::fossil::import::cvs::blobstore  ; # Blob storage.
 package require vc::fossil::import::cvs::file::rev  ; # CVS per file revisions.
 package require vc::fossil::import::cvs::file::sym  ; # CVS per file symbols.
 package require vc::fossil::import::cvs::state      ; # State storage.
 package require vc::fossil::import::cvs::integrity  ; # State integrity checks.
@@ -42,14 +43,16 @@
 	set myusrpath    $usrpath
 	set myexecutable $executable
 	set myproject    $project
 	set mytrunk      [$myproject trunk]
+	set myblob       [blobstore ${selfns}::%AUTO% $id]
 	return
     }
 
     method setid {id} {
 	integrity assert {$myid eq ""} {File '$mypath' already has an id, '$myid'}
 	set myid $id
+	$myblob setid $id
 	return
     }
 
     method id      {} { return $myid }
@@ -95,8 +98,9 @@
 
 	state transaction {
 	    foreach rev $revisions { $rev persist }
 	    foreach sym $symbols   { $sym persist }
+	    $myblob persist
 	}
 	return
     }
 
@@ -158,8 +162,19 @@
 
 	set myaid($revnr) [$myproject defauthor $author]
 	set myrev($revnr) [rev %AUTO% $revnr $date $state $self]
 
+	$myblob add $revnr $myrev($revnr)
+
+	if {$next ne ""} {
+	    # parent revision NEXT is a delta of current.
+	    $myblob delta $next $revnr
+	}
+	foreach b $branches {
+	    # branch child revision B is a delta of current.
+	    $myblob delta $b $revnr
+	}
+
 	$self RecordBasicDependencies $revnr $next
 	return
     }
 
@@ -212,8 +227,10 @@
 
 	$rev setmeta [$myproject defmeta [$lod id] $myaid($revnr) $cmid]
 	$rev settext $textrange
 	$rev setlod  $lod
+
+	$myblob extend $revnr $textrange
 
 	# If this is revision 1.1, we have to determine whether the
 	# file seems to have been created through 'cvs add' instead of
 	# 'cvs import'. This can be done by looking at the un-
@@ -576,8 +593,12 @@
     variable myroots {} ; # List of roots in the forest of
 			  # lod's. Object references to revisions and
 			  # branches. The latter can appear when they
 			  # are severed from their parent.
+
+    variable myblob {} ; # Reference to the object managing the blob
+			 # information (textrange of revisions, and
+			 # delta dependencies) of this file.
 
     # # ## ### ##### ######## #############
     ## Internal methods
 
@@ -1390,8 +1411,9 @@
 	# namespace import ::vc::fossil::import::cvs::file::sym
 	namespace import ::vc::tools::misc::*
 	namespace import ::vc::tools::trouble
 	namespace import ::vc::tools::log
+	namespace import ::vc::fossil::import::cvs::blobstore
 	namespace import ::vc::fossil::import::cvs::state
 	namespace import ::vc::fossil::import::cvs::integrity
 	namespace import ::vc::fossil::import::cvs::gtcore
     }