Fossil SCM

Changed the coding of trunk symbols. Using NULL makes for difficult comparisons later when doing integrity checks. Each trunk now has a regular unique id as a symbol. Added documentation to the table definitions, about references, constraints, etc.

aku 2007-10-25 05:13 trunk
Commit 2c08006d9dcaf2e0ed0eb04d23e3083d7d55d6a6
--- tools/cvs2fossil/lib/c2f_frev.tcl
+++ tools/cvs2fossil/lib/c2f_frev.tcl
@@ -343,26 +343,26 @@
343343
344344
# # ## ### ##### ######## #############
345345
346346
method persist {} {
347347
set fid [$myfile id]
348
+ set lod [$mylod id]
348349
set op $myopcode($myoperation)
349350
set idb $myisondefaultbranch
350351
351
- struct::list assign $mytext cs cl
352
- set cl [expr {$cl - $cs}]
352
+ struct::list assign $mytext coff end
353
+ set clen [expr {$end - $coff}]
353354
354
- lappend map @L@ [expr { [$mylod istrunk] ? "NULL" : [$mylod id] }]
355355
lappend map @P@ [expr { ($myparent eq "") ? "NULL" : [$myparent id] }]
356356
lappend map @C@ [expr { ($mychild eq "") ? "NULL" : [$mychild id] }]
357357
lappend map @DP [expr { ($mydbparent eq "") ? "NULL" : [$mydbparent id] }]
358358
lappend map @DC [expr { ($mydbchild eq "") ? "NULL" : [$mydbchild id] }]
359359
lappend map @BP [expr { ($myparentbranch eq "") ? "NULL" : [$myparentbranch id] }]
360360
361361
set cmd {
362
- INSERT INTO revision ( rid, fid, lod, rev, date, state, mid, cs, cl, op, isdefault, parent, child, dbparent, dbchild, bparent)
363
- VALUES ($myid, $fid, @L@, $myrevnr, $mydate, $mystate, $mymetaid, $cs, $cl, $op, $idb, @P@, @C@, @DP, @DC, @BP);
362
+ INSERT INTO revision ( rid, fid, rev, lod, parent, child, isdefault, dbparent, dbchild, bparent, op, date, state, mid, coff, clen)
363
+ VALUES ($myid, $fid, $myrevnr, $lod, @P@, @C@, $idb, @DP, @DC, @BP , $op, $mydate, $mystate, $mymetaid, $coff, $clen);
364364
}
365365
366366
state transaction {
367367
state run [string map $map $cmd]
368368
}
369369
--- tools/cvs2fossil/lib/c2f_frev.tcl
+++ tools/cvs2fossil/lib/c2f_frev.tcl
@@ -343,26 +343,26 @@
343
344 # # ## ### ##### ######## #############
345
346 method persist {} {
347 set fid [$myfile id]
 
348 set op $myopcode($myoperation)
349 set idb $myisondefaultbranch
350
351 struct::list assign $mytext cs cl
352 set cl [expr {$cl - $cs}]
353
354 lappend map @L@ [expr { [$mylod istrunk] ? "NULL" : [$mylod id] }]
355 lappend map @P@ [expr { ($myparent eq "") ? "NULL" : [$myparent id] }]
356 lappend map @C@ [expr { ($mychild eq "") ? "NULL" : [$mychild id] }]
357 lappend map @DP [expr { ($mydbparent eq "") ? "NULL" : [$mydbparent id] }]
358 lappend map @DC [expr { ($mydbchild eq "") ? "NULL" : [$mydbchild id] }]
359 lappend map @BP [expr { ($myparentbranch eq "") ? "NULL" : [$myparentbranch id] }]
360
361 set cmd {
362 INSERT INTO revision ( rid, fid, lod, rev, date, state, mid, cs, cl, op, isdefault, parent, child, dbparent, dbchild, bparent)
363 VALUES ($myid, $fid, @L@, $myrevnr, $mydate, $mystate, $mymetaid, $cs, $cl, $op, $idb, @P@, @C@, @DP, @DC, @BP);
364 }
365
366 state transaction {
367 state run [string map $map $cmd]
368 }
369
--- tools/cvs2fossil/lib/c2f_frev.tcl
+++ tools/cvs2fossil/lib/c2f_frev.tcl
@@ -343,26 +343,26 @@
343
344 # # ## ### ##### ######## #############
345
346 method persist {} {
347 set fid [$myfile id]
348 set lod [$mylod id]
349 set op $myopcode($myoperation)
350 set idb $myisondefaultbranch
351
352 struct::list assign $mytext coff end
353 set clen [expr {$end - $coff}]
354
 
355 lappend map @P@ [expr { ($myparent eq "") ? "NULL" : [$myparent id] }]
356 lappend map @C@ [expr { ($mychild eq "") ? "NULL" : [$mychild id] }]
357 lappend map @DP [expr { ($mydbparent eq "") ? "NULL" : [$mydbparent id] }]
358 lappend map @DC [expr { ($mydbchild eq "") ? "NULL" : [$mydbchild id] }]
359 lappend map @BP [expr { ($myparentbranch eq "") ? "NULL" : [$myparentbranch id] }]
360
361 set cmd {
362 INSERT INTO revision ( rid, fid, rev, lod, parent, child, isdefault, dbparent, dbchild, bparent, op, date, state, mid, coff, clen)
363 VALUES ($myid, $fid, $myrevnr, $lod, @P@, @C@, $idb, @DP, @DC, @BP , $op, $mydate, $mystate, $mymetaid, $coff, $clen);
364 }
365
366 state transaction {
367 state run [string map $map $cmd]
368 }
369
--- tools/cvs2fossil/lib/c2f_fsym.tcl
+++ tools/cvs2fossil/lib/c2f_fsym.tcl
@@ -121,35 +121,36 @@
121121
# can also get rid of 'sortbranches' (cvs::file) and the
122122
# associated information.
123123
124124
set fid [$myfile id]
125125
set sid [$mysymbol id]
126
-
127
- lappend map @L@ [expr { [$mylod istrunk] ? "NULL" : [$mylod id] }]
126
+ set lod [$mylod id]
128127
129128
switch -exact -- $mytype {
130129
tag {
131130
set rid [$mytagrev id]
132
- set cmd {
133
- INSERT INTO tag ( tid, fid, lod, sid, rev)
134
- VALUES ($myid, $fid, @L@, $sid, $rid);
131
+ state transaction {
132
+ state run {
133
+ INSERT INTO tag ( tid, fid, lod, sid, rev)
134
+ VALUES ($myid, $fid, $lod, $sid, $rid);
135
+ }
135136
}
136137
}
137138
branch {
138139
lappend map @F@ [expr { ($mybranchchild eq "") ? "NULL" : [$mybranchchild id] }]
139140
140141
set rid [$mybranchparent id]
141142
set cmd {
142
- INSERT INTO branch ( bid, fid, lod, sid, root, first, bra )
143
- VALUES ($myid, $fid, @L@, $sid, $rid, @F@, $mynr);
143
+ INSERT INTO branch ( bid, fid, lod, sid, root, first, bra )
144
+ VALUES ($myid, $fid, $lod, $sid, $rid, @F@, $mynr);
145
+ }
146
+ state transaction {
147
+ state run [string map $map $cmd]
144148
}
145149
}
146150
}
147151
148
- state transaction {
149
- state run [string map $map $cmd]
150
- }
151152
return
152153
}
153154
154155
# # ## ### ##### ######## #############
155156
## State
156157
--- tools/cvs2fossil/lib/c2f_fsym.tcl
+++ tools/cvs2fossil/lib/c2f_fsym.tcl
@@ -121,35 +121,36 @@
121 # can also get rid of 'sortbranches' (cvs::file) and the
122 # associated information.
123
124 set fid [$myfile id]
125 set sid [$mysymbol id]
126
127 lappend map @L@ [expr { [$mylod istrunk] ? "NULL" : [$mylod id] }]
128
129 switch -exact -- $mytype {
130 tag {
131 set rid [$mytagrev id]
132 set cmd {
133 INSERT INTO tag ( tid, fid, lod, sid, rev)
134 VALUES ($myid, $fid, @L@, $sid, $rid);
 
 
135 }
136 }
137 branch {
138 lappend map @F@ [expr { ($mybranchchild eq "") ? "NULL" : [$mybranchchild id] }]
139
140 set rid [$mybranchparent id]
141 set cmd {
142 INSERT INTO branch ( bid, fid, lod, sid, root, first, bra )
143 VALUES ($myid, $fid, @L@, $sid, $rid, @F@, $mynr);
 
 
 
144 }
145 }
146 }
147
148 state transaction {
149 state run [string map $map $cmd]
150 }
151 return
152 }
153
154 # # ## ### ##### ######## #############
155 ## State
156
--- tools/cvs2fossil/lib/c2f_fsym.tcl
+++ tools/cvs2fossil/lib/c2f_fsym.tcl
@@ -121,35 +121,36 @@
121 # can also get rid of 'sortbranches' (cvs::file) and the
122 # associated information.
123
124 set fid [$myfile id]
125 set sid [$mysymbol id]
126 set lod [$mylod id]
 
127
128 switch -exact -- $mytype {
129 tag {
130 set rid [$mytagrev id]
131 state transaction {
132 state run {
133 INSERT INTO tag ( tid, fid, lod, sid, rev)
134 VALUES ($myid, $fid, $lod, $sid, $rid);
135 }
136 }
137 }
138 branch {
139 lappend map @F@ [expr { ($mybranchchild eq "") ? "NULL" : [$mybranchchild id] }]
140
141 set rid [$mybranchparent id]
142 set cmd {
143 INSERT INTO branch ( bid, fid, lod, sid, root, first, bra )
144 VALUES ($myid, $fid, $lod, $sid, $rid, @F@, $mynr);
145 }
146 state transaction {
147 state run [string map $map $cmd]
148 }
149 }
150 }
151
 
 
 
152 return
153 }
154
155 # # ## ### ##### ######## #############
156 ## State
157
--- tools/cvs2fossil/lib/c2f_pcollrev.tcl
+++ tools/cvs2fossil/lib/c2f_pcollrev.tcl
@@ -64,37 +64,87 @@
6464
# Tag <- Symbol <- Event
6565
# Branch <- Symbol <- Event
6666
# Revision <- Event
6767
6868
state writing revision {
69
+ -- Revisions. Identified by a global numeric id each
70
+ -- belongs to a single file, identified by its id. It
71
+ -- further has a dotted revision number (DTN).
72
+ --
73
+ -- Constraint: The dotted revision number is unique within
74
+ -- the file. See end of definition.
75
+
6976
rid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
70
- fid INTEGER NOT NULL REFERENCES file, -- File the item belongs to
71
- lod INTEGER REFERENCES symbol, -- Line of development (NULL => Trunk)
72
-
73
- -- The tags and branches belonging to a revision can be
74
- -- determined by selecting on the backreferences in the
75
- -- tag and branch tables.
76
-
77
- rev TEXT NOT NULL, -- revision number
78
- date INTEGER NOT NULL, -- date of entry, seconds since epoch
79
- state TEXT NOT NULL, -- state of revision
80
- mid INTEGER NOT NULL REFERENCES meta, -- meta data (author, commit message)
81
- cs INTEGER NOT NULL, -- Revision content as offset and
82
- cl INTEGER NOT NULL, -- length into the archive file.
83
-
84
- -- Derived information, and links
85
- -- Basic: Parent/Child
86
- -- NTDB: DefaultParent/DefaultChild
87
- -- Branches: Branch parent revision
88
-
89
- op INTEGER NOT NULL,
90
- isdefault INTEGER NOT NULL,
91
- parent INTEGER REFERENCES revision,
92
- child INTEGER REFERENCES revision,
93
- dbparent INTEGER REFERENCES revision,
94
- dbchild INTEGER REFERENCES revision,
95
- bparent INTEGER REFERENCES symbol
77
+ fid INTEGER NOT NULL REFERENCES file, -- File owning revision.
78
+ rev TEXT NOT NULL, -- Dotted Rev Number.
79
+
80
+ -- All revisions belong to a line-of-development,
81
+ -- identified by a symbol (project level). During data
82
+ -- collection it was a file-level branch symbol.
83
+ --
84
+ -- Constraint: All the LOD symbols are in the same project
85
+ -- as the file itself. This cannot be
86
+ -- expressed in CREATE TABLE syntax.
87
+
88
+ lod INTEGER NOT NULL REFERENCES symbol, -- Line of development
89
+
90
+ -- The revisions in a file are organized in a forest of
91
+ -- trees, with the main lines defined through the parent /
92
+ -- child references. A revision without a parent is the
93
+ -- root of a tree, and a revision without a child is a
94
+ -- leaf.
95
+
96
+ -- Constraints: All revisions coupled through parent/child
97
+ -- refer to the same LOD symbol. The parent
98
+ -- of a child of X is X. The child of a
99
+ -- parent of X is X.
100
+
101
+ parent INTEGER REFERENCES revision,
102
+ child INTEGER REFERENCES revision,
103
+
104
+ -- The representation of a branch in a tree is the
105
+ -- exception to the three constraints above.
106
+
107
+ -- The beginning of a branch is represented by a non-NULL
108
+ -- bparent of a revision. This revision B is the first on
109
+ -- the branch. Its parent P is the revision the branch is
110
+ -- rooted in, and it is not the child of P. B and P refer
111
+ -- to different LOD symbols. The bparent of B is also its
112
+ -- LOD, and the LOD of its children.
113
+
114
+ bparent INTEGER REFERENCES symbol,
115
+
116
+ -- Lastly we keep information is about non-trunk default
117
+ -- branches (NTDB) in the revisions.
118
+
119
+ -- All revisions on the NTDB have 'isdefault' TRUE,
120
+ -- everyone else FALSE. The last revision X on the NTDB
121
+ -- which is still considered to be on the trunk as well
122
+ -- has a non-NULL 'dbchild' which refers to the root of
123
+ -- the trunk. The root also has a non-NULL dbparent
124
+ -- refering to X.
125
+
126
+ isdefault INTEGER NOT NULL,
127
+ dbparent INTEGER REFERENCES revision,
128
+ dbchild INTEGER REFERENCES revision,
129
+
130
+ -- The main payload of the revision are the date/time it
131
+ -- was entered, its state, operation (= type/class), text
132
+ -- content, and meta data (author, log message, branch,
133
+ -- project). The last is encoded as single id, see table
134
+ -- 'meta'. The date/time is given in seconds since the
135
+ -- epoch, for easy comparison. The text content is an
136
+ -- (offset,length) pair into the rcs archive.
137
+
138
+ op INTEGER NOT NULL,
139
+ date INTEGER NOT NULL,
140
+ state TEXT NOT NULL,
141
+ mid INTEGER NOT NULL REFERENCES meta,
142
+ coff INTEGER NOT NULL,
143
+ clen INTEGER NOT NULL,
144
+
145
+ UNIQUE (fid, rev) -- The DTN is unique within the revision's file.
96146
}
97147
98148
state writing tag {
99149
tid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
100150
fid INTEGER NOT NULL REFERENCES file, -- File the item belongs to
@@ -155,20 +205,39 @@
155205
pid INTEGER NOT NULL REFERENCES symbol, -- Possible parent of sid
156206
UNIQUE (sid, pid)
157207
}
158208
159209
state writing meta {
210
+ -- Meta data of revisions. See revision.mid for the
211
+ -- reference. Many revisions can share meta data. This is
212
+ -- actually one of the criterions used to sort revisions
213
+ -- into changesets.
214
+
160215
mid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
161
- pid INTEGER NOT NULL REFERENCES project, -- project the commit was on
162
- bid INTEGER REFERENCES symbol, -- branch the commit was on, NULL for :trunk:
163
- aid INTEGER NOT NULL REFERENCES author,
164
- cid INTEGER NOT NULL REFERENCES cmessage,
216
+
217
+ -- Meta data belongs to a specific project, stronger, to a
218
+ -- branch in that project. It further has a log message,
219
+ -- and its author. This is unique with the project and
220
+ -- branch.
221
+
222
+ pid INTEGER NOT NULL REFERENCES project, --
223
+ bid INTEGER NOT NULL REFERENCES symbol, --
224
+ aid INTEGER NOT NULL REFERENCES author, --
225
+ cid INTEGER NOT NULL REFERENCES cmessage, --
226
+
165227
UNIQUE (pid, bid, aid, cid)
228
+
229
+ -- Constraints: The project of the meta data of a revision
230
+ -- X is the same as the project of X itself.
231
+ --
232
+ -- ............ The branch of the meta data of a revision
233
+ -- X is the same as the line of development
234
+ -- of X itself.
166235
}
167236
168
- # Author and commit message information is fully global,
169
- # i.e. per repository.
237
+ # Authors and commit messages are fully global, i.e. per
238
+ # repository.
170239
171240
state writing author {
172241
aid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
173242
name TEXT NOT NULL UNIQUE
174243
}
@@ -176,18 +245,10 @@
176245
state writing cmessage {
177246
cid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
178247
text TEXT NOT NULL UNIQUE
179248
}
180249
181
- # Consistency constraints.
182
- #
183
- # Items (Tags, Branches, Revisions) belong to a file to a
184
- # project. All refer to other items, and symbols, which again
185
- # belong to a project. The projects have to agree with each
186
- # other. I.e. items may not refer to items or symbols which
187
- # belong to a different project than their own.
188
-
189250
return
190251
}
191252
192253
typemethod load {} {
193254
# TODO
194255
--- tools/cvs2fossil/lib/c2f_pcollrev.tcl
+++ tools/cvs2fossil/lib/c2f_pcollrev.tcl
@@ -64,37 +64,87 @@
64 # Tag <- Symbol <- Event
65 # Branch <- Symbol <- Event
66 # Revision <- Event
67
68 state writing revision {
 
 
 
 
 
 
 
69 rid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
70 fid INTEGER NOT NULL REFERENCES file, -- File the item belongs to
71 lod INTEGER REFERENCES symbol, -- Line of development (NULL => Trunk)
72
73 -- The tags and branches belonging to a revision can be
74 -- determined by selecting on the backreferences in the
75 -- tag and branch tables.
76
77 rev TEXT NOT NULL, -- revision number
78 date INTEGER NOT NULL, -- date of entry, seconds since epoch
79 state TEXT NOT NULL, -- state of revision
80 mid INTEGER NOT NULL REFERENCES meta, -- meta data (author, commit message)
81 cs INTEGER NOT NULL, -- Revision content as offset and
82 cl INTEGER NOT NULL, -- length into the archive file.
83
84 -- Derived information, and links
85 -- Basic: Parent/Child
86 -- NTDB: DefaultParent/DefaultChild
87 -- Branches: Branch parent revision
88
89 op INTEGER NOT NULL,
90 isdefault INTEGER NOT NULL,
91 parent INTEGER REFERENCES revision,
92 child INTEGER REFERENCES revision,
93 dbparent INTEGER REFERENCES revision,
94 dbchild INTEGER REFERENCES revision,
95 bparent INTEGER REFERENCES symbol
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96 }
97
98 state writing tag {
99 tid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
100 fid INTEGER NOT NULL REFERENCES file, -- File the item belongs to
@@ -155,20 +205,39 @@
155 pid INTEGER NOT NULL REFERENCES symbol, -- Possible parent of sid
156 UNIQUE (sid, pid)
157 }
158
159 state writing meta {
 
 
 
 
 
160 mid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
161 pid INTEGER NOT NULL REFERENCES project, -- project the commit was on
162 bid INTEGER REFERENCES symbol, -- branch the commit was on, NULL for :trunk:
163 aid INTEGER NOT NULL REFERENCES author,
164 cid INTEGER NOT NULL REFERENCES cmessage,
 
 
 
 
 
 
 
165 UNIQUE (pid, bid, aid, cid)
 
 
 
 
 
 
 
166 }
167
168 # Author and commit message information is fully global,
169 # i.e. per repository.
170
171 state writing author {
172 aid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
173 name TEXT NOT NULL UNIQUE
174 }
@@ -176,18 +245,10 @@
176 state writing cmessage {
177 cid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
178 text TEXT NOT NULL UNIQUE
179 }
180
181 # Consistency constraints.
182 #
183 # Items (Tags, Branches, Revisions) belong to a file to a
184 # project. All refer to other items, and symbols, which again
185 # belong to a project. The projects have to agree with each
186 # other. I.e. items may not refer to items or symbols which
187 # belong to a different project than their own.
188
189 return
190 }
191
192 typemethod load {} {
193 # TODO
194
--- tools/cvs2fossil/lib/c2f_pcollrev.tcl
+++ tools/cvs2fossil/lib/c2f_pcollrev.tcl
@@ -64,37 +64,87 @@
64 # Tag <- Symbol <- Event
65 # Branch <- Symbol <- Event
66 # Revision <- Event
67
68 state writing revision {
69 -- Revisions. Identified by a global numeric id each
70 -- belongs to a single file, identified by its id. It
71 -- further has a dotted revision number (DTN).
72 --
73 -- Constraint: The dotted revision number is unique within
74 -- the file. See end of definition.
75
76 rid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
77 fid INTEGER NOT NULL REFERENCES file, -- File owning revision.
78 rev TEXT NOT NULL, -- Dotted Rev Number.
79
80 -- All revisions belong to a line-of-development,
81 -- identified by a symbol (project level). During data
82 -- collection it was a file-level branch symbol.
83 --
84 -- Constraint: All the LOD symbols are in the same project
85 -- as the file itself. This cannot be
86 -- expressed in CREATE TABLE syntax.
87
88 lod INTEGER NOT NULL REFERENCES symbol, -- Line of development
89
90 -- The revisions in a file are organized in a forest of
91 -- trees, with the main lines defined through the parent /
92 -- child references. A revision without a parent is the
93 -- root of a tree, and a revision without a child is a
94 -- leaf.
95
96 -- Constraints: All revisions coupled through parent/child
97 -- refer to the same LOD symbol. The parent
98 -- of a child of X is X. The child of a
99 -- parent of X is X.
100
101 parent INTEGER REFERENCES revision,
102 child INTEGER REFERENCES revision,
103
104 -- The representation of a branch in a tree is the
105 -- exception to the three constraints above.
106
107 -- The beginning of a branch is represented by a non-NULL
108 -- bparent of a revision. This revision B is the first on
109 -- the branch. Its parent P is the revision the branch is
110 -- rooted in, and it is not the child of P. B and P refer
111 -- to different LOD symbols. The bparent of B is also its
112 -- LOD, and the LOD of its children.
113
114 bparent INTEGER REFERENCES symbol,
115
116 -- Lastly we keep information is about non-trunk default
117 -- branches (NTDB) in the revisions.
118
119 -- All revisions on the NTDB have 'isdefault' TRUE,
120 -- everyone else FALSE. The last revision X on the NTDB
121 -- which is still considered to be on the trunk as well
122 -- has a non-NULL 'dbchild' which refers to the root of
123 -- the trunk. The root also has a non-NULL dbparent
124 -- refering to X.
125
126 isdefault INTEGER NOT NULL,
127 dbparent INTEGER REFERENCES revision,
128 dbchild INTEGER REFERENCES revision,
129
130 -- The main payload of the revision are the date/time it
131 -- was entered, its state, operation (= type/class), text
132 -- content, and meta data (author, log message, branch,
133 -- project). The last is encoded as single id, see table
134 -- 'meta'. The date/time is given in seconds since the
135 -- epoch, for easy comparison. The text content is an
136 -- (offset,length) pair into the rcs archive.
137
138 op INTEGER NOT NULL,
139 date INTEGER NOT NULL,
140 state TEXT NOT NULL,
141 mid INTEGER NOT NULL REFERENCES meta,
142 coff INTEGER NOT NULL,
143 clen INTEGER NOT NULL,
144
145 UNIQUE (fid, rev) -- The DTN is unique within the revision's file.
146 }
147
148 state writing tag {
149 tid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
150 fid INTEGER NOT NULL REFERENCES file, -- File the item belongs to
@@ -155,20 +205,39 @@
205 pid INTEGER NOT NULL REFERENCES symbol, -- Possible parent of sid
206 UNIQUE (sid, pid)
207 }
208
209 state writing meta {
210 -- Meta data of revisions. See revision.mid for the
211 -- reference. Many revisions can share meta data. This is
212 -- actually one of the criterions used to sort revisions
213 -- into changesets.
214
215 mid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
216
217 -- Meta data belongs to a specific project, stronger, to a
218 -- branch in that project. It further has a log message,
219 -- and its author. This is unique with the project and
220 -- branch.
221
222 pid INTEGER NOT NULL REFERENCES project, --
223 bid INTEGER NOT NULL REFERENCES symbol, --
224 aid INTEGER NOT NULL REFERENCES author, --
225 cid INTEGER NOT NULL REFERENCES cmessage, --
226
227 UNIQUE (pid, bid, aid, cid)
228
229 -- Constraints: The project of the meta data of a revision
230 -- X is the same as the project of X itself.
231 --
232 -- ............ The branch of the meta data of a revision
233 -- X is the same as the line of development
234 -- of X itself.
235 }
236
237 # Authors and commit messages are fully global, i.e. per
238 # repository.
239
240 state writing author {
241 aid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
242 name TEXT NOT NULL UNIQUE
243 }
@@ -176,18 +245,10 @@
245 state writing cmessage {
246 cid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
247 text TEXT NOT NULL UNIQUE
248 }
249
 
 
 
 
 
 
 
 
250 return
251 }
252
253 typemethod load {} {
254 # TODO
255
--- tools/cvs2fossil/lib/c2f_project.tcl
+++ tools/cvs2fossil/lib/c2f_project.tcl
@@ -31,11 +31,11 @@
3131
## Public API
3232
3333
constructor {path r} {
3434
set mybase $path
3535
set myrepository $r
36
- set mytrunk [trunk %AUTO%]
36
+ set mytrunk [trunk %AUTO% $self]
3737
return
3838
}
3939
4040
method base {} { return $mybase }
4141
method trunk {} { return $mytrunk }
4242
--- tools/cvs2fossil/lib/c2f_project.tcl
+++ tools/cvs2fossil/lib/c2f_project.tcl
@@ -31,11 +31,11 @@
31 ## Public API
32
33 constructor {path r} {
34 set mybase $path
35 set myrepository $r
36 set mytrunk [trunk %AUTO%]
37 return
38 }
39
40 method base {} { return $mybase }
41 method trunk {} { return $mytrunk }
42
--- tools/cvs2fossil/lib/c2f_project.tcl
+++ tools/cvs2fossil/lib/c2f_project.tcl
@@ -31,11 +31,11 @@
31 ## Public API
32
33 constructor {path r} {
34 set mybase $path
35 set myrepository $r
36 set mytrunk [trunk %AUTO% $self]
37 return
38 }
39
40 method base {} { return $mybase }
41 method trunk {} { return $mytrunk }
42
--- tools/cvs2fossil/lib/c2f_ptrunk.tcl
+++ tools/cvs2fossil/lib/c2f_ptrunk.tcl
@@ -23,20 +23,24 @@
2323
2424
snit::type ::vc::fossil::import::cvs::project::trunk {
2525
# # ## ### ##### ######## #############
2626
## Public API
2727
28
- constructor {} {
28
+ constructor {project} {
29
+ set myid [[$project getsymbol $myname] id]
2930
return
3031
}
3132
32
- method name {} { return :trunk: }
33
- method id {} { return {} }
33
+ method name {} { return $myname }
34
+ method id {} { return $myid }
3435
method istrunk {} { return 1 }
3536
3637
# # ## ### ##### ######## #############
3738
## State
39
+
40
+ typevariable myname :trunk: ; # Name shared by all trunk symbols.
41
+ variable myid {} ; # The trunk's symbol id.
3842
3943
# # ## ### ##### ######## #############
4044
## Internal methods
4145
4246
# # ## ### ##### ######## #############
4347
--- tools/cvs2fossil/lib/c2f_ptrunk.tcl
+++ tools/cvs2fossil/lib/c2f_ptrunk.tcl
@@ -23,20 +23,24 @@
23
24 snit::type ::vc::fossil::import::cvs::project::trunk {
25 # # ## ### ##### ######## #############
26 ## Public API
27
28 constructor {} {
 
29 return
30 }
31
32 method name {} { return :trunk: }
33 method id {} { return {} }
34 method istrunk {} { return 1 }
35
36 # # ## ### ##### ######## #############
37 ## State
 
 
 
38
39 # # ## ### ##### ######## #############
40 ## Internal methods
41
42 # # ## ### ##### ######## #############
43
--- tools/cvs2fossil/lib/c2f_ptrunk.tcl
+++ tools/cvs2fossil/lib/c2f_ptrunk.tcl
@@ -23,20 +23,24 @@
23
24 snit::type ::vc::fossil::import::cvs::project::trunk {
25 # # ## ### ##### ######## #############
26 ## Public API
27
28 constructor {project} {
29 set myid [[$project getsymbol $myname] id]
30 return
31 }
32
33 method name {} { return $myname }
34 method id {} { return $myid }
35 method istrunk {} { return 1 }
36
37 # # ## ### ##### ######## #############
38 ## State
39
40 typevariable myname :trunk: ; # Name shared by all trunk symbols.
41 variable myid {} ; # The trunk's symbol id.
42
43 # # ## ### ##### ######## #############
44 ## Internal methods
45
46 # # ## ### ##### ######## #############
47

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button