summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 17529cf)
raw | patch | inline | side by side (parent: 17529cf)
author | Paul Mackerras <paulus@samba.org> | |
Sun, 13 Jan 2008 06:26:30 +0000 (17:26 +1100) | ||
committer | Paul Mackerras <paulus@samba.org> | |
Sun, 13 Jan 2008 06:26:30 +0000 (17:26 +1100) |
Instead of selecting the first commit that appears, this makes gitk
select the currently checked out head, if the user hasn't explicitly
selected some other commit by the time it appears. If the head hasn't
appeared by the time the graph is complete, then we select the first
real commit.
This applies both for graph updates and when the graph is being read
in initially.
Signed-off-by: Paul Mackerras <paulus@samba.org>
select the currently checked out head, if the user hasn't explicitly
selected some other commit by the time it appears. If the head hasn't
appeared by the time the graph is complete, then we select the first
real commit.
This applies both for graph updates and when the graph is being read
in initially.
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk | patch | blob | history |
index 8699e1bb4f97dc3e1a6ec9d5a43e4fdf6323a3e8..8b4c61c56320eb15086c948d1a86c836b5648846 100755 (executable)
--- a/gitk
+++ b/gitk
global showlocalchanges commitinterest mainheadid
global progressdirn progresscoords proglastnc curview
global viewincl viewactive loginstance viewinstances
+ global pending_select mainheadid
set startmsecs [clock clicks -milliseconds]
set commitidx($view) 0
set progressdirn 1
set progresscoords {0 0}
set proglastnc 0
+ set pending_select $mainheadid
}
}
global curview viewargs viewfiles viewincl viewinstances
global viewactive viewcomplete loginstance tclencoding mainheadid
global varcid startmsecs commfd showneartags showlocalchanges leftover
- global mainheadid
+ global mainheadid pending_select
set oldmainid $mainheadid
rereadrefs
filerun $fd [list getcommitlines $fd $i $view]
incr viewactive($view)
set viewcomplete($view) 0
+ set pending_select $mainheadid
nowbusy $view "Reading"
if {$showneartags} {
getallcommits
global numcommits viewcomplete
global selectedline currentid canv canvy0
global treediffs
- global pending_select
+ global pending_select mainheadid
global commitidx
- global selectedview selectfirst
+ global selectedview
global hlview selectedhlview commitinterest
if {$n == $curview} return
setcanvscroll
set yf 0
set row {}
- set selectfirst 0
if {$selid ne {} && [commitinview $selid $n]} {
set row [rowofcommit $selid]
# try to get the selected row in the same position on the screen
drawvisible
if {$row ne {}} {
selectline $row 0
- } elseif {$selid ne {}} {
- set pending_select $selid
+ } elseif {$mainheadid ne {} && [commitinview $mainheadid $curview]} {
+ selectline [rowofcommit $mainheadid] 1
+ } elseif {!$viewcomplete($n)} {
+ if {$selid ne {}} {
+ set pending_select $selid
+ } else {
+ set pending_select $mainheadid
+ }
} else {
set row [first_real_row]
if {$row < $numcommits} {
selectline $row 0
- } else {
- set selectfirst 1
}
}
if {!$viewcomplete($n)} {
global numcommits canvxmax canv
global nextcolor
global colormap rowtextx
- global selectfirst
set numcommits 0
set displayorder {}
set canvxmax [$canv cget -width]
catch {unset colormap}
catch {unset rowtextx}
- set selectfirst 1
}
proc setcanvscroll {} {
proc layoutmore {} {
global commitidx viewcomplete curview
global numcommits pending_select selectedline curview
- global selectfirst lastscrollset commitinterest
+ global lastscrollset commitinterest
set canshow $commitidx($curview)
if {$canshow <= $numcommits && !$viewcomplete($curview)} return
[commitinview $pending_select $curview]} {
selectline [rowofcommit $pending_select] 1
}
- if {$selectfirst} {
- if {[info exists selectedline] || [info exists pending_select]} {
- set selectfirst 0
- } else {
- set l [first_real_row]
- selectline $l 1
- set selectfirst 0
- }
- }
}
proc doshowlocalchanges {} {