If a view is selected it will now just update that view.
Also fixed a few other things - if you switch away from a view while
gitk is still reading it in, then switch back, gitk will re-read it
from scratch. We now re-read the references when switching views.
If something was selected before a view change, and we need to read
in the new view, we now select the previously-selected commit when
we come across it.
Fixed a bug in setting of rowrangelist plus a couple of other minor
things.
Signed-off-by: Paul Mackerras <paulus@samba.org>
set parsed_args {}
set cmdline_files {}
if {[catch {
set parsed_args {}
set cmdline_files {}
if {[catch {
- set parse_args [concat --default HEAD $rargs]
- set args [split [eval exec git-rev-parse $parse_args] "\n"]
+ set args [concat --default HEAD $rargs]
+ set args [split [eval exec git-rev-parse $args] "\n"]
set i 0
foreach arg $args {
if {![regexp {^[0-9a-f]{40}$} $arg]} {
set i 0
foreach arg $args {
if {![regexp {^[0-9a-f]{40}$} $arg]} {
}
proc updatecommits {} {
}
proc updatecommits {} {
+ global viewdata curview revtreeargs
- unselectline
- stopfindproc
- foreach v {matchinglines treediffs currentid} {
- global $v
- catch {unset $v}
- }
- clear_display
- readrefs
- getcommits $parsed_args
+ set n $curview
+ set curview -1
+ catch {unset viewdata($n)}
+ parse_args $revtreeargs
+ showview $n
}
proc parsecommit {id contents listed} {
}
proc parsecommit {id contents listed} {
-proc makewindow {rargs} {
global canv canv2 canv3 linespc charspc ctext cflist textfont
global findtype findtypemenu findloc findstring fstring geometry
global entries sha1entry sha1string sha1but
global canv canv2 canv3 linespc charspc ctext cflist textfont
global findtype findtypemenu findloc findstring fstring geometry
global entries sha1entry sha1string sha1but
-proc saveview {} {
- global curview viewdata
- global displayorder parentlist childlist rowidlist rowoffsets
- global rowrangelist commitlisted
-
-}
-
proc showview {n} {
global curview viewdata viewfiles
global displayorder parentlist childlist rowidlist rowoffsets
proc showview {n} {
global curview viewdata viewfiles
global displayorder parentlist childlist rowidlist rowoffsets
global selectedline currentid canv canvy0
global matchinglines treediffs
global parsed_args
global selectedline currentid canv canvy0
global matchinglines treediffs
global parsed_args
+ global pending_select phase
if {$n == $curview} return
set selid {}
if {$n == $curview} return
set selid {}
}
unselectline
stopfindproc
}
unselectline
stopfindproc
- if {![info exists viewdata($curview)]} {
+ if {$curview >= 0 && $phase eq {} && ![info exists viewdata($curview)]} {
set viewdata($curview) \
[list $displayorder $parentlist $childlist $rowidlist \
$rowoffsets $rowrangelist $commitlisted]
set viewdata($curview) \
[list $displayorder $parentlist $childlist $rowidlist \
$rowoffsets $rowrangelist $commitlisted]
catch {unset matchinglines}
catch {unset treediffs}
clear_display
catch {unset matchinglines}
catch {unset treediffs}
clear_display
set curview $n
.bar.view entryconf 2 -state [expr {$n == 0? "disabled": "normal"}]
set curview $n
.bar.view entryconf 2 -state [expr {$n == 0? "disabled": "normal"}]
if {$viewfiles($n) ne {}} {
set args [concat $args "--" $viewfiles($n)]
}
if {$viewfiles($n) ne {}} {
set args [concat $args "--" $viewfiles($n)]
}
+ set pending_select $selid
getcommits $args
return
}
getcommits $args
return
}
set commitlisted {}
set parentlist {}
set childlist {}
set commitlisted {}
set parentlist {}
set childlist {}
catch {unset children}
set nextcolor 0
set rowidlist {{}}
catch {unset children}
set nextcolor 0
set rowidlist {{}}
}
proc showstuff {canshow} {
}
proc showstuff {canshow} {
+ global numcommits commitrow pending_select
global linesegends idrowranges idrangedrawn
if {$numcommits == 0} {
global linesegends idrowranges idrangedrawn
if {$numcommits == 0} {
set rows [visiblerows]
set r0 [lindex $rows 0]
set r1 [lindex $rows 1]
set rows [visiblerows]
set r0 [lindex $rows 0]
set r1 [lindex $rows 1]
for {set r $row} {$r < $canshow} {incr r} {
if {[info exists linesegends($r)]} {
foreach id $linesegends($r) {
for {set r $row} {$r < $canshow} {incr r} {
if {[info exists linesegends($r)]} {
foreach id $linesegends($r) {
drawcmitrow $row
incr row
}
drawcmitrow $row
incr row
}
+ if {[info exists pending_select] &&
+ [info exists commitrow($pending_select)] &&
+ $commitrow($pending_select) < $numcommits} {
+ selectline $commitrow($pending_select) 1
+ }
}
proc layoutrows {row endrow last} {
}
proc layoutrows {row endrow last} {
} else {
unset idinlist($id)
}
} else {
unset idinlist($id)
}
if {[info exists idrowranges($id)]} {
lappend idrowranges($id) $row
if {[info exists idrowranges($id)]} {
lappend idrowranges($id) $row
- lappend rowrangelist $idrowranges($id)
+ set ranges $idrowranges($id)
+ lappend rowrangelist $ranges
incr row
set offs [ntimes [llength $idlist] 0]
set l [llength $newolds]
incr row
set offs [ntimes [llength $idlist] 0]
set l [llength $newolds]
foreach {s e} [rowranges $id] {
if {$e >= $numcommits} {
set e [expr {$numcommits - 1}]
foreach {s e} [rowranges $id] {
if {$e >= $numcommits} {
set e [expr {$numcommits - 1}]
set x [lsearch -exact [lindex $rowidlist $e] $id]
if {$x < 0} {
puts "findcrossings: oops, no [shortids $id] in row $e"
set x [lsearch -exact [lindex $rowidlist $e] $id]
if {$x < 0} {
puts "findcrossings: oops, no [shortids $id] in row $e"
global findid treediffs parentlist
global ffileline findstartline finddidsel
global displayorder numcommits matchinglines findinprogress
global findid treediffs parentlist
global ffileline findstartline finddidsel
global displayorder numcommits matchinglines findinprogress
global canvy0 linespc parentlist childlist
global cflist currentid sha1entry
global commentend idtags linknum
global canvy0 linespc parentlist childlist
global cflist currentid sha1entry
global commentend idtags linknum
- global mergemax numcommits
+ global mergemax numcommits pending_select
+ catch {unset pending_select}
$canv delete hover
normalline
if {$l < 0 || $l >= $numcommits} return
$canv delete hover
normalline
if {$l < 0 || $l >= $numcommits} return
incr nextupdate 100
fileevent $mdf readable {}
update
incr nextupdate 100
fileevent $mdf readable {}
update
- fileevent $mdf readable [list getmergediffline $mdf $id]
+ fileevent $mdf readable [list getmergediffline $mdf $id $np]
set stuffsaved 0
set patchnum 0
setcoords
set stuffsaved 0
set patchnum 0
setcoords
readrefs
parse_args $revtreeargs
set args $parsed_args
readrefs
parse_args $revtreeargs
set args $parsed_args