174
if {$showlocalchanges && [commitinview $mainheadid $curview]} {
175
dodiffindex
176
}
177
+ rereadrefs
178
set view $curview
179
set commits [exec git rev-parse --default HEAD --revs-only \
180
$viewargs($view)]
219
incr viewactive($view)
220
set viewcomplete($view) 0
221
nowbusy $view "Reading"
221
- readrefs
222
- changedrefs
222
if {$showneartags} {
223
getallcommits
224
}
578
579
proc removerow {id v} {
580
global varcid varccommits parents children commitidx
582
- global varctok vtokmod cmitlisted
581
+ global varctok vtokmod cmitlisted currentid selectedline
582
583
if {[llength $parents($v,$id)] != 1} {
584
puts "oops: removerow [shortids $id] has [llength $parents($v,$id)] parents"
604
if {[string compare [lindex $varctok($v) $a] $vtokmod($v)] < 0} {
605
modify_arc $v $a $i
606
}
607
+ if {[info exist currentid] && $id eq $currentid} {
608
+ unset currentid
609
+ unset selectedline
610
+ }
611
drawvisible
612
}
613
736
return {}
737
}
738
set a $varcid($v,$id)
736
- if {[string compare [lindex $varctok($v) $a] $vtokmod($v)] > 0} {
739
+ if {[string compare [lindex $varctok($v) $a] $vtokmod($v)] >= 0} {
740
update_arcrows $v
741
}
742
set i [lsearch -exact $varccommits($v,$a) $id]
3518
}
3519
3520
proc readdiffindex {fd serial} {
3518
- global mainheadid nullid2 curview commitinfo commitdata lserial
3521
+ global mainheadid nullid nullid2 curview commitinfo commitdata lserial
3522
3523
set isdiff 1
3524
if {[gets $fd line] < 0} {
3544
set hl [mc "Local changes checked in to index but not committed"]
3545
set commitinfo($nullid2) [list $hl {} {} {} {} " $hl\n"]
3546
set commitdata($nullid2) "\n $hl\n"
3547
+ if {[commitinview $nullid $curview]} {
3548
+ removerow $nullid $curview
3549
+ }
3550
insertrow $nullid2 $mainheadid $curview
3551
} elseif {!$isdiff && [commitinview $nullid2 $curview]} {
3552
removerow $nullid2 $curview
5064
set l 0
5065
}
5066
if {$w eq $canv} {
5061
- if {![info exists rowtextx($l)] || $x < $rowtextx($l)} return
5067
+ set xmax [lindex [$canv cget -scrollregion] 2]
5068
+ set xleft [expr {[lindex [$canv xview] 0] * $xmax}]
5069
+ if {![info exists rowtextx($l)] || $xleft + $x < $rowtextx($l)} return
5070
}
5071
unmarkmatches
5072
selectline $l 1
5313
5314
make_secsel $l
5315
5316
+ set id [commitonrow $l]
5317
if {$isnew} {
5309
- addtohistory [list selectline $l 0]
5318
+ addtohistory [list selbyid $id]
5319
}
5320
5321
set selectedline $l
5313
-
5314
- set id [commitonrow $l]
5322
set currentid $id
5323
$sha1entry delete 0 end
5324
$sha1entry insert 0 $id
6772
}
6773
6774
proc redrawtags {id} {
6768
- global canv linehtag idpos selectedline curview
6775
+ global canv linehtag idpos currentid curview
6776
global canvxmax iddrawn
6777
6778
if {![commitinview $id $curview]} return
6779
if {![info exists iddrawn($id)]} return
6773
- drawcommits [rowofcommit $id]
6780
+ set row [rowofcommit $id]
6781
$canv delete tag.$id
6782
set xt [eval drawtags $id $idpos($id)]
6776
- $canv coords $linehtag([rowofcommit $id]) $xt [lindex $idpos($id) 2]
6777
- set text [$canv itemcget $linehtag([rowofcommit $id]) -text]
6778
- set xr [expr {$xt + [font measure mainfont $text]}]
6783
+ $canv coords $linehtag($row) $xt [lindex $idpos($id) 2]
6784
+ set text [$canv itemcget $linehtag($row) -text]
6785
+ set font [$canv itemcget $linehtag($row) -font]
6786
+ set xr [expr {$xt + [font measure $font $text]}]
6787
if {$xr > $canvxmax} {
6788
set canvxmax $xr
6789
setcanvscroll
6790
}
6783
- if {[info exists selectedline]
6784
- && $selectedline == [rowofcommit $id]} {
6785
- selectline $selectedline 0
6791
+ if {[info exists currentid] && $currentid == $id} {
6792
+ make_secsel $row
6793
}
6794
}
6795
8349
}
8350
8351
proc rereadrefs {} {
8345
- global idtags idheads idotherrefs mainhead
8352
+ global idtags idheads idotherrefs mainheadid
8353
8354
set refids [concat [array names idtags] \
8355
[array names idheads] [array names idotherrefs]]
8358
set ref($id) [listrefs $id]
8359
}
8360
}
8354
- set oldmainhead $mainhead
8361
+ set oldmainhead $mainheadid
8362
readrefs
8363
changedrefs
8364
set refids [lsort -unique [concat $refids [array names idtags] \
8366
foreach id $refids {
8367
set v [listrefs $id]
8368
if {![info exists ref($id)] || $ref($id) != $v ||
8362
- ($id eq $oldmainhead && $id ne $mainhead) ||
8363
- ($id eq $mainhead && $id ne $oldmainhead)} {
8369
+ ($id eq $oldmainhead && $id ne $mainheadid) ||
8370
+ ($id eq $mainheadid && $id ne $oldmainhead)} {
8371
redrawtags $id
8372
}
8373
}