aboutsummaryrefslogtreecommitdiff
path: root/gitk
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2007-08-12 17:23:47 +1000
committerPaul Mackerras <paulus@samba.org>2007-08-12 17:23:47 +1000
commit67a4f1a7f5c778ffa23d1e562feb4cc6d52c9414 (patch)
tree2696edfe28c97b44c45a55f3857ae51e3895e7ee /gitk
parent3244729aac7515ccda651d40f41cef94517ac089 (diff)
downloadgit-67a4f1a7f5c778ffa23d1e562feb4cc6d52c9414.tar.gz
git-67a4f1a7f5c778ffa23d1e562feb4cc6d52c9414.tar.xz
gitk: Fix bug causing the "can't unset idinlist(...)" error
Under some circumstances, having duplicate parents in a commit could trigger a "can't unset idinlist" Tcl error. This fixes the cause (the logic in layoutrows could end up putting the same commit into rowidlist twice) and also puts a catch around the unset to ignore the error. Thanks to Jeff King for coming up with a test script to generate a repo that shows the problem. Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'gitk')
-rwxr-xr-xgitk5
1 files changed, 2 insertions, 3 deletions
diff --git a/gitk b/gitk
index 6c2be3b72..44b04f017 100755
--- a/gitk
+++ b/gitk
@@ -2880,6 +2880,7 @@ proc layoutrows {row endrow last} {
} elseif {!$idinlist($p)} {
lappend oldolds $p
}
+ set idinlist($p) 1
}
set nev [expr {[llength $idlist] + [llength $newolds]
+ [llength $oldolds] - $maxwidth + 1}]
@@ -2952,12 +2953,10 @@ proc layoutrows {row endrow last} {
lset offs $col {}
}
foreach i $newolds {
- set idinlist($i) 1
set idrowranges($i) $id
}
incr col $l
foreach oid $oldolds {
- set idinlist($oid) 1
set idlist [linsert $idlist $col $oid]
set offs [linsert $offs $col $o]
makeuparrow $oid $col $row $o
@@ -2998,7 +2997,7 @@ proc layouttail {} {
set col [expr {[llength $idlist] - 1}]
set id [lindex $idlist $col]
addextraid $id $row
- unset idinlist($id)
+ catch {unset idinlist($id)}
lappend idrowranges($id) $id
lappend rowrangelist $idrowranges($id)
unset idrowranges($id)