summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 00abadb)
raw | patch | inline | side by side (parent: 00abadb)
author | Paul Mackerras <paulus@samba.org> | |
Wed, 26 Dec 2007 12:03:43 +0000 (23:03 +1100) | ||
committer | Paul Mackerras <paulus@samba.org> | |
Wed, 26 Dec 2007 12:03:43 +0000 (23:03 +1100) |
* Fixed a bug that occasionally resulted in Tcl "can't use empty string
as argument to incr" errors - rowofcommit was sometimes not calling
update_arcrows when it needed to.
* Fixed a "no such element in array" error when removing a fake row,
by unsetting currentid and selectedline in removerow if the row we
are removing is the currently selected row.
* Made the "update commits" function always do "reread references".
* Made dodiffindex et al. remove the fake row(s) if necessary.
* Fixed a bug where clicking on a row in the graph display pane didn't
account for horizontal scrolling of the pane.
* Started changing things that cached information based on row numbers
to use commit IDs instead -- this converts the "select line" items
that are put into the history list to use "select by ID" instead.
* Simplified redrawtags a bit, and fixed a bug where it would use the
mainfont for working out how far it extends to the right in the graph
display pane rather than the actual font (which might be bold).
* Fixed a bug where "reread references" wouldn't notice if the currently
checked-out head had changed.
Signed-off-by: Paul Mackerras <paulus@samba.org>
as argument to incr" errors - rowofcommit was sometimes not calling
update_arcrows when it needed to.
* Fixed a "no such element in array" error when removing a fake row,
by unsetting currentid and selectedline in removerow if the row we
are removing is the currently selected row.
* Made the "update commits" function always do "reread references".
* Made dodiffindex et al. remove the fake row(s) if necessary.
* Fixed a bug where clicking on a row in the graph display pane didn't
account for horizontal scrolling of the pane.
* Started changing things that cached information based on row numbers
to use commit IDs instead -- this converts the "select line" items
that are put into the history list to use "select by ID" instead.
* Simplified redrawtags a bit, and fixed a bug where it would use the
mainfont for working out how far it extends to the right in the graph
display pane rather than the actual font (which might be bold).
* Fixed a bug where "reread references" wouldn't notice if the currently
checked-out head had changed.
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk | patch | blob | history |
index 86dd575ca71655606c1be4293d0bcd6e0cdb34ef..b5c9e7a1b4165d34d7aec1beb670a6b268ff8375 100755 (executable)
--- a/gitk
+++ b/gitk
if {$showlocalchanges && [commitinview $mainheadid $curview]} {
dodiffindex
}
+ rereadrefs
set view $curview
set commits [exec git rev-parse --default HEAD --revs-only \
$viewargs($view)]
incr viewactive($view)
set viewcomplete($view) 0
nowbusy $view "Reading"
- readrefs
- changedrefs
if {$showneartags} {
getallcommits
}
proc removerow {id v} {
global varcid varccommits parents children commitidx
- global varctok vtokmod cmitlisted
+ global varctok vtokmod cmitlisted currentid selectedline
if {[llength $parents($v,$id)] != 1} {
puts "oops: removerow [shortids $id] has [llength $parents($v,$id)] parents"
if {[string compare [lindex $varctok($v) $a] $vtokmod($v)] < 0} {
modify_arc $v $a $i
}
+ if {[info exist currentid] && $id eq $currentid} {
+ unset currentid
+ unset selectedline
+ }
drawvisible
}
return {}
}
set a $varcid($v,$id)
- if {[string compare [lindex $varctok($v) $a] $vtokmod($v)] > 0} {
+ if {[string compare [lindex $varctok($v) $a] $vtokmod($v)] >= 0} {
update_arcrows $v
}
set i [lsearch -exact $varccommits($v,$a) $id]
}
proc readdiffindex {fd serial} {
- global mainheadid nullid2 curview commitinfo commitdata lserial
+ global mainheadid nullid nullid2 curview commitinfo commitdata lserial
set isdiff 1
if {[gets $fd line] < 0} {
set hl [mc "Local changes checked in to index but not committed"]
set commitinfo($nullid2) [list $hl {} {} {} {} " $hl\n"]
set commitdata($nullid2) "\n $hl\n"
+ if {[commitinview $nullid $curview]} {
+ removerow $nullid $curview
+ }
insertrow $nullid2 $mainheadid $curview
} elseif {!$isdiff && [commitinview $nullid2 $curview]} {
removerow $nullid2 $curview
set l 0
}
if {$w eq $canv} {
- if {![info exists rowtextx($l)] || $x < $rowtextx($l)} return
+ set xmax [lindex [$canv cget -scrollregion] 2]
+ set xleft [expr {[lindex [$canv xview] 0] * $xmax}]
+ if {![info exists rowtextx($l)] || $xleft + $x < $rowtextx($l)} return
}
unmarkmatches
selectline $l 1
make_secsel $l
+ set id [commitonrow $l]
if {$isnew} {
- addtohistory [list selectline $l 0]
+ addtohistory [list selbyid $id]
}
set selectedline $l
-
- set id [commitonrow $l]
set currentid $id
$sha1entry delete 0 end
$sha1entry insert 0 $id
}
proc redrawtags {id} {
- global canv linehtag idpos selectedline curview
+ global canv linehtag idpos currentid curview
global canvxmax iddrawn
if {![commitinview $id $curview]} return
if {![info exists iddrawn($id)]} return
- drawcommits [rowofcommit $id]
+ set row [rowofcommit $id]
$canv delete tag.$id
set xt [eval drawtags $id $idpos($id)]
- $canv coords $linehtag([rowofcommit $id]) $xt [lindex $idpos($id) 2]
- set text [$canv itemcget $linehtag([rowofcommit $id]) -text]
- set xr [expr {$xt + [font measure mainfont $text]}]
+ $canv coords $linehtag($row) $xt [lindex $idpos($id) 2]
+ set text [$canv itemcget $linehtag($row) -text]
+ set font [$canv itemcget $linehtag($row) -font]
+ set xr [expr {$xt + [font measure $font $text]}]
if {$xr > $canvxmax} {
set canvxmax $xr
setcanvscroll
}
- if {[info exists selectedline]
- && $selectedline == [rowofcommit $id]} {
- selectline $selectedline 0
+ if {[info exists currentid] && $currentid == $id} {
+ make_secsel $row
}
}
}
proc rereadrefs {} {
- global idtags idheads idotherrefs mainhead
+ global idtags idheads idotherrefs mainheadid
set refids [concat [array names idtags] \
[array names idheads] [array names idotherrefs]]
set ref($id) [listrefs $id]
}
}
- set oldmainhead $mainhead
+ set oldmainhead $mainheadid
readrefs
changedrefs
set refids [lsort -unique [concat $refids [array names idtags] \
foreach id $refids {
set v [listrefs $id]
if {![info exists ref($id)] || $ref($id) != $v ||
- ($id eq $oldmainhead && $id ne $mainhead) ||
- ($id eq $mainhead && $id ne $oldmainhead)} {
+ ($id eq $oldmainhead && $id ne $mainheadid) ||
+ ($id eq $mainheadid && $id ne $oldmainhead)} {
redrawtags $id
}
}