Skip to content

Commit

Permalink
gitk: Fix bug where arcs could get lost
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Paul Mackerras committed Feb 17, 2008
1 parent 585fb59 commit 841ea82
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gitk
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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 || \
Expand Down

0 comments on commit 841ea82

Please sign in to comment.