gitk: Fix bug causing Tcl error when updating graph

If "Show nearby tags" is turned off, selecting "Update" from the File
menu will cause a Tcl error.  This fixes it.  The problem was that
we were calling regetallcommits unconditionally, but it assumed that
getallcommits had been called previously.  This also restructures
{re,}getallcommits to be a bit simpler.

Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
Paul Mackerras 2007-08-13 15:02:02 +10:00
parent 7b459a1c1c
commit a69b2d1a8b

14
gitk
View File

@ -296,7 +296,7 @@ proc readcommit {id} {
proc updatecommits {} { proc updatecommits {} {
global viewdata curview phase displayorder global viewdata curview phase displayorder
global children commitrow selectedline thickerline global children commitrow selectedline thickerline showneartags
if {$phase ne {}} { if {$phase ne {}} {
stop_rev_list stop_rev_list
@ -313,7 +313,9 @@ proc updatecommits {} {
catch {unset viewdata($n)} catch {unset viewdata($n)}
readrefs readrefs
changedrefs changedrefs
regetallcommits if {$showneartags} {
getallcommits
}
showview $n showview $n
} }
@ -6199,17 +6201,13 @@ proc rmbranch {} {
proc getallcommits {} { proc getallcommits {} {
global allcommits allids nbmp nextarc seeds global allcommits allids nbmp nextarc seeds
if {![info exists allcommits]} {
set allids {} set allids {}
set nbmp 0 set nbmp 0
set nextarc 0 set nextarc 0
set allcommits 0 set allcommits 0
set seeds {} set seeds {}
regetallcommits }
}
# Called when the graph might have changed
proc regetallcommits {} {
global allcommits seeds
set cmd [concat | git rev-list --all --parents] set cmd [concat | git rev-list --all --parents]
foreach id $seeds { foreach id $seeds {