Diff
Not logged in

Differences From:

File tools/cvs2fossil/lib/c2f_pbreakacycle.tcl part of check-in [2a0ec504c5] - Cycle breaker, API change. The changesets are now communicated via a retrieval callback instead of directly. Updated passes 6 and 7. This allowed us to move the start/done graph exports into the cyclebreaker as well. Changeset selection in pass 8 now in separate command too for this. by aku on 2007-11-21 04:36:13. [view]

To:

File tools/cvs2fossil/lib/c2f_pbreakacycle.tcl part of check-in [1f60018119] - Fixed typo in cycle breaker logging. Extended pass 8, wrote the outline with all the relevant custom callbacks. by aku on 2007-11-21 04:44:13. [view]

@@ -22,8 +22,9 @@
 package require Tcl 8.4                                   ; # Required runtime.
 package require snit                                      ; # OO system.
 package require struct::list                              ; # Higher order list operations.
 package require vc::tools::log                            ; # User feedback.
+package require vc::fossil::import::cvs::repository       ; # Repository management.
 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
 
@@ -58,11 +59,17 @@
     typemethod run {} {
 	# Pass manager interface. Executed to perform the
 	# functionality of the pass.
 
-	set changesets [project::rev all]
-	#cyclebreaker dot break-all-start $changesets
-
+	cyclebreaker precmd   [myproc BreakRetrogradeBranches]
+	cyclebreaker savecmd  [myproc SaveOrder]
+	cyclebreaker breakcmd [myproc BreakCycle]
+
+	state transaction {
+	    cyclebreaker run break-all [myproc Changesets]
+	}
+
+	repository printcsetstatistics
 	return
     }
 
     typemethod discard {} {
@@ -77,8 +84,24 @@
 
     proc Changesets {} { project::rev all }
 
     # # ## ### ##### ######## #############
+
+    proc BreakRetrogradeBranches {graph} {
+    }
+
+    # # ## ### ##### ######## #############
+
+    proc SaveOrder {cset pos} {
+    }
+
+    # # ## ### ##### ######## #############
+
+    proc BreakCycle {graph} {
+	cyclebreaker break $graph
+    }
+
+    # # ## ### ##### ######## #############
     ## Configuration
 
     pragma -hasinstances   no ; # singleton
     pragma -hastypeinfo    no ; # no introspection
@@ -90,8 +113,9 @@
 namespace eval ::vc::fossil::import::cvs::pass {
     namespace export breakacycle
     namespace eval breakacycle {
 	namespace import ::vc::fossil::import::cvs::cyclebreaker
+	namespace import ::vc::fossil::import::cvs::repository
 	namespace import ::vc::fossil::import::cvs::state
 	namespace eval project {
 	    namespace import ::vc::fossil::import::cvs::project::rev
 	}