Fossil SCM
Moved the paranoid integrity checks of pass 2 into a separate package for use by other passes, and changed pass 4 to also run these checks, albeit in a (slightly) relaxed form. See the comments at the point of call for the reason. This completes pass 4.
Commit
131f0518802152fa2842d773b4470282800dd8ad
Parent
e45f47ec4aa0f67…
4 files changed
+2
+3
-1
+15
-1
+1
| --- a/tools/cvs2fossil/lib/c2f_integrity.tcl | ||
| +++ b/tools/cvs2fossil/lib/c2f_integrity.tcl | ||
| @@ -0,0 +1,2 @@ | ||
| 1 | +## -AllChangesetsSymboland## -fileand -CS""""""set n 0 | |
| 2 | + RevisionCSetLinkageRevisionCSetLinkage {} {tsSymboland# |
| --- a/tools/cvs2fossil/lib/c2f_integrity.tcl | |
| +++ b/tools/cvs2fossil/lib/c2f_integrity.tcl | |
| @@ -0,0 +1,2 @@ | |
| --- a/tools/cvs2fossil/lib/c2f_integrity.tcl | |
| +++ b/tools/cvs2fossil/lib/c2f_integrity.tcl | |
| @@ -0,0 +1,2 @@ | |
| 1 | ## -AllChangesetsSymboland## -fileand -CS""""""set n 0 |
| 2 | RevisionCSetLinkageRevisionCSetLinkage {} {tsSymboland# |
| --- tools/cvs2fossil/lib/c2f_pcollrev.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_pcollrev.tcl | ||
| @@ -21,10 +21,11 @@ | ||
| 21 | 21 | package require vc::tools::trouble ; # Error reporting. |
| 22 | 22 | package require vc::tools::log ; # User feedback. |
| 23 | 23 | package require vc::fossil::import::cvs::pass ; # Pass management. |
| 24 | 24 | package require vc::fossil::import::cvs::repository ; # Repository management. |
| 25 | 25 | package require vc::fossil::import::cvs::state ; # State storage. |
| 26 | +package require vc::fossil::import::cvs::integrity ; # State integrity checks. | |
| 26 | 27 | package require vc::fossil::import::cvs::project::sym ; # Project level symbols. |
| 27 | 28 | package require vc::fossil::import::cvs::file::rev ; # File level revisions. |
| 28 | 29 | package require vc::rcs::parser ; # Rcs archive data extraction. |
| 29 | 30 | |
| 30 | 31 | # # ## ### ##### ######## ############# ##################### |
| @@ -327,12 +328,12 @@ | ||
| 327 | 328 | $project purgeghostsymbols |
| 328 | 329 | } |
| 329 | 330 | |
| 330 | 331 | repository printrevstatistics |
| 331 | 332 | repository persistrev |
| 333 | + integrity strict | |
| 332 | 334 | |
| 333 | - Paranoia | |
| 334 | 335 | log write 1 collrev "Scan completed" |
| 335 | 336 | return |
| 336 | 337 | } |
| 337 | 338 | |
| 338 | 339 | typemethod discard {} { |
| @@ -608,10 +609,11 @@ | ||
| 608 | 609 | namespace export collrev |
| 609 | 610 | namespace eval collrev { |
| 610 | 611 | namespace import ::vc::rcs::parser |
| 611 | 612 | namespace import ::vc::fossil::import::cvs::repository |
| 612 | 613 | namespace import ::vc::fossil::import::cvs::state |
| 614 | + namespace import ::vc::fossil::import::cvs::integrity | |
| 613 | 615 | namespace eval project { |
| 614 | 616 | namespace import ::vc::fossil::import::cvs::project::sym |
| 615 | 617 | } |
| 616 | 618 | namespace eval file { |
| 617 | 619 | namespace import ::vc::fossil::import::cvs::file::rev |
| 618 | 620 |
| --- tools/cvs2fossil/lib/c2f_pcollrev.tcl | |
| +++ tools/cvs2fossil/lib/c2f_pcollrev.tcl | |
| @@ -21,10 +21,11 @@ | |
| 21 | package require vc::tools::trouble ; # Error reporting. |
| 22 | package require vc::tools::log ; # User feedback. |
| 23 | package require vc::fossil::import::cvs::pass ; # Pass management. |
| 24 | package require vc::fossil::import::cvs::repository ; # Repository management. |
| 25 | package require vc::fossil::import::cvs::state ; # State storage. |
| 26 | package require vc::fossil::import::cvs::project::sym ; # Project level symbols. |
| 27 | package require vc::fossil::import::cvs::file::rev ; # File level revisions. |
| 28 | package require vc::rcs::parser ; # Rcs archive data extraction. |
| 29 | |
| 30 | # # ## ### ##### ######## ############# ##################### |
| @@ -327,12 +328,12 @@ | |
| 327 | $project purgeghostsymbols |
| 328 | } |
| 329 | |
| 330 | repository printrevstatistics |
| 331 | repository persistrev |
| 332 | |
| 333 | Paranoia |
| 334 | log write 1 collrev "Scan completed" |
| 335 | return |
| 336 | } |
| 337 | |
| 338 | typemethod discard {} { |
| @@ -608,10 +609,11 @@ | |
| 608 | namespace export collrev |
| 609 | namespace eval collrev { |
| 610 | namespace import ::vc::rcs::parser |
| 611 | namespace import ::vc::fossil::import::cvs::repository |
| 612 | namespace import ::vc::fossil::import::cvs::state |
| 613 | namespace eval project { |
| 614 | namespace import ::vc::fossil::import::cvs::project::sym |
| 615 | } |
| 616 | namespace eval file { |
| 617 | namespace import ::vc::fossil::import::cvs::file::rev |
| 618 |
| --- tools/cvs2fossil/lib/c2f_pcollrev.tcl | |
| +++ tools/cvs2fossil/lib/c2f_pcollrev.tcl | |
| @@ -21,10 +21,11 @@ | |
| 21 | package require vc::tools::trouble ; # Error reporting. |
| 22 | package require vc::tools::log ; # User feedback. |
| 23 | package require vc::fossil::import::cvs::pass ; # Pass management. |
| 24 | package require vc::fossil::import::cvs::repository ; # Repository management. |
| 25 | package require vc::fossil::import::cvs::state ; # State storage. |
| 26 | package require vc::fossil::import::cvs::integrity ; # State integrity checks. |
| 27 | package require vc::fossil::import::cvs::project::sym ; # Project level symbols. |
| 28 | package require vc::fossil::import::cvs::file::rev ; # File level revisions. |
| 29 | package require vc::rcs::parser ; # Rcs archive data extraction. |
| 30 | |
| 31 | # # ## ### ##### ######## ############# ##################### |
| @@ -327,12 +328,12 @@ | |
| 328 | $project purgeghostsymbols |
| 329 | } |
| 330 | |
| 331 | repository printrevstatistics |
| 332 | repository persistrev |
| 333 | integrity strict |
| 334 | |
| 335 | log write 1 collrev "Scan completed" |
| 336 | return |
| 337 | } |
| 338 | |
| 339 | typemethod discard {} { |
| @@ -608,10 +609,11 @@ | |
| 609 | namespace export collrev |
| 610 | namespace eval collrev { |
| 611 | namespace import ::vc::rcs::parser |
| 612 | namespace import ::vc::fossil::import::cvs::repository |
| 613 | namespace import ::vc::fossil::import::cvs::state |
| 614 | namespace import ::vc::fossil::import::cvs::integrity |
| 615 | namespace eval project { |
| 616 | namespace import ::vc::fossil::import::cvs::project::sym |
| 617 | } |
| 618 | namespace eval file { |
| 619 | namespace import ::vc::fossil::import::cvs::file::rev |
| 620 |
| --- tools/cvs2fossil/lib/c2f_pfiltersym.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_pfiltersym.tcl | ||
| @@ -20,10 +20,11 @@ | ||
| 20 | 20 | package require Tcl 8.4 ; # Required runtime. |
| 21 | 21 | package require snit ; # OO system. |
| 22 | 22 | package require vc::tools::misc ; # Text formatting. |
| 23 | 23 | package require vc::tools::log ; # User feedback. |
| 24 | 24 | package require vc::fossil::import::cvs::state ; # State storage. |
| 25 | +package require vc::fossil::import::cvs::integrity ; # State storage integrity checks. | |
| 25 | 26 | package require vc::fossil::import::cvs::project::sym ; # Project level symbols |
| 26 | 27 | |
| 27 | 28 | # # ## ### ##### ######## ############# ##################### |
| 28 | 29 | ## Register the pass with the management |
| 29 | 30 | |
| @@ -79,11 +80,23 @@ | ||
| 79 | 80 | FilterExcludedSymbols |
| 80 | 81 | MutateSymbols |
| 81 | 82 | AdjustParents |
| 82 | 83 | RefineSymbols |
| 83 | 84 | |
| 84 | - # Consider a rerun of the pass 2 paranoia checks. | |
| 85 | + # Strict integrity enforces that all meta entries are in | |
| 86 | + # the same LOD as the revision using them. At this point | |
| 87 | + # this may not be true any longer. If a NTDB was excluded | |
| 88 | + # then all revisions it shared with the trunk were moved | |
| 89 | + # to the trunk LOD, however their meta entries will still | |
| 90 | + # refer to the now gone LOD symbol. This is fine however, | |
| 91 | + # it will not affect our ability to use the meta entries | |
| 92 | + # to distinguish and group revisions into changesets. It | |
| 93 | + # should be noted that we cannot simply switch the meta | |
| 94 | + # entries over to the trunk either, as that may cause the | |
| 95 | + # modified entries to violate the unique-ness constrain | |
| 96 | + # set on that table. | |
| 97 | + integrity metarelaxed | |
| 85 | 98 | } |
| 86 | 99 | |
| 87 | 100 | log write 1 filtersym "Filtering completed" |
| 88 | 101 | return |
| 89 | 102 | } |
| @@ -478,10 +491,11 @@ | ||
| 478 | 491 | |
| 479 | 492 | namespace eval ::vc::fossil::import::cvs::pass { |
| 480 | 493 | namespace export filtersym |
| 481 | 494 | namespace eval filtersym { |
| 482 | 495 | namespace import ::vc::fossil::import::cvs::state |
| 496 | + namespace import ::vc::fossil::import::cvs::integrity | |
| 483 | 497 | namespace eval project { |
| 484 | 498 | namespace import ::vc::fossil::import::cvs::project::sym |
| 485 | 499 | } |
| 486 | 500 | namespace import ::vc::tools::misc::nsp |
| 487 | 501 | namespace import ::vc::tools::log |
| 488 | 502 |
| --- tools/cvs2fossil/lib/c2f_pfiltersym.tcl | |
| +++ tools/cvs2fossil/lib/c2f_pfiltersym.tcl | |
| @@ -20,10 +20,11 @@ | |
| 20 | package require Tcl 8.4 ; # Required runtime. |
| 21 | package require snit ; # OO system. |
| 22 | package require vc::tools::misc ; # Text formatting. |
| 23 | package require vc::tools::log ; # User feedback. |
| 24 | package require vc::fossil::import::cvs::state ; # State storage. |
| 25 | package require vc::fossil::import::cvs::project::sym ; # Project level symbols |
| 26 | |
| 27 | # # ## ### ##### ######## ############# ##################### |
| 28 | ## Register the pass with the management |
| 29 | |
| @@ -79,11 +80,23 @@ | |
| 79 | FilterExcludedSymbols |
| 80 | MutateSymbols |
| 81 | AdjustParents |
| 82 | RefineSymbols |
| 83 | |
| 84 | # Consider a rerun of the pass 2 paranoia checks. |
| 85 | } |
| 86 | |
| 87 | log write 1 filtersym "Filtering completed" |
| 88 | return |
| 89 | } |
| @@ -478,10 +491,11 @@ | |
| 478 | |
| 479 | namespace eval ::vc::fossil::import::cvs::pass { |
| 480 | namespace export filtersym |
| 481 | namespace eval filtersym { |
| 482 | namespace import ::vc::fossil::import::cvs::state |
| 483 | namespace eval project { |
| 484 | namespace import ::vc::fossil::import::cvs::project::sym |
| 485 | } |
| 486 | namespace import ::vc::tools::misc::nsp |
| 487 | namespace import ::vc::tools::log |
| 488 |
| --- tools/cvs2fossil/lib/c2f_pfiltersym.tcl | |
| +++ tools/cvs2fossil/lib/c2f_pfiltersym.tcl | |
| @@ -20,10 +20,11 @@ | |
| 20 | package require Tcl 8.4 ; # Required runtime. |
| 21 | package require snit ; # OO system. |
| 22 | package require vc::tools::misc ; # Text formatting. |
| 23 | package require vc::tools::log ; # User feedback. |
| 24 | package require vc::fossil::import::cvs::state ; # State storage. |
| 25 | package require vc::fossil::import::cvs::integrity ; # State storage integrity checks. |
| 26 | package require vc::fossil::import::cvs::project::sym ; # Project level symbols |
| 27 | |
| 28 | # # ## ### ##### ######## ############# ##################### |
| 29 | ## Register the pass with the management |
| 30 | |
| @@ -79,11 +80,23 @@ | |
| 80 | FilterExcludedSymbols |
| 81 | MutateSymbols |
| 82 | AdjustParents |
| 83 | RefineSymbols |
| 84 | |
| 85 | # Strict integrity enforces that all meta entries are in |
| 86 | # the same LOD as the revision using them. At this point |
| 87 | # this may not be true any longer. If a NTDB was excluded |
| 88 | # then all revisions it shared with the trunk were moved |
| 89 | # to the trunk LOD, however their meta entries will still |
| 90 | # refer to the now gone LOD symbol. This is fine however, |
| 91 | # it will not affect our ability to use the meta entries |
| 92 | # to distinguish and group revisions into changesets. It |
| 93 | # should be noted that we cannot simply switch the meta |
| 94 | # entries over to the trunk either, as that may cause the |
| 95 | # modified entries to violate the unique-ness constrain |
| 96 | # set on that table. |
| 97 | integrity metarelaxed |
| 98 | } |
| 99 | |
| 100 | log write 1 filtersym "Filtering completed" |
| 101 | return |
| 102 | } |
| @@ -478,10 +491,11 @@ | |
| 491 | |
| 492 | namespace eval ::vc::fossil::import::cvs::pass { |
| 493 | namespace export filtersym |
| 494 | namespace eval filtersym { |
| 495 | namespace import ::vc::fossil::import::cvs::state |
| 496 | namespace import ::vc::fossil::import::cvs::integrity |
| 497 | namespace eval project { |
| 498 | namespace import ::vc::fossil::import::cvs::project::sym |
| 499 | } |
| 500 | namespace import ::vc::tools::misc::nsp |
| 501 | namespace import ::vc::tools::log |
| 502 |
| --- tools/cvs2fossil/lib/pkgIndex.tcl | ||
| +++ tools/cvs2fossil/lib/pkgIndex.tcl | ||
| @@ -8,10 +8,11 @@ | ||
| 8 | 8 | package ifneeded vc::fossil::import::cvs::file::lodmgr 1.0 [list source [file join $dir c2f_flodmgr.tcl]] |
| 9 | 9 | package ifneeded vc::fossil::import::cvs::file::rev 1.0 [list source [file join $dir c2f_frev.tcl]] |
| 10 | 10 | package ifneeded vc::fossil::import::cvs::file::sym 1.0 [list source [file join $dir c2f_fsym.tcl]] |
| 11 | 11 | package ifneeded vc::fossil::import::cvs::file::trunk 1.0 [list source [file join $dir c2f_ftrunk.tcl]] |
| 12 | 12 | package ifneeded vc::fossil::import::cvs::option 1.0 [list source [file join $dir c2f_option.tcl]] |
| 13 | +package ifneeded vc::fossil::import::cvs::integrity 1.0 [list source [file join $dir c2f_integrity.tcl]] | |
| 13 | 14 | package ifneeded vc::fossil::import::cvs::pass 1.0 [list source [file join $dir c2f_pass.tcl]] |
| 14 | 15 | package ifneeded vc::fossil::import::cvs::pass::collar 1.0 [list source [file join $dir c2f_pcollar.tcl]] |
| 15 | 16 | package ifneeded vc::fossil::import::cvs::pass::collrev 1.0 [list source [file join $dir c2f_pcollrev.tcl]] |
| 16 | 17 | package ifneeded vc::fossil::import::cvs::pass::collsym 1.0 [list source [file join $dir c2f_pcollsym.tcl]] |
| 17 | 18 | package ifneeded vc::fossil::import::cvs::pass::filtersym 1.0 [list source [file join $dir c2f_pfiltersym.tcl]] |
| 18 | 19 |
| --- tools/cvs2fossil/lib/pkgIndex.tcl | |
| +++ tools/cvs2fossil/lib/pkgIndex.tcl | |
| @@ -8,10 +8,11 @@ | |
| 8 | package ifneeded vc::fossil::import::cvs::file::lodmgr 1.0 [list source [file join $dir c2f_flodmgr.tcl]] |
| 9 | package ifneeded vc::fossil::import::cvs::file::rev 1.0 [list source [file join $dir c2f_frev.tcl]] |
| 10 | package ifneeded vc::fossil::import::cvs::file::sym 1.0 [list source [file join $dir c2f_fsym.tcl]] |
| 11 | package ifneeded vc::fossil::import::cvs::file::trunk 1.0 [list source [file join $dir c2f_ftrunk.tcl]] |
| 12 | package ifneeded vc::fossil::import::cvs::option 1.0 [list source [file join $dir c2f_option.tcl]] |
| 13 | package ifneeded vc::fossil::import::cvs::pass 1.0 [list source [file join $dir c2f_pass.tcl]] |
| 14 | package ifneeded vc::fossil::import::cvs::pass::collar 1.0 [list source [file join $dir c2f_pcollar.tcl]] |
| 15 | package ifneeded vc::fossil::import::cvs::pass::collrev 1.0 [list source [file join $dir c2f_pcollrev.tcl]] |
| 16 | package ifneeded vc::fossil::import::cvs::pass::collsym 1.0 [list source [file join $dir c2f_pcollsym.tcl]] |
| 17 | package ifneeded vc::fossil::import::cvs::pass::filtersym 1.0 [list source [file join $dir c2f_pfiltersym.tcl]] |
| 18 |
| --- tools/cvs2fossil/lib/pkgIndex.tcl | |
| +++ tools/cvs2fossil/lib/pkgIndex.tcl | |
| @@ -8,10 +8,11 @@ | |
| 8 | package ifneeded vc::fossil::import::cvs::file::lodmgr 1.0 [list source [file join $dir c2f_flodmgr.tcl]] |
| 9 | package ifneeded vc::fossil::import::cvs::file::rev 1.0 [list source [file join $dir c2f_frev.tcl]] |
| 10 | package ifneeded vc::fossil::import::cvs::file::sym 1.0 [list source [file join $dir c2f_fsym.tcl]] |
| 11 | package ifneeded vc::fossil::import::cvs::file::trunk 1.0 [list source [file join $dir c2f_ftrunk.tcl]] |
| 12 | package ifneeded vc::fossil::import::cvs::option 1.0 [list source [file join $dir c2f_option.tcl]] |
| 13 | package ifneeded vc::fossil::import::cvs::integrity 1.0 [list source [file join $dir c2f_integrity.tcl]] |
| 14 | package ifneeded vc::fossil::import::cvs::pass 1.0 [list source [file join $dir c2f_pass.tcl]] |
| 15 | package ifneeded vc::fossil::import::cvs::pass::collar 1.0 [list source [file join $dir c2f_pcollar.tcl]] |
| 16 | package ifneeded vc::fossil::import::cvs::pass::collrev 1.0 [list source [file join $dir c2f_pcollrev.tcl]] |
| 17 | package ifneeded vc::fossil::import::cvs::pass::collsym 1.0 [list source [file join $dir c2f_pcollsym.tcl]] |
| 18 | package ifneeded vc::fossil::import::cvs::pass::filtersym 1.0 [list source [file join $dir c2f_pfiltersym.tcl]] |
| 19 |