Differences From:
File tools/cvs2fossil/lib/c2f_cyclebreaker.tcl part of check-in [487bb1c619] - Modified loop check in cycle breaker to abort immediately on first looped changeset. by aku on 2007-12-02 06:18:42. [view]
To:
File tools/cvs2fossil/lib/c2f_cyclebreaker.tcl part of check-in [00bf8c198e] - The performance was still not satisfying, even with faster recomputing of successors. Doing it multiple times (Building the graph in each breaker and sort passes) eats time. Caching in memory blows the memory. Chosen solution: Cache this information in the database.Created a new pass 'CsetDeps' which is run between 'InitCsets' and 'BreakRevCsetCycles' (i.e. changeset creation and first breaker pass). It computes the changeset dependencies from the file-level dependencies once and saves the result in the state, in the new table 'cssuccessor'. Now the breaker and sort passes can get the information quickly, with virtually no effort. The dependencies are recomputed incrementally when a changeset is split by one of the breaker passes, for its fragments and its predecessors.
The loop check is now trivial, and integrated into the successor computation, with the heavy lifting for the detailed analysis and reporting moved down into the type-dependent SQL queries. The relevant new method is 'loops'. Now that the loop check is incremental the pass based checks have been removed from the integrity module, and the option '--loopcheck' has been eliminated. For paranoia the graph setup and modification code got its loop check reinstated as an assert, redusing the changeset report code.
Renumbered the breaker and sort passes. A number of places, like graph setup and traversal, loading of changesets, etc. got feedback indicators to show their progress.
The selection of revision and symbol changesets for the associated breaker passes was a bit on the slow side. We now keep changeset lists sorted by type (during loading or general construction) and access them directly.
by aku on 2007-12-02 20:04:40. [view]
@@ -103,10 +103,14 @@ log write 3 cyclebreaker {Traverse changesets} InitializeCandidates $dg + + set k 0 + set max [llength [$dg nodes]] while {1} { while {[WithoutPredecessor $dg n]} { + log progress 2 cyclebreaker $k $max ; incr k MarkWatch $dg ProcessedHook $dg $n $myat $dg node delete $n incr myat @@ -206,12 +210,11 @@ # Changesets may have dependencies outside of the # chosen set. These are ignored if {![$dg node exists $succ]} continue $dg arc insert $cset $succ - if {$succ eq $cset} { - $cset loopcheck - trouble internal "[$cset str] depends on itself" - } + integrity assert { + $succ ne $cset + } {[$cset reportloop 0]Changeset loop was not detected during creation} } incr n } @@ -430,12 +433,11 @@ # The new changesets may have dependencies outside of # the chosen set. These are ignored if {![$dg node exists $succ]} continue $dg arc insert $cset $succ - if {$succ eq $cset} { - $cset loopcheck - trouble internal "[$cset str] depends on itself" - } + integrity assert { + $succ ne $cset + } {[$cset reportloop 0]Changeset loop was not detected during creation} } } foreach cset $pre { foreach succ [$cset successors] { @@ -556,10 +558,10 @@ namespace eval ::vc::fossil::import::cvs { namespace export cyclebreaker namespace eval cyclebreaker { - namespace eval project { - namespace import ::vc::fossil::import::cvs::integrity + namespace import ::vc::fossil::import::cvs::integrity + namespace eval project { namespace import ::vc::fossil::import::cvs::project::rev namespace import ::vc::fossil::import::cvs::project::revlink } namespace import ::vc::tools::misc::*