@matheusbsbs / matheus-bagliano / commits / 841ea82449
Fork 0

gitk: Fix bug where arcs could get lost

Because we weren't fixing up vlastins when moving an arc from one place to another, it was possible for us later to decide to move an arc to the wrong place, and end up with an arc disconnected from the rest of the graph. This fixes it by updating vlastins when necessary. Signed-off-by: Paul Mackerras <paulus@samba.org>

Paul Mackerras committed Feb 18, 2008 at 10:44 UTC 841ea8244913bd8953fdd43e54d9965f02bebae6
1 file changed +5 -1
gitk
+5 -1
@@ -415,11 +415,12 @@ proc splitvarc {p v} {
415 set varcid($v,$id) $na
416 }
417 lappend vdownptr($v) [lindex $vdownptr($v) $oa]
418 + lappend vlastins($v) [lindex $vlastins($v) $oa]
419 lset vdownptr($v) $oa $na
420 + lset vlastins($v) $oa 0
421 lappend vupptr($v) $oa
422 lappend vleftptr($v) 0
423 lappend vbackptr($v) 0
422 - lappend vlastins($v) 0
424 for {set b [lindex $vdownptr($v) $na]} {$b != 0} {set b [lindex $vleftptr($v) $b]} {
425 lset vupptr($v) $b $na
426 }
@@ -513,6 +514,9 @@ proc renumbervarc {a v} {
514 if {$d != 0} {
515 lset vbackptr($v) $d $c
516 }
517 + if {[lindex $vlastins($v) $b] == $a} {
518 + lset vlastins($v) $b $c
519 + }
520 lset vupptr($v) $a $ka
521 set c [lindex $vlastins($v) $ka]
522 if {$c == 0 || \