Diff
Not logged in

Differences From:

File tools/cvs2fossil/lib/c2f_file.tcl part of check-in [27470a9304] - Extended pass I to capture the 'file executable' info of rcs archives. Currently the only way to store this info in the destination will be the use of fossil tags. by aku on 2007-10-13 21:15:30. [view]

To:

File tools/cvs2fossil/lib/c2f_file.tcl part of check-in [67c24820c7] - Reworked the whole handling of meta data (author, commit message, plus project/branch information), so that revisions now store only the meta id, everything else is stored centrally. All the relevant pieces (author, cmessage, symbols, projects) now also get numeric ids assigned early instead of when being saved to the state. Project ids are loaded from the state now too. by aku on 2007-10-14 01:58:07. [view]

@@ -67,9 +67,9 @@
 
     method begin {} {#ignore}
 
     method sethead {revnr} {
-	set myhead $revnr
+	set myheadrevnr $revnr
 	return
     }
 
     method setprincipalbranch {branchnr} {
@@ -102,16 +102,16 @@
     }
 
     method def {revnr date author state next branches} {
 	$self RecordBranchCommits $branches
-	$myproject author $author
 
 	if {[info exists myrev($revnr)]} {
 	    trouble fatal "File $mypath contains duplicate definitions for revision $revnr."
 	    return
 	}
 
-	set myrev($revnr) [rev %AUTO% $revnr $date $author $state $self]
+	set myaid($revnr) [$myproject defauthor $author]
+	set myrev($revnr) [rev %AUTO% $revnr $date $state $self]
 
 	RecordBasicDependencies $revnr $next
 	return
     }
@@ -130,15 +130,14 @@
     }
 
     method setdesc {d} {# ignore}
 
-    method extend {revnr commitmsg deltarange} {
-	set cm [string trim $commitmsg]
-	$myproject cmessage $cm
+    method extend {revnr commitmsg textrange} {
+	set cmid [$myproject defcmessage [string trim $commitmsg]]
 
 	set rev $myrev($revnr)
 
-	if {[$rev hascommitmsg]} {
+	if {[$rev hasmeta]} {
 	    # Apparently repositories exist in which the delta data
 	    # for revision 1.1 is provided several times, at least
 	    # twice. The actual cause of this duplication is not
 	    # known. Speculation centers on RCS/CVS bugs, or from
@@ -153,17 +152,16 @@
 	    log write 1 file "Ignoring the duplicate"
 	    return
 	}
 
-	# Extend the revision with the new information. The revision
-	# object uses this to complete its meta data set.
-
-	$rev setcommitmsg $cm
-	$rev settext  $deltarange
-
-	if {![rev istrunkrevnr $revnr]} {
-	    $rev setbranchname [[$self Rev2Branch $revnr] name]
+	if {[rev istrunkrevnr $revnr]} {
+	    set branchid {}
+	} else {
+	    set branchid [[$self Rev2Branch $revnr] id]
 	}
+
+	$rev setmeta [$myproject defmeta $branchid $myaid($revnr) $cmid]
+	$rev settext $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-
@@ -197,9 +195,14 @@
 				    # associated revision object.
     variable myrevisions       {} ; # Same as myrev, but a list,
 				    # giving us the order of
 				    # revisions.
-    variable myhead            {} ; # Head revision (revision number)
+    variable myaid      -array {} ; # Map revision numbers to the id
+				    # of the author who committed
+				    # it. This is later aggregated
+				    # with commit message, branch name
+				    # and project id for a meta id.
+    variable myheadrevnr       {} ; # Head revision (revision number)
     variable myprincipal       {} ; # Principal branch (branch number).
 				    # Contrary to the name this is the
 				    # default branch.
     variable mydependencies    {} ; # Dictionary parent -> child,
@@ -226,11 +229,8 @@
 			     # their order of creation, which is the
 			     # reverse of definition.  I.e. a smaller
 			     # number means 'Defined earlier', means
 			     # 'Created later'.
-
-    ### TODO ###
-    ### RCS mode info (kb, kkb, ...)
 
     # # ## ### ##### ######## #############
     ## Internal methods