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.
Commit
3e76f2a5f067edd1a188a7c804cbc35cca9728bd
Parent
83d75a6c230ec25…
3 files changed
+10
-2
+2
-3
+1
-4
+10
-2
| --- tools/cvs2fossil/lib/c2f_file.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_file.tcl | ||
| @@ -224,10 +224,12 @@ | ||
| 224 | 224 | # and/or branches). |
| 225 | 225 | |
| 226 | 226 | set lod [$self GetLOD $revnr] |
| 227 | 227 | |
| 228 | 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. | |
| 229 | 231 | $rev settext $textrange |
| 230 | 232 | $rev setlod $lod |
| 231 | 233 | |
| 232 | 234 | $myblob extend $revnr $textrange |
| 233 | 235 | |
| @@ -299,12 +301,16 @@ | ||
| 299 | 301 | set ex [struct::graph ex] ; # Expansion graph. |
| 300 | 302 | set zp [struct::graph zp] ; # Zip/Import graph. |
| 301 | 303 | |
| 302 | 304 | close [open $dir/r__empty__ w];# Base for detached roots on branches. |
| 303 | 305 | |
| 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. | |
| 306 | 312 | |
| 307 | 313 | set earcs {} ; # Arcs for expansion graph |
| 308 | 314 | set zarcs {} ; # Arcs for zip graph |
| 309 | 315 | set revmap {} ; # path -> rid map to later merge uuid information |
| 310 | 316 | |
| @@ -318,10 +324,12 @@ | ||
| 318 | 324 | # Main data are blobs, most will have revisions, but not |
| 319 | 325 | # all. The expansion graph is blob based, whereas the |
| 320 | 326 | # recompression graph is revision based. |
| 321 | 327 | |
| 322 | 328 | if {$revnr ne ""} { |
| 329 | + # Blob has revision, extend recompression graph. | |
| 330 | + | |
| 323 | 331 | lappend revmap r$revnr $rid |
| 324 | 332 | |
| 325 | 333 | $zp node insert $rid |
| 326 | 334 | $zp node set $rid revnr $revnr |
| 327 | 335 | $zp node set $rid label <$revnr> |
| 328 | 336 |
| --- 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 @@ | ||
| 352 | 352 | method persist {} { |
| 353 | 353 | set fid [$myfile id] |
| 354 | 354 | set lod [$mylod id] |
| 355 | 355 | set op $myopcode($myoperation) |
| 356 | 356 | set idb $myisondefaultbranch |
| 357 | - set clen [expr {$mytextend - $mytextstart}] | |
| 358 | 357 | |
| 359 | 358 | lappend map @P@ [expr { ($myparent eq "") ? "NULL" : [$myparent id] }] |
| 360 | 359 | lappend map @C@ [expr { ($mychild eq "") ? "NULL" : [$mychild id] }] |
| 361 | 360 | lappend map @DP [expr { ($mydbparent eq "") ? "NULL" : [$mydbparent id] }] |
| 362 | 361 | lappend map @DC [expr { ($mydbchild eq "") ? "NULL" : [$mydbchild id] }] |
| 363 | 362 | lappend map @BP [expr { ($myparentbranch eq "") ? "NULL" : [$myparentbranch id] }] |
| 364 | 363 | |
| 365 | 364 | 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); | |
| 368 | 367 | } |
| 369 | 368 | |
| 370 | 369 | state transaction { |
| 371 | 370 | state run [string map $map $cmd] |
| 372 | 371 | |
| 373 | 372 |
| --- 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 @@ | ||
| 131 | 131 | -- The main payload of the revision are the date/time it |
| 132 | 132 | -- was entered, its state, operation (= type/class), text |
| 133 | 133 | -- content, and meta data (author, log message, branch, |
| 134 | 134 | -- project). The last is encoded as single id, see table |
| 135 | 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. | |
| 136 | + -- epoch, for easy comparison. | |
| 138 | 137 | |
| 139 | 138 | op INTEGER NOT NULL REFERENCES optype, |
| 140 | 139 | date INTEGER NOT NULL, |
| 141 | 140 | state TEXT NOT NULL, |
| 142 | 141 | mid INTEGER NOT NULL REFERENCES meta, |
| 143 | - coff INTEGER NOT NULL, | |
| 144 | - clen INTEGER NOT NULL, | |
| 145 | 142 | |
| 146 | 143 | UNIQUE (fid, rev) -- The DTN is unique within the revision's file. |
| 147 | 144 | } |
| 148 | 145 | |
| 149 | 146 | # Blobs contain the information needed to extract revisions |
| 150 | 147 |
| --- 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 |