@@ -17,13 +17,12 @@ proc gitdir {} {
17
17
}
18
18
19
19
proc start_rev_list {view} {
20
- global startmsecs nextupdate ncmupdate
20
+ global startmsecs nextupdate
21
21
global commfd leftover tclencoding datemode
22
22
global viewargs viewfiles commitidx
23
23
24
24
set startmsecs [clock clicks -milliseconds]
25
25
set nextupdate [expr {$startmsecs + 100}]
26
- set ncmupdate 1
27
26
set commitidx($view ) 0
28
27
set args $viewargs($view)
29
28
if {$viewfiles($view) ne {}} {
@@ -79,7 +78,7 @@ proc getcommitlines {fd view} {
79
78
global parentlist childlist children curview hlview
80
79
global vparentlist vchildlist vdisporder vcmitlisted
81
80
82
- set stuff [read $fd ]
81
+ set stuff [read $fd 500000 ]
83
82
if {$stuff == {}} {
84
83
if {![eof $fd ]} return
85
84
global viewname
@@ -185,7 +184,7 @@ proc getcommitlines {fd view} {
185
184
}
186
185
if {$gotsome } {
187
186
if {$view == $curview } {
188
- layoutmore
187
+ while {[ layoutmore $nextupdate ]} doupdate
189
188
} elseif {[info exists hlview] && $view == $hlview } {
190
189
vhighlightmore
191
190
}
@@ -196,20 +195,13 @@ proc getcommitlines {fd view} {
196
195
}
197
196
198
197
proc doupdate {} {
199
- global commfd nextupdate numcommits ncmupdate
198
+ global commfd nextupdate numcommits
200
199
201
200
foreach v [array names commfd] {
202
201
fileevent $commfd($v) readable {}
203
202
}
204
203
update
205
204
set nextupdate [expr {[clock clicks -milliseconds] + 100}]
206
- if {$numcommits < 100} {
207
- set ncmupdate [expr {$numcommits + 1}]
208
- } elseif {$numcommits < 10000} {
209
- set ncmupdate [expr {$numcommits + 10}]
210
- } else {
211
- set ncmupdate [expr {$numcommits + 100}]
212
- }
213
205
foreach v [array names commfd] {
214
206
set fd $commfd($v)
215
207
fileevent $fd readable [list getcommitlines $fd $v ]
@@ -1697,7 +1689,7 @@ proc showview {n} {
1697
1689
show_status " Reading commits..."
1698
1690
}
1699
1691
if {[info exists commfd($n )]} {
1700
- layoutmore
1692
+ layoutmore {}
1701
1693
} else {
1702
1694
finishcommits
1703
1695
}
@@ -2378,20 +2370,38 @@ proc visiblerows {} {
2378
2370
return [list $r0 $r1 ]
2379
2371
}
2380
2372
2381
- proc layoutmore {} {
2373
+ proc layoutmore {tmax } {
2382
2374
global rowlaidout rowoptim commitidx numcommits optim_delay
2383
2375
global uparrowlen curview
2384
2376
2385
- set row $rowlaidout
2386
- set rowlaidout [layoutrows $row $commitidx($curview) 0]
2387
- set orow [expr {$rowlaidout - $uparrowlen - 1}]
2388
- if {$orow > $rowoptim } {
2389
- optimize_rows $rowoptim 0 $orow
2390
- set rowoptim $orow
2391
- }
2392
- set canshow [expr {$rowoptim - $optim_delay }]
2393
- if {$canshow > $numcommits } {
2394
- showstuff $canshow
2377
+ while {1} {
2378
+ if {$rowoptim - $optim_delay > $numcommits } {
2379
+ showstuff [expr {$rowoptim - $optim_delay }]
2380
+ } elseif {$rowlaidout - $uparrowlen - 1 > $rowoptim } {
2381
+ set nr [expr {$rowlaidout - $uparrowlen - 1 - $rowoptim }]
2382
+ if {$nr > 100} {
2383
+ set nr 100
2384
+ }
2385
+ optimize_rows $rowoptim 0 [expr {$rowoptim + $nr }]
2386
+ incr rowoptim $nr
2387
+ } elseif {$commitidx($curview) > $rowlaidout } {
2388
+ set nr [expr {$commitidx($curview) - $rowlaidout }]
2389
+ # may need to increase this threshold if uparrowlen or
2390
+ # mingaplen are increased...
2391
+ if {$nr > 150} {
2392
+ set nr 150
2393
+ }
2394
+ set row $rowlaidout
2395
+ set rowlaidout [layoutrows $row [expr {$row + $nr }] 0]
2396
+ if {$rowlaidout == $row } {
2397
+ return 0
2398
+ }
2399
+ } else {
2400
+ return 0
2401
+ }
2402
+ if {$tmax ne {} && [clock clicks -milliseconds] >= $tmax } {
2403
+ return 1
2404
+ }
2395
2405
}
2396
2406
}
2397
2407
0 commit comments