summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a2c2236)
raw | patch | inline | side by side (parent: a2c2236)
author | Paul Mackerras <paulus@samba.org> | |
Mon, 18 Jun 2007 12:39:21 +0000 (22:39 +1000) | ||
committer | Paul Mackerras <paulus@samba.org> | |
Sat, 23 Jun 2007 10:58:09 +0000 (20:58 +1000) |
When we compute descendent heads and descendent/ancestor tags, we
cache the results. We need to be careful to invalidate the cache
when we add stuff to the graph. Also make sure that when we cache
descendent heads for a node we only cache the heads that are actually
descendents of that node.
Signed-off-by: Paul Mackerras <paulus@samba.org>
cache the results. We need to be careful to invalidate the cache
when we add stuff to the graph. Also make sure that when we cache
descendent heads for a node we only cache the heads that are actually
descendents of that node.
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk | patch | blob | history |
index d5b71dd45dd2aa03050074c086d355a87fb76efb..ac73ff6e42a335c07c24897546b1c464b896306d 100755 (executable)
--- a/gitk
+++ b/gitk
# coming from descendents, and "outgoing" means going towards ancestors.
proc getallclines {fd} {
- global allids allparents allchildren idtags nextarc nbmp
+ global allids allparents allchildren idtags idheads nextarc nbmp
global arcnos arcids arctags arcout arcend arcstart archeads growing
global seeds allcommits
}
set arcout($id) $ao
}
+ if {$nid > 0} {
+ global cached_dheads cached_dtags cached_atags
+ catch {unset cached_dheads}
+ catch {unset cached_dtags}
+ catch {unset cached_atags}
+ }
if {![eof $fd]} {
return [expr {$nid >= 1000? 2: 1}]
}
if {![info exists allparents($id)]} {
return {}
}
- set ret {}
+ set aret {}
if {[llength $arcnos($id)] == 1 && [llength $allparents($id)] == 1} {
# part-way along an arc; check it first
set a [lindex $arcnos($id) 0]
foreach t $archeads($a) {
set j [lsearch -exact $arcids($a) $t]
if {$j > $i} break
- lappend $ret $t
+ lappend aret $t
}
}
set id $arcstart($a)
set origid $id
set todo [list $id]
set seen($id) 1
+ set ret {}
for {set i 0} {$i < [llength $todo]} {incr i} {
set id [lindex $todo $i]
if {[info exists cached_dheads($id)]} {
}
set ret [lsort -unique $ret]
set cached_dheads($origid) $ret
+ return [concat $ret $aret]
}
proc addedtag {id} {