@@ -307,7 +307,7 @@ proc start_rev_list {view} {
307
307
global viewargs viewargscmd viewfiles vfilelimit
308
308
global showlocalchanges commitinterest
309
309
global viewactive viewinstances vmergeonly
310
- global pending_select mainheadid
310
+ global mainheadid
311
311
global vcanopt vflags vrevs vorigargs
312
312
313
313
set startmsecs [clock clicks -milliseconds]
@@ -374,9 +374,6 @@ proc start_rev_list {view} {
374
374
}
375
375
filerun $fd [list getcommitlines $fd $i $view 0]
376
376
nowbusy $view [mc " Reading" ]
377
- if {$view == $curview } {
378
- set pending_select $mainheadid
379
- }
380
377
set viewcomplete($view ) 0
381
378
set viewactive($view ) 1
382
379
return 1
@@ -418,11 +415,22 @@ proc stop_rev_list {view} {
418
415
set viewinstances($view ) {}
419
416
}
420
417
421
- proc getcommits {} {
418
+ proc reset_pending_select {selid} {
419
+ global pending_select mainheadid
420
+
421
+ if {$selid ne {}} {
422
+ set pending_select $selid
423
+ } else {
424
+ set pending_select $mainheadid
425
+ }
426
+ }
427
+
428
+ proc getcommits {selid} {
422
429
global canv curview need_redisplay viewactive
423
430
424
431
initlayout
425
432
if {[start_rev_list $curview ]} {
433
+ reset_pending_select $selid
426
434
show_status [mc " Reading commits..." ]
427
435
set need_redisplay 1
428
436
} else {
@@ -503,7 +511,7 @@ proc updatecommits {} {
503
511
filerun $fd [list getcommitlines $fd $i $view 1]
504
512
incr viewactive($view )
505
513
set viewcomplete($view ) 0
506
- set pending_select $mainheadid
514
+ reset_pending_select {}
507
515
nowbusy $view " Reading"
508
516
if {$showneartags } {
509
517
getallcommits
@@ -515,6 +523,11 @@ proc reloadcommits {} {
515
523
global showneartags treediffs commitinterest cached_commitrow
516
524
global targetid
517
525
526
+ set selid {}
527
+ if {$selectedline ne {}} {
528
+ set selid $currentid
529
+ }
530
+
518
531
if {!$viewcomplete($curview) } {
519
532
stop_rev_list $curview
520
533
}
@@ -533,7 +546,7 @@ proc reloadcommits {} {
533
546
catch {unset cached_commitrow}
534
547
catch {unset targetid}
535
548
setcanvscroll
536
- getcommits
549
+ getcommits $selid
537
550
return 0
538
551
}
539
552
@@ -3325,10 +3338,7 @@ proc showview {n} {
3325
3338
3326
3339
run refill_reflist
3327
3340
if {![info exists viewcomplete($n )]} {
3328
- if {$selid ne {}} {
3329
- set pending_select $selid
3330
- }
3331
- getcommits
3341
+ getcommits $selid
3332
3342
return
3333
3343
}
3334
3344
@@ -3365,11 +3375,7 @@ proc showview {n} {
3365
3375
} elseif {$mainheadid ne {} && [commitinview $mainheadid $curview ]} {
3366
3376
selectline [rowofcommit $mainheadid ] 1
3367
3377
} elseif {!$viewcomplete($n) } {
3368
- if {$selid ne {}} {
3369
- set pending_select $selid
3370
- } else {
3371
- set pending_select $mainheadid
3372
- }
3378
+ reset_pending_select $selid
3373
3379
} else {
3374
3380
set row [first_real_row]
3375
3381
if {$row < $numcommits } {
@@ -4036,6 +4042,7 @@ proc layoutmore {} {
4036
4042
}
4037
4043
if {[info exists pending_select] &&
4038
4044
[commitinview $pending_select $curview ]} {
4045
+ update
4039
4046
selectline [rowofcommit $pending_select ] 1
4040
4047
}
4041
4048
drawvisible
@@ -9973,4 +9980,4 @@ if {[info exists permviews]} {
9973
9980
addviewmenu $n
9974
9981
}
9975
9982
}
9976
- getcommits
9983
+ getcommits {}
0 commit comments