summaryrefslogtreecommitdiff
path: root/gitk
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2007-08-13 04:52:00 (GMT)
committerPaul Mackerras <paulus@samba.org>2007-08-13 04:52:00 (GMT)
commit7b459a1c1cc5401295e3adb12031e39e35712f4a (patch)
treea8c78e51e44dc5b44b4f90cd5a6ea05acfd9558f /gitk
parent6c87d60cc6202d4de5ac6d136394602feefeafc6 (diff)
downloadgit-7b459a1c1cc5401295e3adb12031e39e35712f4a.zip
git-7b459a1c1cc5401295e3adb12031e39e35712f4a.tar.gz
git-7b459a1c1cc5401295e3adb12031e39e35712f4a.tar.bz2
gitk: Fix bug introduced in commit 67a4f1a7
In fixing the "can't unset idinlist" error, I moved the setting of idinlist into the loop that splits the parents into "new" parents (i.e. those of which this is the first child) and "old" parents. Unfortunately this is incorrect in the case where we hit the break statement a few lines further down, since when we come back in, we'll see idinlist($p) set for some parents that aren't in the list. This fixes it by moving the loop that sets up newolds and oldolds further down. Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'gitk')
-rwxr-xr-xgitk24
1 files changed, 14 insertions, 10 deletions
diff --git a/gitk b/gitk
index 769c79a..666a545 100755
--- a/gitk
+++ b/gitk
@@ -2895,18 +2895,12 @@ proc layoutrows {row endrow last} {
set offs [lindex $rowoffsets $row]
while {$row < $endrow} {
set id [lindex $displayorder $row]
- set oldolds {}
- set newolds {}
+ set nev [expr {[llength $idlist] - $maxwidth + 1}]
foreach p [lindex $parentlist $row] {
- if {![info exists idinlist($p)]} {
- lappend newolds $p
- } elseif {!$idinlist($p)} {
- lappend oldolds $p
+ if {![info exists idinlist($p)] || !$idinlist($p)} {
+ incr nev
}
- set idinlist($p) 1
}
- set nev [expr {[llength $idlist] + [llength $newolds]
- + [llength $oldolds] - $maxwidth + 1}]
if {$nev > 0} {
if {!$last &&
$row + $uparrowlen + $mingaplen >= $commitidx($curview)} break
@@ -2925,12 +2919,22 @@ proc layoutrows {row endrow last} {
if {[incr nev -1] <= 0} break
continue
}
- set rowchk($id) [expr {$row + $r}]
+ set rowchk($i) [expr {$row + $r}]
}
}
lset rowidlist $row $idlist
lset rowoffsets $row $offs
}
+ set oldolds {}
+ set newolds {}
+ foreach p [lindex $parentlist $row] {
+ if {![info exists idinlist($p)]} {
+ lappend newolds $p
+ } elseif {!$idinlist($p)} {
+ lappend oldolds $p
+ }
+ set idinlist($p) 1
+ }
set col [lsearch -exact $idlist $id]
if {$col < 0} {
set col [llength $idlist]