Check-in [2a0ec504c5]
Not logged in
Overview

SHA1 Hash:2a0ec504c5d4e843a0e9ff637dbe025af7a85d0b
Date: 2007-11-21 04:36:13
User: aku
Comment: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.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified tools/cvs2fossil/lib/c2f_cyclebreaker.tcl from [674bdc4eb4] to [999857d4f3].

@@ -66,11 +66,11 @@
 	return
     }
 
     # # ## ### ##### ######## #############
 
-    typemethod run {label changesets} {
+    typemethod run {label changesetcmd} {
 	::variable myat        0
 	::variable mydotprefix $label
 	::variable mydotid     0
 
 	# We create a graph of the revision changesets, using the file
@@ -79,10 +79,11 @@
 	# in that graph and break them.
 
 	# 1. Create nodes for all relevant changesets and a mapping
 	#    from the revisions to their changesets/nodes.
 
+	set changesets [uplevel #0 $changesetcmd]
 	set dg [Setup $changesets]
 
 	# 3. Lastly we iterate the graph topologically. We mark off
 	#    the nodes which have no predecessors, in order from
 	#    oldest to youngest, saving and removing dependencies. If
@@ -103,14 +104,24 @@
 
 	    BreakCycleHook       $dg
 	    InitializeCandidates $dg
 	}
 
-	dg destroy
+	$dg destroy
 
 	log write 3 cyclebreaker Done.
 	ClearHooks
+
+	# Reread the graph and dump its final form, if graph export
+	# was activated.
+
+	::variable mydotdestination
+	if {$mydotdestination eq ""} return
+
+	set   dg [Setup [uplevel #0 $changesetcmd] 0]
+	Mark $dg -done
+	$dg destroy
 	return
     }
 
     # # ## ### ##### ######## #############
 
@@ -153,12 +164,13 @@
 	}
 
 	# Run the user hook to manipulate the graph before
 	# consummation.
 
+	if {$log} { Mark $dg -start }
 	PreHook $dg
-	return $dg
+	return  $dg
     }
 
     # Instead of searching the whole graph for the degree-0 nodes in
     # each iteration we compute the list once to start, and then only
     # update it incrementally based on the outgoing neighbours of the
@@ -357,10 +369,11 @@
 
 	::variable myprecmd
 	if {![llength $myprecmd]} return
 
 	uplevel #0 [linsert $myprecmd end $graph]
+	Mark $graph -pre-done
 	return
     }
 
     proc ProcessedHook {cset pos} {
 	# Give the user of the cycle breaker the opportunity to work

Modified tools/cvs2fossil/lib/c2f_pbreakacycle.tcl from [c92253ed90] to [dbc8fff944].

@@ -58,11 +58,11 @@
     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 dot break-all-start $changesets
 
 	return
     }
 
     typemethod discard {} {
@@ -72,10 +72,12 @@
 	return
     }
 
     # # ## ### ##### ######## #############
     ## Internal methods
+
+    proc Changesets {} { project::rev all }
 
     # # ## ### ##### ######## #############
     ## Configuration
 
     pragma -hasinstances   no ; # singleton

Modified tools/cvs2fossil/lib/c2f_pbreakrcycle.tcl from [1228cf6726] to [9bec773f1f].

@@ -72,21 +72,16 @@
 
     typemethod run {} {
 	# Pass manager interface. Executed to perform the
 	# functionality of the pass.
 
-	set changesets [Changesets]
-	cyclebreaker dot break-rev-start $changesets
-
 	cyclebreaker savecmd  [myproc SaveOrder]
 	cyclebreaker breakcmd {::vc::fossil::import::cvs::cyclebreaker break}
 
 	state transaction {
-	    cyclebreaker run break-rev $changesets
-	}
-
-	cyclebreaker dot break-rev-done [Changesets]
+	    cyclebreaker run break-rev [myproc Changesets]
+	}
 
 	repository printcsetstatistics
 	return
     }
 

Modified tools/cvs2fossil/lib/c2f_pbreakscycle.tcl from [3177172d52] to [436cc24e8c].

@@ -60,20 +60,15 @@
 
     typemethod run {} {
 	# Pass manager interface. Executed to perform the
 	# functionality of the pass.
 
-	set changesets [Changesets]
-	cyclebreaker dot break-sym-start $changesets
-
 	cyclebreaker breakcmd {::vc::fossil::import::cvs::cyclebreaker break}
 
 	state transaction {
-	    cyclebreaker run break-sym $changesets
-	}
-
-	cyclebreaker dot break-sym-done [Changesets]
+	    cyclebreaker run break-sym [myproc Changesets]
+	}
 
 	repository printcsetstatistics
 	return
     }