Diff
Not logged in

Differences From:

File tools/cvs2fossil/lib/c2f_pbreakscycle.tcl part of check-in [258366a37a] - Added skeleton files for pass 7, the breaking of dependency cycles over symbol-based changesets. by aku on 2007-11-15 07:17:07. [view]

To:

File tools/cvs2fossil/lib/c2f_pbreakscycle.tcl part of check-in [770a9b576a] - Completed pass 7, breaking dependency cycles over symbol changesets. Moved the bulk of the cycle breaker code into its own class as it was common to the passes 6 and 7, and updated the two passes accordingly. Added code to load the changeset counter from the state to start properly. by aku on 2007-11-16 04:17:30. [view]

@@ -11,17 +11,20 @@
 # # ## ### ##### ######## ############# #####################
 
 ## Pass VII. This pass goes over the set of symbol based changesets
 ## and breaks all dependency cycles they may be in. We need a
-## dependency tree.
+## dependency tree. Identical to pass VI, except for the selection of
+## the changesets.
 
 # # ## ### ##### ######## ############# #####################
 ## Requirements
 
 package require Tcl 8.4                                   ; # Required runtime.
 package require snit                                      ; # OO system.
-package require vc::tools::log                            ; # User feedback.
+package require struct::list                              ; # Higher order list operations.
+package require vc::fossil::import::cvs::cyclebreaker     ; # Breaking dependency cycles.
 package require vc::fossil::import::cvs::state            ; # State storage.
+package require vc::fossil::import::cvs::project::rev     ; # Project level changesets
 
 # # ## ### ##### ######## ############# #####################
 ## Register the pass with the management
 
@@ -52,8 +55,17 @@
 
     typemethod run {} {
 	# Pass manager interface. Executed to perform the
 	# functionality of the pass.
+
+	state reading revision
+	state reading changeset
+	state reading csrevision
+
+	state transaction {
+	    cyclebreaker run [struct::list filter [project::rev all] \
+				  [myproc IsBySymbol]]
+	}
 	return
     }
 
     typemethod discard {} {
@@ -64,8 +76,10 @@
     }
 
     # # ## ### ##### ######## #############
     ## Internal methods
+
+    proc IsBySymbol {cset} { $cset bysymbol }
 
     # # ## ### ##### ######## #############
     ## Configuration
 
@@ -78,11 +92,13 @@
 
 namespace eval ::vc::fossil::import::cvs::pass {
     namespace export breakscycle
     namespace eval breakscycle {
+	namespace import ::vc::fossil::import::cvs::cyclebreaker
 	namespace import ::vc::fossil::import::cvs::state
-	namespace import ::vc::tools::log
-	log register breakscycle
+	namespace eval project {
+	    namespace import ::vc::fossil::import::cvs::project::rev
+	}
     }
 }
 
 # # ## ### ##### ######## ############# #####################