Diff
Not logged in

Differences From:

File tools/cvs2fossil/lib/c2f_pcollrev.tcl part of check-in [74854a30b8] - Added ability to declare indices on tables in the persistent state. Used this to declare indices on critical columns. Slows down the transactions saving changesets, this however is made up when it comes to successor/predecessor retrieval of changesets. by aku on 2007-12-02 03:40:56. [view]

To:

File tools/cvs2fossil/lib/c2f_pcollrev.tcl part of check-in [e288af3995] - Fluff: Renamed state methods use/reading/writing to usedb/use/extend for clarity. Updated all callers. Extended state module with code to dump the SQL statements it receives to a file for analysis. Extended the 'use' declarations of several passes. by aku on 2007-12-02 23:47:45. [view]

@@ -46,10 +46,10 @@
     typemethod setup {} {
 	# Define names and structure of the persistent state of this
 	# pass.
 
-	state reading project
-	state reading file
+	state use project
+	state use file
 
 	# We deal with per project and per file data, the first
 	# collated from the second.
 
@@ -65,9 +65,9 @@
 	#	Tag      <- Symbol <- Event
 	#	Branch   <- Symbol <- Event
 	#	Revision           <- Event
 
-	state writing revision {
+	state extend revision {
 	    -- Revisions. Identified by a global numeric id each
 	    -- belongs to a single file, identified by its id. It
 	    -- further has a dotted revision number (DTN).
 	    --
@@ -145,9 +145,9 @@
 
 	    UNIQUE (fid, rev) -- The DTN is unique within the revision's file.
 	}
 
-	state writing optype {
+	state extend optype {
 	    oid   INTEGER  NOT NULL  PRIMARY KEY,
 	    name  TEXT     NOT NULL,
 	    UNIQUE(name)
 	}
@@ -157,9 +157,9 @@
 	    INSERT INTO optype VALUES ( 1,'add');     -- in file::rev. myopcode is
 	    INSERT INTO optype VALUES ( 2,'change');  -- loaded from this.
 	}
 
-	state writing revisionbranchchildren {
+	state extend revisionbranchchildren {
 	    -- The non-primary children of a revision, as reachable
 	    -- through a branch symbol, are listed here. This is
 	    -- needed by pass 5 to break internal dependencies in a
 	    -- changeset.
@@ -168,9 +168,9 @@
 	    brid  INTEGER  NOT NULL  REFERENCES revision,
 	    UNIQUE(rid,brid)
 	}
 
-	state writing tag {
+	state extend tag {
 	    tid  INTEGER  NOT NULL  PRIMARY KEY AUTOINCREMENT,
 	    fid  INTEGER  NOT NULL  REFERENCES file,     -- File the item belongs to
 	    lod  INTEGER            REFERENCES symbol,   -- Line of development (NULL => Trunk)
 	    sid  INTEGER  NOT NULL  REFERENCES symbol,   -- Symbol capturing the tag
@@ -179,9 +179,9 @@
 	} { rev sid }
 	# Indices on: rev (revision successors)
 	#             sid (tag predecessors, branch successors/predecessors)
 
-	state writing branch {
+	state extend branch {
 	    bid   INTEGER  NOT NULL  PRIMARY KEY AUTOINCREMENT,
 	    fid   INTEGER  NOT NULL  REFERENCES file,     -- File the item belongs to
 	    lod   INTEGER            REFERENCES symbol,   -- Line of development (NULL => Trunk)
 	    sid   INTEGER  NOT NULL  REFERENCES symbol,   -- Symbol capturing the branch
@@ -208,9 +208,9 @@
 	#	pTrunk  <- pLineOfDevelopment
 	#	pBranch <- pSymbol, pLineOfDevelopment
 	#	pTag    <- pSymbol, pLineOfDevelopment
 
-	state writing symbol {
+	state extend 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  REFERENCES symtype,  -- enum { excluded = 0, tag, branch, undefined }
@@ -221,9 +221,9 @@
 
 	    UNIQUE (pid, name) -- Symbols are unique within the project
 	}
 
-	state writing blocker {
+	state extend blocker {
 	    -- For each symbol we save which other symbols are
 	    -- blocking its removal (if the user asks for it).
 
 	    sid INTEGER  NOT NULL  REFERENCES symbol, --
@@ -230,9 +230,9 @@
 	    bid INTEGER  NOT NULL  REFERENCES symbol, -- Sprouted from sid, blocks it.
 	    UNIQUE (sid, bid)
 	}
 
-	state writing parent {
+	state extend parent {
 	    -- For each symbol we save which other symbols can act as
 	    -- a possible parent in some file, and how often.
 
 	    sid INTEGER  NOT NULL  REFERENCES symbol, --
@@ -240,9 +240,9 @@
 	    n   INTEGER  NOT NULL,                    -- How often pid can act as parent.
 	    UNIQUE (sid, pid)
 	}
 
-	state writing symtype {
+	state extend symtype {
 	    tid    INTEGER  NOT NULL  PRIMARY KEY,
 	    name   TEXT     NOT NULL,
 	    plural TEXT     NOT NULL,
 	    UNIQUE (name)
@@ -254,9 +254,9 @@
 	    INSERT INTO symtype VALUES (2,'branch',   'branches');
 	    INSERT INTO symtype VALUES (3,'undefined','undefined');
 	}
 
-	state writing meta {
+	state extend meta {
 	    -- Meta data of revisions. See revision.mid for the
 	    -- reference. Many revisions can share meta data. This is
 	    -- actually one of the criterions used to sort revisions
 	    -- into changesets.
@@ -285,14 +285,14 @@
 
 	# Authors and commit messages are fully global, i.e. per
 	# repository.
 
-	state writing author {
+	state extend author {
 	    aid  INTEGER  NOT NULL  PRIMARY KEY  AUTOINCREMENT,
 	    name TEXT     NOT NULL  UNIQUE
 	}
 
-	state writing cmessage {
+	state extend cmessage {
 	    cid  INTEGER  NOT NULL  PRIMARY KEY  AUTOINCREMENT,
 	    text TEXT     NOT NULL  UNIQUE
 	}
 
@@ -301,11 +301,11 @@
 	return
     }
 
     typemethod load {} {
-	state reading symbol
-	state reading symtype
-	state reading optype
+	state use symbol
+	state use symtype
+	state use optype
 
 	project::sym getsymtypes
 	file::rev    getopcodes
 	repository   loadsymbols