Diff
Not logged in

Differences From:

File tools/cvs2fossil/lib/c2f_pcollrev.tcl part of check-in [7eaa420a23] - Extended options processing to handle --exclude, --force-tag, and --force-branch options. Extended project::sym class with in-memkory databases to hold the option information and replaced the 'UserConfig' placeholder with the actual code using the new databases to determine symbol types based on user-requests. Extended the pass itself with code performing various checks on the results of type determination, partially paranoia, partially to find genuine bad requests (excluding symbols with unexcluded blockers, making a symbol with commits on it a tag, ...). NYI: Computation of the prefered parent for all symbols. by aku on 2007-11-05 09:04:25. [view]

To:

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]

@@ -133,23 +133,33 @@
 	    -- 'meta'. The date/time is given in seconds since the
 	    -- epoch, for easy comparison. The text content is an
 	    -- (offset,length) pair into the rcs archive.
 
-	    op    INTEGER  NOT NULL,
+	    op    INTEGER  NOT NULL  REFERENCES optype,
 	    date  INTEGER  NOT NULL,
 	    state TEXT     NOT NULL,
-	    mid   INTEGER  NOT NULL REFERENCES meta,
+	    mid   INTEGER  NOT NULL  REFERENCES meta,
 	    coff  INTEGER  NOT NULL,
 	    clen  INTEGER  NOT NULL,
 
 	    UNIQUE (fid, rev) -- The DTN is unique within the revision's file.
 	}
-
+	state writing optype {
+	    oid   INTEGER  NOT NULL  PRIMARY KEY,
+	    name  TEXT     NOT NULL,
+	    UNIQUE(text)
+	}
+	# Keep optype in sync with file::rev.myopcode
+	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');
+	}
 	state writing 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
 
 	    rev  INTEGER  NOT NULL  REFERENCES revision  -- The revision being tagged.
 	}
@@ -157,14 +167,14 @@
 	state writing 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
 
 	    root  INTEGER  NOT NULL  REFERENCES revision, -- Revision the branch sprouts from
 	    first INTEGER            REFERENCES revision, -- First revision committed to the branch
-	    bra   TEXT     NOT NULL                       -- branch number
+	    bra   TEXT     NOT NULL,                      -- branch number
+	    pos   INTEGER  NOT NULL                       -- creation order in root.
 	}
 
 	# Project level ...
 	#	pLineOfDevelopment, pSymbol, pBranch, pTag, pTrunk
@@ -212,12 +222,12 @@
 	    UNIQUE (name)
 	    UNIQUE (plural)
 	}
 	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');
+	    INSERT INTO symtype VALUES (0,'excluded', 'excluded');
+	    INSERT INTO symtype VALUES (1,'tag',      'tags');
+	    INSERT INTO symtype VALUES (2,'branch',   'branches');
+	    INSERT INTO symtype VALUES (3,'undefined','undefined');
 	}
 
 	state writing meta {
 	    -- Meta data of revisions. See revision.mid for the