proc start_rev_list {view} {
global startmsecs
global commfd leftover tclencoding datemode
- global viewargs viewfiles commitidx viewcomplete vnextroot
+ global viewargs viewfiles commitidx viewcomplete
global showlocalchanges commitinterest mainheadid
global progressdirn progresscoords proglastnc curview
- global viewincl viewactive loginstance viewinstances
+ global viewactive loginstance viewinstances
global pending_select mainheadid
set startmsecs [clock clicks -milliseconds]
set commitidx($view) 0
set viewcomplete($view) 0
set viewactive($view) 1
- set vnextroot($view) 0
varcinit $view
- set commits [eval exec git rev-parse --default HEAD --revs-only \
- $viewargs($view)]
- set viewincl($view) {}
- foreach c $commits {
- if {[regexp {^[0-9a-fA-F]{40}$} $c]} {
- lappend viewincl($view) $c
- }
- }
if {[catch {
set fd [open [concat | git log --no-color -z --pretty=raw --parents \
- --boundary $commits "--" $viewfiles($view)] r]
+ --boundary $viewargs($view) "--" $viewfiles($view)] r]
} err]} {
error_popup "[mc "Error executing git log:"] $err"
exit 1
}
proc updatecommits {} {
- global curview viewargs viewfiles viewincl viewinstances
+ global curview viewargs viewfiles viewinstances
global viewactive viewcomplete loginstance tclencoding mainheadid
- global varcid startmsecs commfd showneartags showlocalchanges leftover
+ global startmsecs commfd showneartags showlocalchanges leftover
global mainheadid pending_select
set oldmainid $mainheadid
}
}
set view $curview
- set commits [exec git rev-parse --default HEAD --revs-only \
- $viewargs($view)]
- set pos {}
- set neg {}
- set flags {}
- foreach c $commits {
- if {[string match "^*" $c]} {
- lappend neg $c
- } elseif {[regexp {^[0-9a-fA-F]{40}$} $c]} {
- if {!([info exists varcid($view,$c)] ||
- [lsearch -exact $viewincl($view) $c] >= 0)} {
- lappend pos $c
- }
- } else {
- lappend flags $c
- }
- }
- if {$pos eq {}} {
- return
- }
- foreach id $viewincl($view) {
- lappend neg "^$id"
- }
- set viewincl($view) [concat $viewincl($view) $pos]
if {[catch {
set fd [open [concat | git log --no-color -z --pretty=raw --parents \
- --boundary $pos $neg $flags "--" $viewfiles($view)] r]
+ --boundary $viewargs($view) --not [seeds $view] \
+ "--" $viewfiles($view)] r]
} err]} {
error_popup "Error executing git log: $err"
exit 1
catch {unset ordertok}
}
+# returns a list of the commits with no children
+proc seeds {v} {
+ global vdownptr vleftptr varcstart
+
+ set ret {}
+ set a [lindex $vdownptr($v) 0]
+ while {$a != 0} {
+ lappend ret [lindex $varcstart($v) $a]
+ set a [lindex $vleftptr($v) $a]
+ }
+ return $ret
+}
+
proc newvarc {view id} {
global varcid varctok parents children datemode
global vupptr vdownptr vleftptr vbackptr varcrow varcix varcstart
global cmitlisted commitinterest leftover
global commitidx commitdata datemode
global parents children curview hlview
- global vnextroot idpending ordertok
+ global idpending ordertok
global varccommits varcid varctok vtokmod viewfiles
set stuff [read $fd 500000]
}
proc cherrypick {} {
- global rowmenuid curview viewincl
+ global rowmenuid curview
global mainhead mainheadid
set oldhead [exec git rev-parse HEAD]
movedhead $newhead $mainhead
set mainheadid $newhead
}
- # remove oldhead from viewincl and add newhead
- set i [lsearch -exact $viewincl($curview) $oldhead]
- if {$i >= 0} {
- set viewincl($curview) [lreplace $viewincl($curview) $i $i]
- }
- lappend viewincl($curview) $newhead
redrawtags $oldhead
redrawtags $newhead
selbyid $newhead