Diff
Not logged in

Differences From:

File tools/cvs2fossil/lib/c2f_pcollrev.tcl part of check-in [7ab490df24] - Extended pass 2, save branch positions, needed for pass 4, and added optype table to have the revision opcodes available in the state as well. by aku on 2007-11-07 06:19:13. [view]

To:

File tools/cvs2fossil/lib/c2f_pcollrev.tcl part of check-in [e45f47ec4a] - Opcode synchronization reworked, optype table is master from which the in-memory array is loaded. by aku on 2007-11-07 07:46:31. [view]

@@ -22,9 +22,10 @@
 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.
 package require vc::fossil::import::cvs::state        ; # State storage.
-package require vc::fossil::import::cvs::project::sym ; # Project level symbols
+package require vc::fossil::import::cvs::project::sym ; # Project level symbols.
+package require vc::fossil::import::cvs::file::rev    ; # File level revisions.
 package require vc::rcs::parser                       ; # Rcs archive data extraction.
 
 # # ## ### ##### ######## ############# #####################
 ## Register the pass with the management
@@ -145,16 +146,15 @@
 	}
 	state writing optype {
 	    oid   INTEGER  NOT NULL  PRIMARY KEY,
 	    name  TEXT     NOT NULL,
-	    UNIQUE(text)
-	}
-	# Keep optype in sync with file::rev.myopcode
+	    UNIQUE(name)
+	}
 	state run {
-	    INSERT INTO optype VALUES (-1,'delete');
-	    INSERT INTO optype VALUES ( 0,'nothing');
-	    INSERT INTO optype VALUES ( 1,'add');
-	    INSERT INTO optype VALUES ( 2,'change');
+	    INSERT INTO optype VALUES (-1,'delete');  -- The opcode names are the
+	    INSERT INTO optype VALUES ( 0,'nothing'); -- fixed pieces, see myopstate
+	    INSERT INTO optype VALUES ( 1,'add');     -- in file::rev. myopcode is
+	    INSERT INTO optype VALUES ( 2,'change');  -- loaded from this.
 	}
 	state writing tag {
 	    tid  INTEGER  NOT NULL  PRIMARY KEY AUTOINCREMENT,
 	    fid  INTEGER  NOT NULL  REFERENCES file,     -- File the item belongs to
@@ -270,16 +270,19 @@
 	    text TEXT     NOT NULL  UNIQUE
 	}
 
 	project::sym getsymtypes
+	file::rev    getopcodes
 	return
     }
 
     typemethod load {} {
 	state reading symbol
 	state reading symtype
-
-	project::sym getsymtypes
+	state reading optype
+
+	project::sym getsymtypes
+	file::rev    getopcodes
 	repository   loadsymbols
 	return
     }
 
@@ -608,8 +611,11 @@
 	namespace import ::vc::fossil::import::cvs::repository
 	namespace import ::vc::fossil::import::cvs::state
 	namespace eval project {
 	    namespace import ::vc::fossil::import::cvs::project::sym
+	}
+	namespace eval file {
+	    namespace import ::vc::fossil::import::cvs::file::rev
 	}
 	namespace import ::vc::tools::trouble
 	namespace import ::vc::tools::log
 	log register collrev