@matheusbsbs / matheus-bagliano / commits / a69b2d1a8b
Fork 0

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>

Paul Mackerras committed Aug 13, 2007 at 15:02 UTC a69b2d1a8bf335ddbf0929c609b2daa523c7ede0
1 file changed +11 -13
gitk
+11 -13
@@ -296,7 +296,7 @@ proc readcommit {id} {
296
297 proc updatecommits {} {
298 global viewdata curview phase displayorder
299 - global children commitrow selectedline thickerline
299 + global children commitrow selectedline thickerline showneartags
300
301 if {$phase ne {}} {
302 stop_rev_list
@@ -313,7 +313,9 @@ proc updatecommits {} {
313 catch {unset viewdata($n)}
314 readrefs
315 changedrefs
316 - regetallcommits
316 + if {$showneartags} {
317 + getallcommits
318 + }
319 showview $n
320 }
321
@@ -6199,17 +6201,13 @@ proc rmbranch {} {
6201 proc getallcommits {} {
6202 global allcommits allids nbmp nextarc seeds
6203
6202 - set allids {}
6203 - set nbmp 0
6204 - set nextarc 0
6205 - set allcommits 0
6206 - set seeds {}
6207 - regetallcommits
6208 -}
6209 -
6210 -# Called when the graph might have changed
6211 -proc regetallcommits {} {
6212 - global allcommits seeds
6204 + if {![info exists allcommits]} {
6205 + set allids {}
6206 + set nbmp 0
6207 + set nextarc 0
6208 + set allcommits 0
6209 + set seeds {}
6210 + }
6211
6212 set cmd [concat | git rev-list --all --parents]
6213 foreach id $seeds {