Diff
Not logged in

Differences From Artifact [38ef86c838]:

To Artifact [a41e2628dd]:


54
55
56
57
58
59
60
61

62

63
64
65
66




67
68
69
70
71
72
73
74
75
76
77


78
79

80
81
82
83
84

85
86
87
88
89
90
91
92
93
94
95
96



















97
98
99

100
101
102






103
104
105

106



107

108
109
110
111
112
113
114
54
55
56
57
58
59
60

61
62
63




64
65
66
67











68
69


70





71
72
73
74
75
76







77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99



100
101
102
103
104
105
106
107
108
109

110
111
112
113
114
115
116
117
118
119
120
121







-
+

+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
-
-
-
-
-
+





-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+



+
-
-
-
+
+
+
+
+
+



+
-
+
+
+

+








	# Per file we have general information, ..., and then
	# revisions and symbols. The latter can be further separated
	# into tags and branches. At project level the per-file
	# symbols information is merged.

	# File level ...
	#	Event, Revision, Symbol, Branch, Tag
	#	Revisions, Branches, Tags
	#
	# Pseudo class hierarchy
	#	Tag    <- Symbol <- Event
	#	Branch <- Symbol <- Event
	#	Revision <- Event
	#
	#	Tag      <- Symbol <- Event
	#	Branch   <- Symbol <- Event
	#	Revision           <- Event

	#	Head revision, Principal branch, Comment

	state writing rcs {
	    fid       INTEGER  NOT NULL  REFERENCES file,    -- RCS inherit from FILE
	    head      INTEGER  NOT NULL  REFERENCES revision,
	    principal INTEGER  NOT NULL  REFERENCES branch,
	    comment   TEXT     NOT NULL
	}

	state writing item {
	    iid  INTEGER  NOT NULL  PRIMARY KEY AUTOINCREMENT,
	state writing revision {
	    rid  INTEGER  NOT NULL  PRIMARY KEY AUTOINCREMENT,
	    type INTEGER  NOT NULL,                 -- enum { tag = 1, branch, revision }
	    fid  INTEGER  NOT NULL  REFERENCES file  -- File the item belongs to
	    fid  INTEGER  NOT NULL  REFERENCES file,   -- File the item belongs to
	}

	state writing revision {
	    iid   INTEGER  NOT NULL  REFERENCES item,   -- REVISION inherit from ITEM
	    lod   INTEGER  NOT NULL  REFERENCES symbol, -- Line of development
	    lod  INTEGER            REFERENCES symbol, -- Line of development (NULL => Trunk)

	    -- The tags and branches belonging to a revision can be
	    -- determined by selecting on the backreferences in the
	    -- tag and branch tables.

	    rev   TEXT     NOT NULL,                     -- revision number
	    date  INTEGER  NOT NULL,                     -- date of entry, seconds since epoch
	    state TEXT     NOT NULL,                     -- state of revision
	    mid   INTEGER  NOT NULL REFERENCES meta,     -- meta data (author, commit message)
	    next  INTEGER  NOT NULL REFERENCES revision, -- next in chain of revisions.
	    cs    INTEGER  NOT NULL, -- Revision content as offset and length
	    cl    INTEGER  NOT NULL  -- into the archive file.
	    rev   TEXT     NOT NULL,                 -- revision number
	    date  INTEGER  NOT NULL,                 -- date of entry, seconds since epoch
	    state TEXT     NOT NULL,                 -- state of revision
	    mid   INTEGER  NOT NULL REFERENCES meta, -- meta data (author, commit message)
	    cs    INTEGER  NOT NULL,                 -- Revision content as offset and
	    cl    INTEGER  NOT NULL,                 -- length into the archive file.

	    -- Derived information, and links
	    -- Basic: Parent/Child
	    -- NTDB:  DefaultParent/DefaultChild
	    -- Branches: Branch parent revision

	    op        INTEGER NOT NULL,
	    isdefault INTEGER NOT NULL,
	    parent    INTEGER        REFERENCES revision,
	    child     INTEGER        REFERENCES revision,
	    dbparent  INTEGER        REFERENCES revision,
	    dbchild   INTEGER        REFERENCES revision,
	    bparent   INTEGER        REFERENCES symbol
	}

	state writing tag {
	    tid  INTEGER  NOT NULL  PRIMARY KEY AUTOINCREMENT,
	    iid INTEGER  NOT NULL  REFERENCES item,     -- TAG inherit from ITEM
	    sid INTEGER  NOT NULL  REFERENCES symbol,   -- Symbol capturing the tag
	    rev INTEGER  NOT NULL  REFERENCES revision -- The revision being tagged.
	    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.
	}

	state writing branch {
	    bid   INTEGER  NOT NULL  PRIMARY KEY AUTOINCREMENT,
	    iid   INTEGER  NOT NULL  REFERENCES item,     -- BRANCH inherit from ITEM
	    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
	}

	# It is in principle possible to collapse the four tables
	# above (from item to barnch) into a single table, with
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220









221
222



223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
212
213
214
215
216
217
218









219
220
221
222
223
224
225
226
227
228

229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247


248
249
250
251
252
253
254







-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+

-
+
+
+
















-
-







		    global errorCode
		    if {$errorCode eq "vc::rcs::parser"} {
			trouble fatal "$path is not a valid RCS archive ($msg)"
		    } else {
			global errorInfo
			trouble internal $errorInfo
		    }
		}

		# We persist the core of the data collected about each
		# file immediately after it has been parsed and
		# wrangled into shape, and then drop it from
		# memory. This is done to keep the memory requirements
		# within limits, i.e. without doing it this way it is
		# easy to blow 1G of RAM with all the objects
		# (revisions and file-level symbols).
		} else {
		    # We persist the core of the data collected about
		    # each file immediately after it has been parsed
		    # and wrangled into shape, and then drop it from
		    # memory. This is done to keep the amount of
		    # required memory within sensible limits. Without
		    # doing it this way we would easily gobble up 1G
		    # of RAM or more with all the objects (revisions
		    # and file-level symbols).

		$file persist
		    $file persist
		}

		$file drop
	    }
	}

	repository printrevstatistics
	repository persistrev

	log write 1 collrev "Scan completed"
	return
    }

    typemethod discard {} {
	# Pass manager interface. Executed for all passes after the
	# run passes, to remove all data of this pass from the state,
	# as being out of date.

	state discard rcs
	state discard item
	state discard revision
	state discard tag
	state discard branch
	state discard symbol
	state discard blocker
	state discard parent
	state discard meta