@@ -94,30 +94,21 @@ proc dorunq {} {
9494proc start_rev_list {view} {
9595 global startmsecs
9696 global commfd leftover tclencoding datemode
97- global viewargs viewfiles commitidx viewcomplete vnextroot
97+ global viewargs viewfiles commitidx viewcomplete
9898 global showlocalchanges commitinterest mainheadid
9999 global progressdirn progresscoords proglastnc curview
100- global viewincl viewactive loginstance viewinstances
100+ global viewactive loginstance viewinstances
101101 global pending_select mainheadid
102102
103103 set startmsecs [clock clicks -milliseconds]
104104 set commitidx($view ) 0
105105 set viewcomplete($view ) 0
106106 set viewactive($view ) 1
107- set vnextroot($view ) 0
108107 varcinit $view
109108
110- set commits [eval exec git rev-parse --default HEAD --revs-only \
111- $viewargs($view) ]
112- set viewincl($view ) {}
113- foreach c $commits {
114- if {[regexp {^[0-9a-fA-F]{40}$} $c ]} {
115- lappend viewincl($view ) $c
116- }
117- }
118109 if {[catch {
119110 set fd [open [concat | git log --no-color -z --pretty=raw --parents \
120- --boundary $commits " --" $viewfiles($view) ] r]
111+ --boundary $viewargs($view) " --" $viewfiles($view) ] r]
121112 } err]} {
122113 error_popup " [ mc " Error executing git log:" ] $err "
123114 exit 1
@@ -170,9 +161,9 @@ proc getcommits {} {
170161}
171162
172163proc updatecommits {} {
173- global curview viewargs viewfiles viewincl viewinstances
164+ global curview viewargs viewfiles viewinstances
174165 global viewactive viewcomplete loginstance tclencoding mainheadid
175- global varcid startmsecs commfd showneartags showlocalchanges leftover
166+ global startmsecs commfd showneartags showlocalchanges leftover
176167 global mainheadid pending_select
177168
178169 set oldmainid $mainheadid
@@ -186,33 +177,10 @@ proc updatecommits {} {
186177 }
187178 }
188179 set view $curview
189- set commits [exec git rev-parse --default HEAD --revs-only \
190- $viewargs($view) ]
191- set pos {}
192- set neg {}
193- set flags {}
194- foreach c $commits {
195- if {[string match " ^*" $c ]} {
196- lappend neg $c
197- } elseif {[regexp {^[0-9a-fA-F]{40}$} $c ]} {
198- if {!([info exists varcid($view ,$c )] ||
199- [lsearch -exact $viewincl($view) $c ] >= 0)} {
200- lappend pos $c
201- }
202- } else {
203- lappend flags $c
204- }
205- }
206- if {$pos eq {}} {
207- return
208- }
209- foreach id $viewincl($view) {
210- lappend neg " ^$id "
211- }
212- set viewincl($view ) [concat $viewincl($view) $pos ]
213180 if {[catch {
214181 set fd [open [concat | git log --no-color -z --pretty=raw --parents \
215- --boundary $pos $neg $flags " --" $viewfiles($view) ] r]
182+ --boundary $viewargs($view) --not [seeds $view ] \
183+ " --" $viewfiles($view) ] r]
216184 } err]} {
217185 error_popup " Error executing git log: $err "
218186 exit 1
@@ -322,6 +290,19 @@ proc resetvarcs {view} {
322290 catch {unset ordertok}
323291}
324292
293+ # returns a list of the commits with no children
294+ proc seeds {v} {
295+ global vdownptr vleftptr varcstart
296+
297+ set ret {}
298+ set a [lindex $vdownptr($v) 0]
299+ while {$a != 0} {
300+ lappend ret [lindex $varcstart($v) $a ]
301+ set a [lindex $vleftptr($v) $a ]
302+ }
303+ return $ret
304+ }
305+
325306proc newvarc {view id} {
326307 global varcid varctok parents children datemode
327308 global vupptr vdownptr vleftptr vbackptr varcrow varcix varcstart
@@ -1000,7 +981,7 @@ proc getcommitlines {fd inst view updating} {
1000981 global cmitlisted commitinterest leftover
1001982 global commitidx commitdata datemode
1002983 global parents children curview hlview
1003- global vnextroot idpending ordertok
984+ global idpending ordertok
1004985 global varccommits varcid varctok vtokmod viewfiles
1005986
1006987 set stuff [read $fd 500000]
@@ -7103,7 +7084,7 @@ proc mkbrgo {top} {
71037084}
71047085
71057086proc cherrypick {} {
7106- global rowmenuid curview viewincl
7087+ global rowmenuid curview
71077088 global mainhead mainheadid
71087089
71097090 set oldhead [exec git rev-parse HEAD]
@@ -7137,12 +7118,6 @@ proc cherrypick {} {
71377118 movedhead $newhead $mainhead
71387119 set mainheadid $newhead
71397120 }
7140- # remove oldhead from viewincl and add newhead
7141- set i [lsearch -exact $viewincl($curview) $oldhead ]
7142- if {$i >= 0} {
7143- set viewincl($curview ) [lreplace $viewincl($curview) $i $i ]
7144- }
7145- lappend viewincl($curview ) $newhead
71467121 redrawtags $oldhead
71477122 redrawtags $newhead
71487123 selbyid $newhead
0 commit comments