Check-in [80b1e8936f]
Not logged in
Overview

SHA1 Hash:80b1e8936fad7ce85fc2af156031b93d7a2e2f43
Date: 2007-11-29 09:16:33
User: aku
Comment:Renamed state table 'csrevision' to 'csitem' to reflect the new internals of changesets. Updated all places where it is used.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified tools/cvs2fossil/lib/c2f_integrity.tcl from [72056a8796] to [6d1e02083a].

@@ -325,13 +325,13 @@
 		SELECT F.name, R.rev
 		FROM revision R, file F
 		WHERE R.rid IN (SELECT rid
 				FROM revision                -- All revisions
 				EXCEPT                       -- subtract
-				SELECT CR.rid
-				FROM csrevision CR, changeset C  -- revisions used
-				WHERE C.cid = CR.cid         -- by any revision
+				SELECT CI.iid
+				FROM csitem CI, changeset C  -- revisions used
+				WHERE C.cid = CI.cid         -- by any revision
 				AND C.type = 0)              -- changeset
 		AND   R.fid = F.fid              -- get file of unused revision
 	    }
 	# Find all revisions which are used by more than one
 	# changeset.
@@ -345,15 +345,15 @@
                 -- select those with more than one user, and get their
                 -- associated file (name) for display.
 
 		SELECT F.name, R.rev
 		FROM revision R, file F,
-		     (SELECT CR.rid AS rid, count(CR.cid) AS count
-		      FROM csrevision CR, changeset C
+		     (SELECT CI.iid AS rid, count(CI.cid) AS count
+		      FROM csitem CI, changeset C
 		      WHERE C.type = 0
-		      AND   C.cid = CR.cid
-		      GROUP BY CR.rid) AS U
+		      AND   C.cid = CI.cid
+		      GROUP BY CI.iid) AS U
 		WHERE U.count > 1
 		AND R.rid = U.rid
 		AND R.fid = F.fid
 	    }
 	# All revisions have to refer to the same meta information as
@@ -360,14 +360,14 @@
 	# their changeset.
 	CheckRevCS \
 	    {All revisions have to agree with their changeset about the used meta information} \
 	    {disagrees with its changeset @ about the meta information} {
 		SELECT CT.name, C.cid, F.name, R.rev
-		FROM changeset C, cstype CT, revision R, file F, csrevision CR
+		FROM changeset C, cstype CT, revision R, file F, csitem CI
 		WHERE C.type = 0       -- revision changesets only
-		AND   C.cid  = CR.cid  -- changeset --> its revisions
-		AND   R.rid  = CR.rid  -- look at them
+		AND   C.cid  = CI.cid  -- changeset --> its revisions
+		AND   R.rid  = CI.iid  -- look at them
 		AND   R.mid != C.src   -- Only those which disagree with changeset about the meta
 		AND   R.fid = F.fid    -- get file of the revision
 		AND   CT.tid = C.type  -- get changeset type, for labeling
 	    }
 	# All revisions have to agree on the LOD their changeset
@@ -383,14 +383,14 @@
 	    {All revisions in a changeset have to belong to the same LOD} \
 	    {: Its revisions disagree about the LOD they belong to} {
 		SELECT T.name, C.cid
 		FROM   changeset C, cstype T
 		WHERE  C.cid IN (SELECT U.cid
-				 FROM (SELECT DISTINCT CR.cid AS cid, R.lod AS lod
-				       FROM   csrevision CR, changeset C, revision R
-				       WHERE  CR.rid = R.rid
-				       AND    C.cid = CR.cid
+				 FROM (SELECT DISTINCT CI.cid AS cid, R.lod AS lod
+				       FROM   csitem CI, changeset C, revision R
+				       WHERE  CI.iid = R.rid
+				       AND    C.cid = CI.cid
 				       AND    C.type = 0) AS U
 				 GROUP BY U.cid HAVING COUNT(U.lod) > 1)
 		AND    T.tid = C.type
 	    }
 	# All revisions have to agree on the project their changeset
@@ -406,14 +406,14 @@
 	    {All revisions in a changeset have to belong to the same project} \
 	    {: Its revisions disagree about the project they belong to} {
 		SELECT T.name, C.cid
 		FROM   changeset C, cstype T
 		WHERE  C.cid IN (SELECT U.cid
-				 FROM (SELECT DISTINCT CR.cid AS cid, F.pid AS pid
-				       FROM   csrevision CR, changeset C, revision R, file F
-				       WHERE  CR.rid = R.rid
-				       AND    C.cid = CR.cid
+				 FROM (SELECT DISTINCT CI.cid AS cid, F.pid AS pid
+				       FROM   csitem CI, changeset C, revision R, file F
+				       WHERE  CI.iid = R.rid
+				       AND    C.cid = CI.cid
 				       AND    C.type = 0
 				       AND    F.fid  = R.fid) AS U
 				 GROUP BY U.cid HAVING COUNT(U.pid) > 1)
 		AND    T.tid = C.type
 	    }
@@ -432,19 +432,19 @@
 	    {: Its revisions share files} {
 		SELECT T.name, C.cid
 		FROM   changeset C, cstype T
 		WHERE  C.cid IN (SELECT VV.cid
 				 FROM (SELECT U.cid as cid, COUNT (U.fid) AS fcount
-				       FROM (SELECT DISTINCT CR.cid AS cid, R.fid AS fid
-					     FROM   csrevision CR, changeset C, revision R
-					     WHERE  CR.rid = R.rid
-					     AND    C.cid = CR.cid
+				       FROM (SELECT DISTINCT CI.cid AS cid, R.fid AS fid
+					     FROM   csitem CI, changeset C, revision R
+					     WHERE  CI.iid = R.rid
+					     AND    C.cid = CI.cid
 					     AND    C.type = 0
 					     ) AS U
 				       GROUP BY U.cid) AS UU,
-				      (SELECT V.cid AS cid, COUNT (V.rid) AS rcount
-				       FROM   csrevision V, changeset X
+				      (SELECT V.cid AS cid, COUNT (V.iid) AS rcount
+				       FROM   csitem V, changeset X
 				       WHERE  X.cid = V.cid
 				       AND    X.type = 0
 				       GROUP BY V.cid) AS VV
 				 WHERE VV.cid = UU.cid
 				 AND   UU.fcount < VV.rcount)
@@ -475,13 +475,13 @@
 		SELECT P.name, S.name
 		FROM project P, tag T, symbol S
 		WHERE T.tid IN (SELECT tid                    -- All tags
 				FROM   tag
 				EXCEPT                        -- subtract
-				SELECT CR.rid                 -- tags used
-				FROM   csrevision CR, changeset C
-				WHERE  C.cid = CR.cid         -- by any tag
+				SELECT CI.iid                 -- tags used
+				FROM   csitem CI, changeset C
+				WHERE  C.cid = CI.cid         -- by any tag
 				AND    C.type = 1)            -- changeset
 		AND   S.sid = T.sid               -- get symbol of tag
 		AND   P.pid = S.pid               -- get project of symbol
 	    }
 	# Find all tags which are used by more than one changeset.
@@ -495,17 +495,17 @@
                 -- user, and get their associated file (name) for
                 -- display.
 
 		SELECT P.name, S.name
 		FROM tag T, project P, symbol S,
-		     (SELECT CR.rid AS rid, count(CR.cid) AS count
-		      FROM csrevision CR, changeset C
+		     (SELECT CI.iid AS iid, count(CI.cid) AS count
+		      FROM csitem CI, changeset C
 		      WHERE C.type = 1
-		      AND   C.cid = CR.cid
-		      GROUP BY CR.rid) AS U
+		      AND   C.cid = CI.cid
+		      GROUP BY CI.iid) AS U
 		WHERE U.count > 1
-		AND   T.tid = U.rid
+		AND   T.tid = U.iid
 		AND   S.sid = T.sid               -- get symbol of tag
 		AND   P.pid = S.pid               -- get project of symbol
 	    }
 	if 0 {
 	    # This check is disabled for the moment. Apparently tags
@@ -529,14 +529,14 @@
 		{All tags in a changeset have to belong to the same LOD} \
 		{: Its tags disagree about the LOD they belong to} {
 		    SELECT T.name, C.cid
 		    FROM   changeset C, cstype T
 		    WHERE  C.cid IN (SELECT U.cid
-				     FROM (SELECT DISTINCT CR.cid AS cid, T.lod AS lod
-					   FROM   csrevision CR, changeset C, tag T
-					   WHERE  CR.rid = T.tid
-					   AND    C.cid = CR.cid
+				     FROM (SELECT DISTINCT CI.cid AS cid, T.lod AS lod
+					   FROM   csitem CI, changeset C, tag T
+					   WHERE  CI.iid = T.tid
+					   AND    C.cid = CI.cid
 					   AND    C.type = 1) AS U
 				     GROUP BY U.cid HAVING COUNT(U.lod) > 1)
 		    AND    T.tid = C.type
 		}
 	}
@@ -553,14 +553,14 @@
 	    {All tags in a changeset have to belong to the same project} \
 	    {: Its tags disagree about the project they belong to} {
 		SELECT T.name, C.cid
 		FROM   changeset C, cstype T
 		WHERE  C.cid IN (SELECT U.cid
-				 FROM (SELECT DISTINCT CR.cid AS cid, F.pid AS pid
-				       FROM   csrevision CR, changeset C, tag T, file F
-				       WHERE  CR.rid = T.tid
-				       AND    C.cid = CR.cid
+				 FROM (SELECT DISTINCT CI.cid AS cid, F.pid AS pid
+				       FROM   csitem CI, changeset C, tag T, file F
+				       WHERE  CI.iid = T.tid
+				       AND    C.cid = CI.cid
 				       AND    C.type = 1
 				       AND    F.fid  = T.fid) AS U
 				 GROUP BY U.cid HAVING COUNT(U.pid) > 1)
 		AND    T.tid = C.type
 	    }
@@ -578,19 +578,19 @@
 	    {: Its tags share files} {
 		SELECT T.name, C.cid
 		FROM   changeset C, cstype T
 		WHERE  C.cid IN (SELECT VV.cid
 				 FROM (SELECT U.cid as cid, COUNT (U.fid) AS fcount
-				       FROM (SELECT DISTINCT CR.cid AS cid, T.fid AS fid
-					     FROM   csrevision CR, changeset C, tag T
-					     WHERE  CR.rid = T.tid
-					     AND    C.cid = CR.cid
+				       FROM (SELECT DISTINCT CI.cid AS cid, T.fid AS fid
+					     FROM   csitem CI, changeset C, tag T
+					     WHERE  CI.iid = T.tid
+					     AND    C.cid = CI.cid
 					     AND    C.type = 1
 					     ) AS U
 				       GROUP BY U.cid) AS UU,
-				      (SELECT V.cid AS cid, COUNT (V.rid) AS rcount
-				       FROM   csrevision V, changeset X
+				      (SELECT V.cid AS cid, COUNT (V.iid) AS rcount
+				       FROM   csitem V, changeset X
 				       WHERE  X.cid = V.cid
 				       AND    X.type = 1
 				       GROUP BY V.cid) AS VV
 				 WHERE VV.cid = UU.cid
 				 AND   UU.fcount < VV.rcount)
@@ -622,13 +622,13 @@
 		SELECT P.name, S.name
 		FROM project P, branch B, symbol S
 		WHERE B.bid IN (SELECT bid                    -- All branches
 				FROM   branch
 				EXCEPT                        -- subtract
-				SELECT CR.rid                 -- branches used
-				FROM   csrevision CR, changeset C
-				WHERE  C.cid = CR.cid         -- by any branch
+				SELECT CI.iid                 -- branches used
+				FROM   csitem CI, changeset C
+				WHERE  C.cid = CI.cid         -- by any branch
 				AND    C.type = 2)            -- changeset
 		AND   S.sid = B.sid               -- get symbol of branch
 		AND   P.pid = S.pid               -- get project of symbol
 	    }
 	# Find all branches which are used by more than one changeset.
@@ -642,17 +642,17 @@
                 -- than one user, and get their associated file (name)
                 -- for display.
 
 		SELECT P.name, S.name
 		FROM branch B, project P, symbol S,
-		     (SELECT CR.rid AS rid, count(CR.cid) AS count
-		      FROM csrevision CR, changeset C
+		     (SELECT CI.iid AS iid, count(CI.cid) AS count
+		      FROM csitem CI, changeset C
 		      WHERE C.type = 2
-		      AND   C.cid = CR.cid
-		      GROUP BY CR.rid ) AS U
+		      AND   C.cid = CI.cid
+		      GROUP BY CI.iid ) AS U
 		WHERE U.count > 1
-		AND   B.bid = U.rid
+		AND   B.bid = U.iid
 		AND   S.sid = B.sid               -- get symbol of branch
 		AND   P.pid = S.pid               -- get project of symbol
 	    }
 	# All branches have to agree on the LOD their changeset
 	# belongs to. In other words, all branches in a changeset have
@@ -667,14 +667,14 @@
 	    {All branches in a changeset have to belong to the same LOD} \
 	    {: Its branches disagree about the LOD they belong to} {
 		SELECT T.name, C.cid
 		FROM   changeset C, cstype T
 		WHERE  C.cid IN (SELECT U.cid
-				 FROM (SELECT DISTINCT CR.cid AS cid, B.lod AS lod
-				       FROM   csrevision CR, changeset C, branch B
-				       WHERE  CR.rid = B.bid
-				       AND    C.cid = CR.cid
+				 FROM (SELECT DISTINCT CI.cid AS cid, B.lod AS lod
+				       FROM   csitem CI, changeset C, branch B
+				       WHERE  CI.iid = B.bid
+				       AND    C.cid = CI.cid
 				       AND    C.type = 2) AS U
 				 GROUP BY U.cid HAVING COUNT(U.lod) > 1)
 		AND    T.tid = C.type
 	    }
 	# All branches have to agree on the project their changeset
@@ -690,14 +690,14 @@
 	    {All branches in a changeset have to belong to the same project} \
 	    {: Its branches disagree about the project they belong to} {
 		SELECT T.name, C.cid
 		FROM   changeset C, cstype T
 		WHERE  C.cid IN (SELECT U.cid
-				 FROM (SELECT DISTINCT CR.cid AS cid, F.pid AS pid
-				       FROM   csrevision CR, changeset C, branch B, file F
-				       WHERE  CR.rid = B.bid
-				       AND    C.cid = CR.cid
+				 FROM (SELECT DISTINCT CI.cid AS cid, F.pid AS pid
+				       FROM   csitem CI, changeset C, branch B, file F
+				       WHERE  CI.iid = B.bid
+				       AND    C.cid = CI.cid
 				       AND    C.type = 2
 				       AND    F.fid  = B.fid) AS U
 				 GROUP BY U.cid HAVING COUNT(U.pid) > 1)
 		AND    T.tid = C.type
 	    }
@@ -716,19 +716,19 @@
 	    {: Its branches share files} {
 		SELECT T.name, C.cid
 		FROM   changeset C, cstype T
 		WHERE  C.cid IN (SELECT VV.cid
 				 FROM (SELECT U.cid as cid, COUNT (U.fid) AS fcount
-				       FROM (SELECT DISTINCT CR.cid AS cid, B.fid AS fid
-					     FROM   csrevision CR, changeset C, branch B
-					     WHERE  CR.rid = B.bid
-					     AND    C.cid = CR.cid
+				       FROM (SELECT DISTINCT CI.cid AS cid, B.fid AS fid
+					     FROM   csitem CI, changeset C, branch B
+					     WHERE  CI.iid = B.bid
+					     AND    C.cid = CI.cid
 					     AND    C.type = 2
 					     ) AS U
 				       GROUP BY U.cid) AS UU,
-				      (SELECT V.cid AS cid, COUNT (V.rid) AS rcount
-				       FROM   csrevision V, changeset X
+				      (SELECT V.cid AS cid, COUNT (V.iid) AS rcount
+				       FROM   csitem V, changeset X
 				       WHERE  X.cid = V.cid
 				       AND    X.type = 2
 				       GROUP BY V.cid) AS VV
 				 WHERE VV.cid = UU.cid
 				 AND   UU.fcount < VV.rcount)
@@ -757,15 +757,15 @@
 	# changeset's tag associated with them.
 	CheckRevCS \
 	    {All revisions used by tag symbol changesets have to have the changeset's tag attached to them} \
 	    {does not have the tag of its symbol changeset @ attached to it} {
 		SELECT CT.name, C.cid, F.name, R.rev
-		FROM   changeset C, cstype CT, revision R, file F, csrevision CR, tag T
+		FROM   changeset C, cstype CT, revision R, file F, csitem CI, tag T
 		WHERE  C.type = 1       -- symbol changesets only
 		AND    C.src  = T.sid   -- tag only, linked by symbol id
-		AND    C.cid  = CR.cid  -- changeset --> its revisions
-		AND    R.rid  = CR.rid  -- look at the revisions
+		AND    C.cid  = CI.cid  -- changeset --> its revisions
+		AND    R.rid  = CI.iid  -- look at the revisions
 		-- and look for the tag among the attached ones.
 		AND    T.sid NOT IN (SELECT TB.sid
 				     FROM   tag TB
 				     WHERE  TB.rev = R.rid)
 		AND    R.fid = F.fid    -- get file of revision
@@ -776,15 +776,15 @@
 
 	CheckRevCS \
 	    {All revisions used by branch symbol changesets have to have the changeset's branch attached to them} \
 	    {does not have the branch of its symbol changeset @ attached to it} {
 		SELECT CT.name, C.cid, F.name, R.rev, C.cid
-		FROM   changeset C, cstype CT, revision R, file F, csrevision CR, branch B
+		FROM   changeset C, cstype CT, revision R, file F, csitem CI, branch B
 		WHERE  C.type = 1       -- symbol changesets only
 		AND    C.src  = B.sid   -- branches only
-		AND    C.cid  = CR.cid  -- changeset --> its revisions
-		AND    R.rid  = CR.rid  -- look at the revisions
+		AND    C.cid  = CI.cid  -- changeset --> its revisions
+		AND    R.rid  = CI.iid  -- look at the revisions
 		-- and look for the branch among the attached ones.
 		AND    B.sid NOT IN (SELECT BB.sid
 				     FROM   branch BB
 				     WHERE  BB.root = R.rid)
 		AND    R.fid = F.fid    -- get file of revision

Modified tools/cvs2fossil/lib/c2f_pbreakacycle.tcl from [a5b0f59e73] to [da5cab23e3].

@@ -50,11 +50,11 @@
     typemethod setup {} {
 	# Define the names and structure of the persistent state of
 	# this pass.
 
 	state reading changeset
-	state reading csrevision
+	state reading csitem
 	state reading csorder
 	return
     }
 
     typemethod load {} {

Modified tools/cvs2fossil/lib/c2f_pbreakrcycle.tcl from [630bffc4ad] to [4ea6d5327b].

@@ -47,11 +47,11 @@
 	# Define the names and structure of the persistent state of
 	# this pass.
 
 	state reading revision
 	state reading changeset
-	state reading csrevision
+	state reading csitem
 	return
     }
 
     typemethod load {} {
 	# Pass manager interface. Executed to load data computed by

Modified tools/cvs2fossil/lib/c2f_pbreakscycle.tcl from [87397f0522] to [aa112553ed].

@@ -46,11 +46,11 @@
 	# Define the names and structure of the persistent state of
 	# this pass.
 
 	state reading revision
 	state reading changeset
-	state reading csrevision
+	state reading csitem
 	return
     }
 
     typemethod load {} {
 	# Pass manager interface. Executed to load data computed by

Modified tools/cvs2fossil/lib/c2f_pinitcsets.tcl from [37a8f5de58] to [b1c3a78eda].

@@ -87,16 +87,16 @@
 	# from disparate sources the same id may have different
 	# meaning, be in different changesets and so is formally not
 	# unique. So we can only say that it is unique within the
 	# changeset. The integrity module has stronger checks.
 
-	state writing csrevision {
+	state writing csitem {
 	    cid  INTEGER  NOT NULL  REFERENCES changeset,
 	    pos  INTEGER  NOT NULL,
-	    rid  INTEGER  NOT NULL, -- REFERENCES revision|tag|branch
+	    iid  INTEGER  NOT NULL, -- REFERENCES revision|tag|branch
 	    UNIQUE (cid, pos),
-	    UNIQUE (cid, rid)
+	    UNIQUE (cid, iid)
 	}
 
 	project::rev getcstypes
 	return
     }
@@ -105,11 +105,11 @@
 	# Pass manager interface. Executed to load data computed by
 	# this pass into memory when this pass is skipped instead of
 	# executed.
 
 	state reading changeset
-	state reading csrevision
+	state reading csitem
 	state reading cstype
 
 	# Need the types first, the constructor in the loop below uses
 	# them to assert the correctness of type names.
 	project::rev getcstypes
@@ -119,14 +119,14 @@
 	    FROM   changeset C, cstype CS
 	    WHERE  C.type = CS.tid
 	    ORDER BY C.cid
 	}] {
 	    set r [project::rev %AUTO% [repository projectof $pid] $cstype $srcid [state run {
-		SELECT C.rid
-		FROM   csrevision C
+		SELECT C.iid
+		FROM   csitem C
 		WHERE  C.cid = $id
-		ORDER  BY C.pos
+		ORDER BY C.pos
 	    }] $id]
 	}
 
 	project::rev loadcounter
 	return
@@ -153,11 +153,11 @@
 	# run passes, to remove all data of this pass from the state,
 	# as being out of date.
 
 	state discard changeset
 	state discard cstype
-	state discard csrevision
+	state discard csitem
 	return
     }
 
     # # ## ### ##### ######## #############
     ## Internal methods

Modified tools/cvs2fossil/lib/c2f_prev.tcl from [f84e4346da] to [1c3ee2d518].

@@ -301,12 +301,12 @@
 		VALUES                ($myid, $pid, $tid, $mysrcid);
 	    }
 
 	    foreach iid $myitems {
 		state run {
-		    INSERT INTO csrevision (cid,   pos,  rid)
-		    VALUES                 ($myid, $pos, $iid);
+		    INSERT INTO csitem (cid,   pos,  iid)
+		    VALUES             ($myid, $pos, $iid);
 		}
 		incr pos
 	    }
 	}
 	return
@@ -315,12 +315,12 @@
     method timerange {} { return [$mytypeobj timerange $myitems] }
 
     method drop {} {
 	state transaction {
 	    state run {
-		DELETE FROM changeset  WHERE cid = $myid;
-		DELETE FROM csrevision WHERE cid = $myid;
+		DELETE FROM changeset WHERE cid = $myid;
+		DELETE FROM csitem    WHERE cid = $myid;
 	    }
 	}
 	foreach iid $myitems {
 	    set key [list $mytype $iid]
 	    unset myitemmap($key)

Modified tools/cvs2fossil/lib/c2f_prtopsort.tcl from [ef7809d056] to [b280cf33d2].

@@ -45,11 +45,11 @@
 	# Define the names and structure of the persistent state of
 	# this pass.
 
 	state reading revision
 	state reading changeset
-	state reading csrevision
+	state reading csitem
 
 	state writing csorder {
 	    -- Commit order of the revision changesets based on their
 	    -- dependencies