Diff
Not logged in

Differences From:

File tools/cvs2fossil/lib/c2f_pcollrev.tcl part of check-in [6f8667b03e] - Added code creating aggregate symbol statistics. This completes pass 2 (CollRev). by aku on 2007-10-31 03:44:01. [view]

To:

File tools/cvs2fossil/lib/c2f_pcollrev.tcl part of check-in [c3d5104084] - Added code for the loading of pass II data (currently only the smybols) from the state when pass II is skipped. by aku on 2007-11-02 04:26:32. [view]

@@ -9,18 +9,16 @@
 # individuals.  For exact contribution history, see the revision
 # history and logs, available at http://fossil-scm.hwaci.com/fossil
 # # ## ### ##### ######## ############# #####################
 
-## Pass II. This pass parses the colected rcs archives and extracts
+## Pass II. This pass parses the collected rcs archives and extracts
 ## all the information they contain (revisions, and symbols).
 
 # # ## ### ##### ######## ############# #####################
 ## Requirements
 
 package require Tcl 8.4                             ; # Required runtime.
 package require snit                                ; # OO system.
-package require fileutil::traverse                  ; # Directory traversal.
-package require fileutil                            ; # File & path utilities.
 package require vc::tools::trouble                  ; # Error reporting.
 package require vc::tools::log                      ; # User feedback.
 package require vc::fossil::import::cvs::pass       ; # Pass management.
 package require vc::fossil::import::cvs::repository ; # Repository management.
@@ -177,9 +175,9 @@
 	state writing symbol {
 	    sid  INTEGER  NOT NULL  PRIMARY KEY AUTOINCREMENT,
 	    pid  INTEGER  NOT NULL  REFERENCES project,  -- Project the symbol belongs to
 	    name TEXT     NOT NULL,
-	    type INTEGER  NOT NULL,                      -- enum { tag = 1, branch, undefined }
+	    type INTEGER  NOT NULL  REFERENCES symtype,  -- enum { excluded = 0, tag, branch, undefined }
 
 	    tag_count    INTEGER  NOT NULL, -- How often the symbol is used as tag.
 	    branch_count INTEGER  NOT NULL, -- How often the symbol is used as branch
 	    commit_count INTEGER  NOT NULL, -- How often a file was committed on the symbol
@@ -203,8 +201,20 @@
 	    sid INTEGER  NOT NULL  REFERENCES symbol, --
 	    pid INTEGER  NOT NULL  REFERENCES symbol, -- Possible parent of sid
 	    n   INTEGER  NOT NULL,                    -- How often pid can act as parent.
 	    UNIQUE (sid, pid)
+	}
+
+	state writing symtype {
+	    tid   INTEGER  NOT NULL  PRIMARY KEY,
+	    name  TEXT     NOT NULL,
+	    UNIQUE (name)
+	}
+	state run {
+	    INSERT INTO symtype VALUES (0,'excluded');
+	    INSERT INTO symtype VALUES (1,'tag');
+	    INSERT INTO symtype VALUES (2,'branch');
+	    INSERT INTO symtype VALUES (3,'undefined');
 	}
 
 	state writing meta {
 	    -- Meta data of revisions. See revision.mid for the
@@ -250,9 +260,11 @@
 	return
     }
 
     typemethod load {} {
-	# TODO
+	state reading symbol
+
+	repository loadsymbols
 	return
     }
 
     typemethod run {} {
@@ -314,8 +326,9 @@
 	state discard branch
 	state discard symbol
 	state discard blocker
 	state discard parent
+	state discard symtype
 	state discard meta
 	state discard author
 	state discard cmessage
 	return