Differences From:
File
tools/cvs2fossil/lib/c2f_cyclebreaker.tcl
part of check-in
[b679ca3356]
- Code cleanup. Removed trailing whitespace across the board.
by
aku on
2007-11-25 07:54:09.
[view]
To:
File
tools/cvs2fossil/lib/c2f_cyclebreaker.tcl
part of check-in
[3e18606b5c]
- Bugfix: Sort pending nodes fully deterministic, and moved to separate helper command. Tweaked log output.
by
aku on
2007-11-27 09:05:45.
[view]
@@ -251,9 +251,9 @@
foreach n [$dg nodes] {
if {[$dg node degree -in $n]} continue
lappend mybottom [linsert [$dg node get $n timerange] 0 $n]
}
- set mybottom [lsort -index 1 -integer [lsort -index 2 -integer $mybottom]]
+ ScheduleCandidates
ShowPendingNodes
return
}
@@ -278,9 +278,9 @@
lappend mybottom [linsert [$dg node get $out timerange] 0 $out]
set changed 1
}
if {$changed} {
- set mybottom [lsort -index 1 -integer [lsort -index 2 -integer $mybottom]]
+ ScheduleCandidates
}
# We do not delete the node immediately, to allow the Save
# procedure to save the dependencies as well (encoded in the
@@ -287,17 +287,27 @@
# arcs).
return 1
}
+ proc ScheduleCandidates {} {
+ ::variable mybottom
+ set mybottom [lsort -index 1 -integer [lsort -index 2 -integer [lsort -index 0 -dict $mybottom]]]
+ return
+ }
+
proc ShowPendingNodes {} {
if {[log verbosity?] < 10} return
::variable mybottom
- log write 10 cyclebreaker \
- "Pending: [struct::list map $mybottom [myproc FormatPendingItem]]"
+ log write 10 cyclebreaker "Pending..............................."
+ foreach item [struct::list map $mybottom [myproc FormatPendingItem]] {
+ log write 10 cyclebreaker "Pending: $item"
+ }
return
}
- proc FormatPendingItem {item} { lreplace $item 0 0 [[lindex $item 0] str] }
+ proc FormatPendingItem {item} {
+ join [list [[lindex $item 0] str] [clock format [lindex $item 1]] [clock format [lindex $item 2]]]
+ }
proc FindCycle {dg} {
# This procedure is run if and only the graph is not empty and
# all nodes have predecessors. This means that each node is