summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b8a938c)
raw | patch | inline | side by side (parent: b8a938c)
author | Paul Mackerras <paulus@samba.org> | |
Sat, 16 Feb 2008 06:47:31 +0000 (17:47 +1100) | ||
committer | Paul Mackerras <paulus@samba.org> | |
Sat, 16 Feb 2008 11:22:22 +0000 (22:22 +1100) |
This fixes a bug in updating the graph after we have cherry-picked
a commit in gitk and then added some new stuff externally. First,
we weren't updating viewincl with the new head added by the cherry-
pick. Secondly, getcommitlines was doing bad things if it saw a
commit that was already in the graph (was already in an arc). This
fixes both things. If getcommitlines sees a commit that is already
in the graph, it ignores it unless it was not listed before and is
listed now. In that case it doesn't assign it a new arc now, and
doesn't re-add the commit to its arc.
Signed-off-by: Paul Mackerras <paulus@samba.org>
a commit in gitk and then added some new stuff externally. First,
we weren't updating viewincl with the new head added by the cherry-
pick. Secondly, getcommitlines was doing bad things if it saw a
commit that was already in the graph (was already in an arc). This
fixes both things. If getcommitlines sees a commit that is already
in the graph, it ignores it unless it was not listed before and is
listed now. In that case it doesn't assign it a new arc now, and
doesn't re-add the commit to its arc.
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk | patch | blob | history |
index 36199e330517212b0ac2675dcf9509f6a5aa6188..09f431b0357f34ec79b42bd790eac65187576d81 100755 (executable)
--- a/gitk
+++ b/gitk
}
set id [lindex $ids 0]
set vid $view,$id
- if {!$listed && [info exists parents($vid)]} continue
+ set a 0
+ if {[info exists varcid($vid)]} {
+ if {$cmitlisted($vid) || !$listed} continue
+ set a $varcid($vid)
+ }
if {$listed} {
set olds [lrange $ids 1 end]
} else {
set commitdata($id) [string range $cmit [expr {$j + 1}] end]
set cmitlisted($vid) $listed
set parents($vid) $olds
- set a 0
if {![info exists children($vid)]} {
set children($vid) {}
- } elseif {[llength $children($vid)] == 1} {
+ } elseif {$a == 0 && [llength $children($vid)] == 1} {
set k [lindex $children($vid) 0]
if {[llength $parents($view,$k)] == 1 &&
(!$datemode ||
# new arc
set a [newvarc $view $id]
}
- set varcid($vid) $a
if {[string compare [lindex $varctok($view) $a] $vtokmod($view)] < 0} {
modify_arc $view $a
}
- lappend varccommits($view,$a) $id
+ if {![info exists varcid($vid)]} {
+ set varcid($vid) $a
+ lappend varccommits($view,$a) $id
+ incr commitidx($view)
+ }
set i 0
foreach p $olds {
incr i
}
- incr commitidx($view)
if {[info exists commitinterest($id)]} {
foreach script $commitinterest($id) {
lappend scripts [string map [list "%I" $id] $script]
}
proc cherrypick {} {
- global rowmenuid curview
+ global rowmenuid curview viewincl
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