Diff
Not logged in

Differences From:

File tools/cvs2fossil/lib/c2f_frev.tcl part of check-in [bd131addb9] - Started to flesh out the handling symbols and revisions coming in from the rcs parser. First fragments of revision object. Type methods for classification of revision numb ers. by aku on 2007-10-12 05:56:46. [view]

To:

File tools/cvs2fossil/lib/c2f_frev.tcl part of check-in [da9295c6f6] - Continued to flesh out revision and symbol processing. Started on the project level classses. by aku on 2007-10-12 07:18:27. [view]

@@ -24,28 +24,40 @@
 snit::type ::vc::fossil::import::cvs::file::rev {
     # # ## ### ##### ######## #############
     ## Public API
 
-    constructor {date author state thefile} {
+    constructor {revnr date author state thefile} {
+	set myrevnr  $revnr
+	set mydate   $date
+	set myauthor $author
+	set mystate  $state
+	set myfile   $thefile
 	return
     }
 
-    method hascommitmsg {} {
-	# TODO: check that we have the commit message
-	return 0
-    }
+    method hascommitmsg {} { return $myhascm }
 
     method setcommitmsg {cm} {
+	set mycommitmsg $cm
+	set myhascm 1
+	return
     }
 
     method settext {text} {
+	set mytext $text
+	return
+    }
+
+    method setbranch {branchnr} {
+	set mybranchnr $branchnr
+	return
     }
 
     # # ## ### ##### ######## #############
     ## Type API
 
     typemethod istrunkrevnr {revnr} {
-	return [expr {[llength [split $revnr .]] == 1}]
+	return [expr {[llength [split $revnr .]] == 2}]
     }
 
     typemethod 2branchnr {revnr} {
 	# Input is a branch revision number, i.e. a revision number
@@ -62,9 +74,9 @@
 
     typemethod isbranchrevnr {revnr _ bv} {
 	if {[regexp $mybranchpattern $revnr -> head tail]} {
 	    upvar 1 $bv branchnr
-	    set branchnr ${head}.$tail
+	    set branchnr ${head}$tail
 	    return 1
 	}
 	return 0
     }
@@ -76,8 +88,23 @@
     # First a nonzero even number of digit groups with trailing dot
     # CVS then sticks an extra 0 in here; RCS does not.
     # And the last digit group.
 
+    variable myrevnr     {} ; # Revision number of the revision.
+    variable mydate      {} ; # Timestamp of the revision, seconds since epoch
+    variable mystate     {} ; # State of the revision.
+    variable myfile      {} ; # Ref to the file object the revision belongs to.
+    variable myhascm     0  ; # Bool flag, set when the commit msg was set.
+    variable mytext      {} ; # Range of the (delta) text for this revision in the file.
+
+    # The meta data block used later to group revisions into changesets.
+    # The project name factors into this as well, but is not stored
+    # here. The name is acessible via myfile's project.
+
+    variable myauthor    {} ; # Name of the user who committed the revision.
+    variable mycommitmsg {} ; # The message entered as part of the commit.
+    variable mybranchnr  {} ; # The number of the branch the commit was done on.
+
     # # ## ### ##### ######## #############
     ## Internal methods
 
     # # ## ### ##### ######## #############
@@ -84,9 +111,8 @@
     ## Configuration
 
     pragma -hastypeinfo    no  ; # no type introspection
     pragma -hasinfo        no  ; # no object introspection
-    #pragma -hastypemethods no  ; # type is not relevant.
     pragma -simpledispatch yes ; # simple fast dispatch
 
     # # ## ### ##### ######## #############
 }