gitk: Factored out some common code into a new start_rev_list procedure
Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
parent
b5c2f30689
commit
38ad0910a0
56
gitk
56
gitk
@ -32,10 +32,29 @@ proc parse_args {rargs} {
|
|||||||
return $parsed_args
|
return $parsed_args
|
||||||
}
|
}
|
||||||
|
|
||||||
proc getcommits {rargs} {
|
proc start_rev_list {rlargs} {
|
||||||
global oldcommits commits commfd phase canv mainfont env
|
|
||||||
global startmsecs nextupdate ncmupdate
|
global startmsecs nextupdate ncmupdate
|
||||||
global ctext maincursor textcursor leftover gitencoding
|
global commfd leftover gitencoding
|
||||||
|
|
||||||
|
set startmsecs [clock clicks -milliseconds]
|
||||||
|
set nextupdate [expr {$startmsecs + 100}]
|
||||||
|
set ncmupdate 1
|
||||||
|
if [catch {
|
||||||
|
set commfd [open [concat | git-rev-list --header --topo-order \
|
||||||
|
--parents $rlargs] r]
|
||||||
|
} err] {
|
||||||
|
puts stderr "Error executing git-rev-list: $err"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
set leftover {}
|
||||||
|
fconfigure $commfd -blocking 0 -translation lf -encoding $gitencoding
|
||||||
|
fileevent $commfd readable [list getcommitlines $commfd]
|
||||||
|
. config -cursor watch
|
||||||
|
settextcursor watch
|
||||||
|
}
|
||||||
|
|
||||||
|
proc getcommits {rargs} {
|
||||||
|
global oldcommits commits phase canv mainfont env
|
||||||
|
|
||||||
# check that we can find a .git directory somewhere...
|
# check that we can find a .git directory somewhere...
|
||||||
set gitdir [gitdir]
|
set gitdir [gitdir]
|
||||||
@ -46,24 +65,10 @@ proc getcommits {rargs} {
|
|||||||
set oldcommits {}
|
set oldcommits {}
|
||||||
set commits {}
|
set commits {}
|
||||||
set phase getcommits
|
set phase getcommits
|
||||||
set startmsecs [clock clicks -milliseconds]
|
start_rev_list [parse_args $rargs]
|
||||||
set nextupdate [expr {$startmsecs + 100}]
|
|
||||||
set ncmupdate 1
|
|
||||||
set parsed_args [parse_args $rargs]
|
|
||||||
if [catch {
|
|
||||||
set commfd [open "|git-rev-list --header --topo-order --parents $parsed_args" r]
|
|
||||||
} err] {
|
|
||||||
puts stderr "Error executing git-rev-list: $err"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
set leftover {}
|
|
||||||
fconfigure $commfd -blocking 0 -translation lf -encoding $gitencoding
|
|
||||||
fileevent $commfd readable [list getcommitlines $commfd]
|
|
||||||
$canv delete all
|
$canv delete all
|
||||||
$canv create text 3 3 -anchor nw -text "Reading commits..." \
|
$canv create text 3 3 -anchor nw -text "Reading commits..." \
|
||||||
-font $mainfont -tags textitems
|
-font $mainfont -tags textitems
|
||||||
. config -cursor watch
|
|
||||||
settextcursor watch
|
|
||||||
}
|
}
|
||||||
|
|
||||||
proc getcommitlines {commfd} {
|
proc getcommitlines {commfd} {
|
||||||
@ -3684,20 +3689,7 @@ proc updatecommits {rargs} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
readrefs
|
readrefs
|
||||||
if [catch {
|
start_rev_list [concat $ignoreold $args]
|
||||||
set commfd [open "|git-rev-list --header --topo-order --parents $ignoreold $args" r]
|
|
||||||
} err] {
|
|
||||||
puts stderr "Error executing git-rev-list: $err"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
set startmsecs [clock clicks -milliseconds]
|
|
||||||
set nextupdate [expr $startmsecs + 100]
|
|
||||||
set ncmupdate 1
|
|
||||||
set leftover {}
|
|
||||||
fconfigure $commfd -blocking 0 -translation lf
|
|
||||||
fileevent $commfd readable [list getcommitlines $commfd]
|
|
||||||
. config -cursor watch
|
|
||||||
settextcursor watch
|
|
||||||
}
|
}
|
||||||
|
|
||||||
proc showtag {tag isnew} {
|
proc showtag {tag isnew} {
|
||||||
|
Loading…
Reference in New Issue
Block a user