From 841ea8244913bd8953fdd43e54d9965f02bebae6 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Mon, 18 Feb 2008 10:44:33 +1100 Subject: [PATCH] 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 --- gitk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gitk b/gitk index 1dd73f7d8..a50ef7947 100755 --- a/gitk +++ b/gitk @@ -415,11 +415,12 @@ proc splitvarc {p v} { set varcid($v,$id) $na } lappend vdownptr($v) [lindex $vdownptr($v) $oa] + lappend vlastins($v) [lindex $vlastins($v) $oa] lset vdownptr($v) $oa $na + lset vlastins($v) $oa 0 lappend vupptr($v) $oa lappend vleftptr($v) 0 lappend vbackptr($v) 0 - lappend vlastins($v) 0 for {set b [lindex $vdownptr($v) $na]} {$b != 0} {set b [lindex $vleftptr($v) $b]} { lset vupptr($v) $b $na } @@ -513,6 +514,9 @@ proc renumbervarc {a v} { if {$d != 0} { lset vbackptr($v) $d $c } + if {[lindex $vlastins($v) $b] == $a} { + lset vlastins($v) $b $c + } lset vupptr($v) $a $ka set c [lindex $vlastins($v) $ka] if {$c == 0 || \ -- 2.11.0