summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f9e0b6f)
raw | patch | inline | side by side (parent: f9e0b6f)
author | Paul Mackerras <paulus@samba.org> | |
Tue, 4 Mar 2008 10:32:38 +0000 (21:32 +1100) | ||
committer | Paul Mackerras <paulus@samba.org> | |
Tue, 4 Mar 2008 10:32:38 +0000 (21:32 +1100) |
First, insertfakerow and removefakerow weren't updating vrowmod,
and hence displayorder was not getting updated when it needed to,
in the case where the fake row was being inserted into or removed
from the last arc. The comparison of varctok vs vtokmod was moved
into modify_arc for these cases (and for the call in rewrite_commit)
to avoid duplicating the extra code needed. Second, the logic in
update_arcrows didn't end up truncating displayorder and unsetting
cached_commitrow if the first modified row was in the last arc.
This fixes these problems.
Signed-off-by: Paul Mackerras <paulus@samba.org>
and hence displayorder was not getting updated when it needed to,
in the case where the fake row was being inserted into or removed
from the last arc. The comparison of varctok vs vtokmod was moved
into modify_arc for these cases (and for the call in rewrite_commit)
to avoid duplicating the extra code needed. Second, the logic in
update_arcrows didn't end up truncating displayorder and unsetting
cached_commitrow if the first modified row was in the last arc.
This fixes these problems.
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk | patch | blob | history |
index a6eea5014649605fb6d11f5d56cd16229e34d93c..f2ebc600e78fc0668c9fe84f7451e50ac0f99036 100755 (executable)
--- a/gitk
+++ b/gitk
set numcommits [incr commitidx($v)]
# note we deliberately don't update varcstart($v) even if $i == 0
set varccommits($v,$a) [linsert $varccommits($v,$a) $i $id]
- if {[string compare [lindex $varctok($v) $a] $vtokmod($v)] < 0} {
- modify_arc $v $a $i
- }
+ modify_arc $v $a $i
if {[info exists targetid]} {
if {![comes_before $targetid $p]} {
incr targetrow
if {$j >= 0} {
set children($v,$p) [lreplace $children($v,$p) $j $j]
}
- if {[string compare [lindex $varctok($v) $a] $vtokmod($v)] < 0} {
- modify_arc $v $a $i
- }
+ modify_arc $v $a $i
if {[info exist currentid] && $id eq $currentid} {
unset currentid
unset selectedline
[lindex $varctok($v) $varcid($v,$b)]]
}
+# This assumes that if lim is not given, the caller has checked that
+# arc a's token is less than $vtokmod($v)
proc modify_arc {v a {lim {}}} {
global varctok vtokmod varcmod varcrow vupptr curview vrowmod varccommits
+ if {$lim ne {}} {
+ set c [string compare [lindex $varctok($v) $a] $vtokmod($v)]
+ if {$c > 0} return
+ if {$c == 0} {
+ set r [lindex $varcrow($v) $a]
+ if {$r ne {} && $vrowmod($v) <= $r + $lim} return
+ }
+ }
set vtokmod($v) [lindex $varctok($v) $a]
set varcmod($v) $a
if {$v == $curview} {
global vupptr vdownptr vleftptr varctok
global displayorder parentlist curview cached_commitrow
+ if {$vrowmod($v) == $commitidx($v)} return
+ if {$v == $curview} {
+ if {[llength $displayorder] > $vrowmod($v)} {
+ set displayorder [lrange $displayorder 0 [expr {$vrowmod($v) - 1}]]
+ set parentlist [lrange $parentlist 0 [expr {$vrowmod($v) - 1}]]
+ }
+ catch {unset cached_commitrow}
+ }
set narctot [expr {[llength $varctok($v)] - 1}]
set a $varcmod($v)
while {$a != 0 && [lindex $varcix($v) $a] eq {}} {
set row 0
} else {
set arcn [lindex $varcix($v) $a]
- # see if a is the last arc; if so, nothing to do
- if {$arcn == $narctot - 1} {
- return
- }
if {[llength $vrownum($v)] > $arcn + 1} {
set vrownum($v) [lrange $vrownum($v) 0 $arcn]
set varcorder($v) [lrange $varcorder($v) 0 $arcn]
}
set row [lindex $varcrow($v) $a]
}
- if {$v == $curview} {
- if {[llength $displayorder] > $vrowmod($v)} {
- set displayorder [lrange $displayorder 0 [expr {$vrowmod($v) - 1}]]
- set parentlist [lrange $parentlist 0 [expr {$vrowmod($v) - 1}]]
- }
- catch {unset cached_commitrow}
- }
while {1} {
set p $a
incr row [llength $varccommits($v,$a)]
# fix the graph after joining $id to $rwid
set a $varcid($v,$ch)
fix_reversal $rwid $a $v
- if {[string compare [lindex $varctok($v) $a] $vtokmod($v)] < 0} {
- # parentlist is wrong for the last element of arc $a
- # even if displayorder is right, hence the 3rd arg here
- modify_arc $v $a [expr {[llength $varccommits($v,$a)] - 1}]
- }
+ # parentlist is wrong for the last element of arc $a
+ # even if displayorder is right, hence the 3rd arg here
+ modify_arc $v $a [expr {[llength $varccommits($v,$a)] - 1}]
}
}