Fossil SCM

Modified filtering pass to drop the blobs of excluded revisions, for them we can be sure that we will not need them later, as whole branches are dropped. Modified the file import to use the new blob information to setup the expansion graph. This fixes the trouble we had with archive files in bwidget. They are now properly expanded.

aku 2008-02-03 00:45 trunk
Commit 83d75a6c230ec25df3ea87fcc92514aea8517c82
--- tools/cvs2fossil/lib/c2f_file.tcl
+++ tools/cvs2fossil/lib/c2f_file.tcl
@@ -306,47 +306,48 @@
306306
307307
set earcs {} ; # Arcs for expansion graph
308308
set zarcs {} ; # Arcs for zip graph
309309
set revmap {} ; # path -> rid map to later merge uuid information
310310
311
- foreach {rid revnr parent child coff clen} [state run {
312
- SELECT R.rid, R.rev, R.parent, R.child, R.coff, R.clen
313
- FROM revision R
314
- WHERE R.fid = $myid
311
+ foreach {rid revnr parent child coff clen cid cparent} [state run {
312
+ SELECT B.rid, R.rev, R.parent, R.child, B.coff, B.clen, B.bid, B.pid
313
+ FROM blob B
314
+ LEFT OUTER JOIN revision R
315
+ ON B.rid = R.rid
316
+ WHERE B.fid = $myid
315317
}] {
316
- lappend revmap r$revnr $rid
317
-
318
- $zp node insert $rid
319
- $zp node set $rid revnr $revnr
320
- $zp node set $rid label <$revnr>
321
-
322
- if {$child ne ""} {
323
- lappend zarcs $child $rid
324
- }
325
-
326
- $ex node insert $rid
327
- $ex node set $rid text [list $coff $clen]
328
- $ex node set $rid revnr $revnr
329
- $ex node set $rid label <$revnr>
330
-
331
- if {[rev istrunkrevnr $revnr]} {
332
- # On the trunk, this revision is a delta based on the
333
- # child. That makes the child our predecessor.
334
-
335
- if {$child eq ""} continue
336
- lappend earcs $child $rid
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
+
329
+ if {$child ne ""} {
330
+ lappend zarcs $child $rid
331
+ }
337332
} else {
338
- # On a branch this revision is a delta based on the
339
- # parent. That makes the parent our predecessor.
340
-
341
- if {$parent eq ""} {
342
- # Detached branch root, this is a patch based on
343
- # the empty string.
344
- $ex node set $rid __base__ r__empty__
345
- continue
346
- }
347
- lappend earcs $parent $rid
333
+ # We fake a revnr for the blobs which have no
334
+ # revision, for use in the expansion graph.
335
+ set revnr ghost$cid
336
+ }
337
+
338
+ # Now the expansion graph.
339
+
340
+ $ex node insert $cid
341
+ $ex node set $cid text [list $coff $clen]
342
+ $ex node set $cid revnr $revnr
343
+ $ex node set $cid label <$revnr>
344
+
345
+ if {$cparent ne ""} {
346
+ # The expansion arcs go from baseline to delta
347
+ # descendant, based on the blob information.
348
+ lappend earcs $cparent $cid
348349
}
349350
}
350351
351352
# Phase II: Insert the accumulated dependencies
352353
353354
--- tools/cvs2fossil/lib/c2f_file.tcl
+++ tools/cvs2fossil/lib/c2f_file.tcl
@@ -306,47 +306,48 @@
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
311 foreach {rid revnr parent child coff clen} [state run {
312 SELECT R.rid, R.rev, R.parent, R.child, R.coff, R.clen
313 FROM revision R
314 WHERE R.fid = $myid
 
 
315 }] {
316 lappend revmap r$revnr $rid
317
318 $zp node insert $rid
319 $zp node set $rid revnr $revnr
320 $zp node set $rid label <$revnr>
321
322 if {$child ne ""} {
323 lappend zarcs $child $rid
324 }
325
326 $ex node insert $rid
327 $ex node set $rid text [list $coff $clen]
328 $ex node set $rid revnr $revnr
329 $ex node set $rid label <$revnr>
330
331 if {[rev istrunkrevnr $revnr]} {
332 # On the trunk, this revision is a delta based on the
333 # child. That makes the child our predecessor.
334
335 if {$child eq ""} continue
336 lappend earcs $child $rid
337 } else {
338 # On a branch this revision is a delta based on the
339 # parent. That makes the parent our predecessor.
340
341 if {$parent eq ""} {
342 # Detached branch root, this is a patch based on
343 # the empty string.
344 $ex node set $rid __base__ r__empty__
345 continue
346 }
347 lappend earcs $parent $rid
 
 
 
 
 
 
348 }
349 }
350
351 # Phase II: Insert the accumulated dependencies
352
353
--- tools/cvs2fossil/lib/c2f_file.tcl
+++ tools/cvs2fossil/lib/c2f_file.tcl
@@ -306,47 +306,48 @@
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
311 foreach {rid revnr parent child coff clen cid cparent} [state run {
312 SELECT B.rid, R.rev, R.parent, R.child, B.coff, B.clen, B.bid, B.pid
313 FROM blob B
314 LEFT OUTER JOIN revision R
315 ON B.rid = R.rid
316 WHERE B.fid = $myid
317 }] {
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
329 if {$child ne ""} {
330 lappend zarcs $child $rid
331 }
 
 
 
 
 
 
 
332 } else {
333 # We fake a revnr for the blobs which have no
334 # revision, for use in the expansion graph.
335 set revnr ghost$cid
336 }
337
338 # Now the expansion graph.
339
340 $ex node insert $cid
341 $ex node set $cid text [list $coff $clen]
342 $ex node set $cid revnr $revnr
343 $ex node set $cid label <$revnr>
344
345 if {$cparent ne ""} {
346 # The expansion arcs go from baseline to delta
347 # descendant, based on the blob information.
348 lappend earcs $cparent $cid
349 }
350 }
351
352 # Phase II: Insert the accumulated dependencies
353
354
--- tools/cvs2fossil/lib/c2f_pfiltersym.tcl
+++ tools/cvs2fossil/lib/c2f_pfiltersym.tcl
@@ -214,10 +214,11 @@
214214
DELETE FROM branch WHERE lod IN excludedsymbols;
215215
DELETE FROM branch WHERE sid IN excludedsymbols;
216216
217217
DELETE FROM revisionbranchchildren WHERE rid IN excludedrevisions;
218218
DELETE FROM revisionbranchchildren WHERE brid IN excludedrevisions;
219
+ DELETE FROM blob WHERE rid IN excludedrevisions;
219220
220221
DROP TABLE excludedrevisions;
221222
DROP TABLE excludedsymbols;
222223
}
223224
return
224225
--- tools/cvs2fossil/lib/c2f_pfiltersym.tcl
+++ tools/cvs2fossil/lib/c2f_pfiltersym.tcl
@@ -214,10 +214,11 @@
214 DELETE FROM branch WHERE lod IN excludedsymbols;
215 DELETE FROM branch WHERE sid IN excludedsymbols;
216
217 DELETE FROM revisionbranchchildren WHERE rid IN excludedrevisions;
218 DELETE FROM revisionbranchchildren WHERE brid IN excludedrevisions;
 
219
220 DROP TABLE excludedrevisions;
221 DROP TABLE excludedsymbols;
222 }
223 return
224
--- tools/cvs2fossil/lib/c2f_pfiltersym.tcl
+++ tools/cvs2fossil/lib/c2f_pfiltersym.tcl
@@ -214,10 +214,11 @@
214 DELETE FROM branch WHERE lod IN excludedsymbols;
215 DELETE FROM branch WHERE sid IN excludedsymbols;
216
217 DELETE FROM revisionbranchchildren WHERE rid IN excludedrevisions;
218 DELETE FROM revisionbranchchildren WHERE brid IN excludedrevisions;
219 DELETE FROM blob WHERE rid IN excludedrevisions;
220
221 DROP TABLE excludedrevisions;
222 DROP TABLE excludedsymbols;
223 }
224 return
225

Keyboard Shortcuts

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