Fossil SCM

Removed the now obsolete textrange information from the revision table and updated the file revision code to not store its textrange any longer.

aku 2008-02-03 01:33 trunk
Commit 3e76f2a5f067edd1a188a7c804cbc35cca9728bd
--- tools/cvs2fossil/lib/c2f_file.tcl
+++ tools/cvs2fossil/lib/c2f_file.tcl
@@ -224,10 +224,12 @@
224224
# and/or branches).
225225
226226
set lod [$self GetLOD $revnr]
227227
228228
$rev setmeta [$myproject defmeta [$lod id] $myaid($revnr) $cmid]
229
+ # Note: We keep settext on file::rev for the hastext queries
230
+ # used by several checks.
229231
$rev settext $textrange
230232
$rev setlod $lod
231233
232234
$myblob extend $revnr $textrange
233235
@@ -299,12 +301,16 @@
299301
set ex [struct::graph ex] ; # Expansion graph.
300302
set zp [struct::graph zp] ; # Zip/Import graph.
301303
302304
close [open $dir/r__empty__ w];# Base for detached roots on branches.
303305
304
- # Phase I: Pull the revisions from memory and fill the graphs
305
- # with them...
306
+ # Phase I: Pull blobs and referenced revisions from the state
307
+ # and fill the graphs with them...
308
+
309
+ # Note: We use the blobs for expansion because we need them
310
+ # all, even those without revision, for both proper
311
+ # ordering and exact patch application.
306312
307313
set earcs {} ; # Arcs for expansion graph
308314
set zarcs {} ; # Arcs for zip graph
309315
set revmap {} ; # path -> rid map to later merge uuid information
310316
@@ -318,10 +324,12 @@
318324
# Main data are blobs, most will have revisions, but not
319325
# all. The expansion graph is blob based, whereas the
320326
# recompression graph is revision based.
321327
322328
if {$revnr ne ""} {
329
+ # Blob has revision, extend recompression graph.
330
+
323331
lappend revmap r$revnr $rid
324332
325333
$zp node insert $rid
326334
$zp node set $rid revnr $revnr
327335
$zp node set $rid label <$revnr>
328336
--- tools/cvs2fossil/lib/c2f_file.tcl
+++ tools/cvs2fossil/lib/c2f_file.tcl
@@ -224,10 +224,12 @@
224 # and/or branches).
225
226 set lod [$self GetLOD $revnr]
227
228 $rev setmeta [$myproject defmeta [$lod id] $myaid($revnr) $cmid]
 
 
229 $rev settext $textrange
230 $rev setlod $lod
231
232 $myblob extend $revnr $textrange
233
@@ -299,12 +301,16 @@
299 set ex [struct::graph ex] ; # Expansion graph.
300 set zp [struct::graph zp] ; # Zip/Import graph.
301
302 close [open $dir/r__empty__ w];# Base for detached roots on branches.
303
304 # Phase I: Pull the revisions from memory and fill the graphs
305 # with them...
 
 
 
 
306
307 set earcs {} ; # Arcs for expansion graph
308 set zarcs {} ; # Arcs for zip graph
309 set revmap {} ; # path -> rid map to later merge uuid information
310
@@ -318,10 +324,12 @@
318 # Main data are blobs, most will have revisions, but not
319 # all. The expansion graph is blob based, whereas the
320 # recompression graph is revision based.
321
322 if {$revnr ne ""} {
 
 
323 lappend revmap r$revnr $rid
324
325 $zp node insert $rid
326 $zp node set $rid revnr $revnr
327 $zp node set $rid label <$revnr>
328
--- tools/cvs2fossil/lib/c2f_file.tcl
+++ tools/cvs2fossil/lib/c2f_file.tcl
@@ -224,10 +224,12 @@
224 # and/or branches).
225
226 set lod [$self GetLOD $revnr]
227
228 $rev setmeta [$myproject defmeta [$lod id] $myaid($revnr) $cmid]
229 # Note: We keep settext on file::rev for the hastext queries
230 # used by several checks.
231 $rev settext $textrange
232 $rev setlod $lod
233
234 $myblob extend $revnr $textrange
235
@@ -299,12 +301,16 @@
301 set ex [struct::graph ex] ; # Expansion graph.
302 set zp [struct::graph zp] ; # Zip/Import graph.
303
304 close [open $dir/r__empty__ w];# Base for detached roots on branches.
305
306 # Phase I: Pull blobs and referenced revisions from the state
307 # and fill the graphs with them...
308
309 # Note: We use the blobs for expansion because we need them
310 # all, even those without revision, for both proper
311 # ordering and exact patch application.
312
313 set earcs {} ; # Arcs for expansion graph
314 set zarcs {} ; # Arcs for zip graph
315 set revmap {} ; # path -> rid map to later merge uuid information
316
@@ -318,10 +324,12 @@
324 # Main data are blobs, most will have revisions, but not
325 # all. The expansion graph is blob based, whereas the
326 # recompression graph is revision based.
327
328 if {$revnr ne ""} {
329 # Blob has revision, extend recompression graph.
330
331 lappend revmap r$revnr $rid
332
333 $zp node insert $rid
334 $zp node set $rid revnr $revnr
335 $zp node set $rid label <$revnr>
336
--- tools/cvs2fossil/lib/c2f_frev.tcl
+++ tools/cvs2fossil/lib/c2f_frev.tcl
@@ -352,21 +352,20 @@
352352
method persist {} {
353353
set fid [$myfile id]
354354
set lod [$mylod id]
355355
set op $myopcode($myoperation)
356356
set idb $myisondefaultbranch
357
- set clen [expr {$mytextend - $mytextstart}]
358357
359358
lappend map @P@ [expr { ($myparent eq "") ? "NULL" : [$myparent id] }]
360359
lappend map @C@ [expr { ($mychild eq "") ? "NULL" : [$mychild id] }]
361360
lappend map @DP [expr { ($mydbparent eq "") ? "NULL" : [$mydbparent id] }]
362361
lappend map @DC [expr { ($mydbchild eq "") ? "NULL" : [$mydbchild id] }]
363362
lappend map @BP [expr { ($myparentbranch eq "") ? "NULL" : [$myparentbranch id] }]
364363
365364
set cmd {
366
- INSERT INTO revision ( rid, fid, rev, lod, parent, child, isdefault, dbparent, dbchild, bparent, op, date, state, mid, coff, clen)
367
- VALUES ($myid, $fid, $myrevnr, $lod, @P@, @C@, $idb, @DP, @DC, @BP , $op, $mydate, $mystate, $mymetaid, $mytextstart, $clen);
365
+ INSERT INTO revision ( rid, fid, rev, lod, parent, child, isdefault, dbparent, dbchild, bparent, op, date, state, mid)
366
+ VALUES ($myid, $fid, $myrevnr, $lod, @P@, @C@, $idb, @DP, @DC, @BP , $op, $mydate, $mystate, $mymetaid);
368367
}
369368
370369
state transaction {
371370
state run [string map $map $cmd]
372371
373372
--- tools/cvs2fossil/lib/c2f_frev.tcl
+++ tools/cvs2fossil/lib/c2f_frev.tcl
@@ -352,21 +352,20 @@
352 method persist {} {
353 set fid [$myfile id]
354 set lod [$mylod id]
355 set op $myopcode($myoperation)
356 set idb $myisondefaultbranch
357 set clen [expr {$mytextend - $mytextstart}]
358
359 lappend map @P@ [expr { ($myparent eq "") ? "NULL" : [$myparent id] }]
360 lappend map @C@ [expr { ($mychild eq "") ? "NULL" : [$mychild id] }]
361 lappend map @DP [expr { ($mydbparent eq "") ? "NULL" : [$mydbparent id] }]
362 lappend map @DC [expr { ($mydbchild eq "") ? "NULL" : [$mydbchild id] }]
363 lappend map @BP [expr { ($myparentbranch eq "") ? "NULL" : [$myparentbranch id] }]
364
365 set cmd {
366 INSERT INTO revision ( rid, fid, rev, lod, parent, child, isdefault, dbparent, dbchild, bparent, op, date, state, mid, coff, clen)
367 VALUES ($myid, $fid, $myrevnr, $lod, @P@, @C@, $idb, @DP, @DC, @BP , $op, $mydate, $mystate, $mymetaid, $mytextstart, $clen);
368 }
369
370 state transaction {
371 state run [string map $map $cmd]
372
373
--- tools/cvs2fossil/lib/c2f_frev.tcl
+++ tools/cvs2fossil/lib/c2f_frev.tcl
@@ -352,21 +352,20 @@
352 method persist {} {
353 set fid [$myfile id]
354 set lod [$mylod id]
355 set op $myopcode($myoperation)
356 set idb $myisondefaultbranch
 
357
358 lappend map @P@ [expr { ($myparent eq "") ? "NULL" : [$myparent id] }]
359 lappend map @C@ [expr { ($mychild eq "") ? "NULL" : [$mychild id] }]
360 lappend map @DP [expr { ($mydbparent eq "") ? "NULL" : [$mydbparent id] }]
361 lappend map @DC [expr { ($mydbchild eq "") ? "NULL" : [$mydbchild id] }]
362 lappend map @BP [expr { ($myparentbranch eq "") ? "NULL" : [$myparentbranch id] }]
363
364 set cmd {
365 INSERT INTO revision ( rid, fid, rev, lod, parent, child, isdefault, dbparent, dbchild, bparent, op, date, state, mid)
366 VALUES ($myid, $fid, $myrevnr, $lod, @P@, @C@, $idb, @DP, @DC, @BP , $op, $mydate, $mystate, $mymetaid);
367 }
368
369 state transaction {
370 state run [string map $map $cmd]
371
372
--- tools/cvs2fossil/lib/c2f_pcollrev.tcl
+++ tools/cvs2fossil/lib/c2f_pcollrev.tcl
@@ -131,19 +131,16 @@
131131
-- The main payload of the revision are the date/time it
132132
-- was entered, its state, operation (= type/class), text
133133
-- content, and meta data (author, log message, branch,
134134
-- project). The last is encoded as single id, see table
135135
-- 'meta'. The date/time is given in seconds since the
136
- -- epoch, for easy comparison. The text content is an
137
- -- (offset,length) pair into the rcs archive.
136
+ -- epoch, for easy comparison.
138137
139138
op INTEGER NOT NULL REFERENCES optype,
140139
date INTEGER NOT NULL,
141140
state TEXT NOT NULL,
142141
mid INTEGER NOT NULL REFERENCES meta,
143
- coff INTEGER NOT NULL,
144
- clen INTEGER NOT NULL,
145142
146143
UNIQUE (fid, rev) -- The DTN is unique within the revision's file.
147144
}
148145
149146
# Blobs contain the information needed to extract revisions
150147
--- tools/cvs2fossil/lib/c2f_pcollrev.tcl
+++ tools/cvs2fossil/lib/c2f_pcollrev.tcl
@@ -131,19 +131,16 @@
131 -- The main payload of the revision are the date/time it
132 -- was entered, its state, operation (= type/class), text
133 -- content, and meta data (author, log message, branch,
134 -- project). The last is encoded as single id, see table
135 -- 'meta'. The date/time is given in seconds since the
136 -- epoch, for easy comparison. The text content is an
137 -- (offset,length) pair into the rcs archive.
138
139 op INTEGER NOT NULL REFERENCES optype,
140 date INTEGER NOT NULL,
141 state TEXT NOT NULL,
142 mid INTEGER NOT NULL REFERENCES meta,
143 coff INTEGER NOT NULL,
144 clen INTEGER NOT NULL,
145
146 UNIQUE (fid, rev) -- The DTN is unique within the revision's file.
147 }
148
149 # Blobs contain the information needed to extract revisions
150
--- tools/cvs2fossil/lib/c2f_pcollrev.tcl
+++ tools/cvs2fossil/lib/c2f_pcollrev.tcl
@@ -131,19 +131,16 @@
131 -- The main payload of the revision are the date/time it
132 -- was entered, its state, operation (= type/class), text
133 -- content, and meta data (author, log message, branch,
134 -- project). The last is encoded as single id, see table
135 -- 'meta'. The date/time is given in seconds since the
136 -- epoch, for easy comparison.
 
137
138 op INTEGER NOT NULL REFERENCES optype,
139 date INTEGER NOT NULL,
140 state TEXT NOT NULL,
141 mid INTEGER NOT NULL REFERENCES meta,
 
 
142
143 UNIQUE (fid, rev) -- The DTN is unique within the revision's file.
144 }
145
146 # Blobs contain the information needed to extract revisions
147

Keyboard Shortcuts

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