Differences From:
File
tools/cvs2fossil/lib/c2f_cyclebreaker.tcl
part of check-in
[1e177a4c91]
- Cycle breaker, API extension. Added a hook to process the graph between setup and regular consummation. This will be used by pass 8.
by
aku on
2007-11-21 04:11:59.
[view]
To:
File
tools/cvs2fossil/lib/c2f_cyclebreaker.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]
@@ -67,9 +67,9 @@
}
# # ## ### ##### ######## #############
- typemethod run {label changesets} {
+ typemethod run {label changesetcmd} {
::variable myat 0
::variable mydotprefix $label
::variable mydotid 0
@@ -80,8 +80,9 @@
# 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
@@ -104,12 +105,22 @@
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
}
# # ## ### ##### ######## #############
@@ -154,10 +165,11 @@
# 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
@@ -358,8 +370,9 @@
::variable myprecmd
if {![llength $myprecmd]} return
uplevel #0 [linsert $myprecmd end $graph]
+ Mark $graph -pre-done
return
}
proc ProcessedHook {cset pos} {