Fix behaviour in the case where we have no commits to display.
I had code in there to put "No commits selected" on the canvas but it needed some globals.maint
parent
e2ede2b9f5
commit
8a0a74ad77
23
gitk
23
gitk
|
@ -894,11 +894,11 @@ proc drawslants {} {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
proc decidenext {} {
|
proc decidenext {{noread 0}} {
|
||||||
global parents children nchildren ncleft todo
|
global parents children nchildren ncleft todo
|
||||||
global canv canv2 canv3 mainfont namefont canvx0 canvy linespc
|
global canv canv2 canv3 mainfont namefont canvx0 canvy linespc
|
||||||
global datemode cdate
|
global datemode cdate
|
||||||
global lineid linehtag linentag linedtag commitinfo
|
global commitinfo
|
||||||
global currentparents oldlevel oldnlines oldtodo
|
global currentparents oldlevel oldnlines oldtodo
|
||||||
global lineno lthickness
|
global lineno lthickness
|
||||||
|
|
||||||
|
@ -916,6 +916,12 @@ proc decidenext {} {
|
||||||
set p [lindex $todo $k]
|
set p [lindex $todo $k]
|
||||||
if {$ncleft($p) == 0} {
|
if {$ncleft($p) == 0} {
|
||||||
if {$datemode} {
|
if {$datemode} {
|
||||||
|
if {![info exists commitinfo($p)]} {
|
||||||
|
if {$noread} {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
readcommit $p
|
||||||
|
}
|
||||||
if {$latest == {} || $cdate($p) > $latest} {
|
if {$latest == {} || $cdate($p) > $latest} {
|
||||||
set level $k
|
set level $k
|
||||||
set latest $cdate($p)
|
set latest $cdate($p)
|
||||||
|
@ -976,15 +982,16 @@ proc drawcommit {id} {
|
||||||
lappend todo $id
|
lappend todo $id
|
||||||
lappend startcommits $id
|
lappend startcommits $id
|
||||||
}
|
}
|
||||||
set level [decidenext]
|
set level [decidenext 1]
|
||||||
if {$id != [lindex $todo $level]} {
|
if {$level == {} || $id != [lindex $todo $level]} {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
while 1 {
|
while 1 {
|
||||||
drawslants
|
drawslants
|
||||||
drawcommitline $level
|
drawcommitline $level
|
||||||
if {[updatetodo $level $datemode]} {
|
if {[updatetodo $level $datemode]} {
|
||||||
set level [decidenext]
|
set level [decidenext 1]
|
||||||
|
if {$level == {}} break
|
||||||
}
|
}
|
||||||
set id [lindex $todo $level]
|
set id [lindex $todo $level]
|
||||||
if {![info exists commitlisted($id)]} {
|
if {![info exists commitlisted($id)]} {
|
||||||
|
@ -1001,18 +1008,18 @@ proc drawcommit {id} {
|
||||||
proc finishcommits {} {
|
proc finishcommits {} {
|
||||||
global phase
|
global phase
|
||||||
global startcommits
|
global startcommits
|
||||||
global ctext maincursor textcursor
|
global canv mainfont ctext maincursor textcursor
|
||||||
|
|
||||||
if {$phase != "incrdraw"} {
|
if {$phase != "incrdraw"} {
|
||||||
$canv delete all
|
$canv delete all
|
||||||
$canv create text 3 3 -anchor nw -text "No commits selected" \
|
$canv create text 3 3 -anchor nw -text "No commits selected" \
|
||||||
-font $mainfont -tags textitems
|
-font $mainfont -tags textitems
|
||||||
set phase {}
|
set phase {}
|
||||||
return
|
} else {
|
||||||
}
|
|
||||||
drawslants
|
drawslants
|
||||||
set level [decidenext]
|
set level [decidenext]
|
||||||
drawrest $level [llength $startcommits]
|
drawrest $level [llength $startcommits]
|
||||||
|
}
|
||||||
. config -cursor $maincursor
|
. config -cursor $maincursor
|
||||||
$ctext config -cursor $textcursor
|
$ctext config -cursor $textcursor
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue