gitk: Don't compare fake children when comparing commits
This fixes a bug where the compare-commits function would advance to a fake node (one representing local changes, either checked in but not committed, or not checked in) and then get an error when trying to get the patch-id. This fixes it by only considering the real children of each commit. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>maint
parent
4a3da5d91a
commit
aa43561ac0
30
gitk
30
gitk
|
@ -2,7 +2,7 @@
|
||||||
# Tcl ignores the next line -*- tcl -*- \
|
# Tcl ignores the next line -*- tcl -*- \
|
||||||
exec wish "$0" -- "$@"
|
exec wish "$0" -- "$@"
|
||||||
|
|
||||||
# Copyright © 2005-2008 Paul Mackerras. All rights reserved.
|
# Copyright © 2005-2009 Paul Mackerras. All rights reserved.
|
||||||
# This program is free software; it may be used, copied, modified
|
# This program is free software; it may be used, copied, modified
|
||||||
# and distributed under the terms of the GNU General Public Licence,
|
# and distributed under the terms of the GNU General Public Licence,
|
||||||
# either version 2, or (at your option) any later version.
|
# either version 2, or (at your option) any later version.
|
||||||
|
@ -989,6 +989,18 @@ proc removefakerow {id} {
|
||||||
drawvisible
|
drawvisible
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proc real_children {vp} {
|
||||||
|
global children nullid nullid2
|
||||||
|
|
||||||
|
set kids {}
|
||||||
|
foreach id $children($vp) {
|
||||||
|
if {$id ne $nullid && $id ne $nullid2} {
|
||||||
|
lappend kids $id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $kids
|
||||||
|
}
|
||||||
|
|
||||||
proc first_real_child {vp} {
|
proc first_real_child {vp} {
|
||||||
global children nullid nullid2
|
global children nullid nullid2
|
||||||
|
|
||||||
|
@ -8463,23 +8475,23 @@ proc do_cmp_commits {a b} {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if {$skipa} {
|
if {$skipa} {
|
||||||
if {[llength $children($curview,$a)] != 1} {
|
set kids [real_children $curview,$a]
|
||||||
|
if {[llength $kids] != 1} {
|
||||||
$ctext insert end "\n"
|
$ctext insert end "\n"
|
||||||
appendshortlink $a [mc "Commit "] \
|
appendshortlink $a [mc "Commit "] \
|
||||||
[mc " has %s children - stopping\n" \
|
[mc " has %s children - stopping\n" [llength $kids]]
|
||||||
[llength $children($curview,$a)]]
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
set a [lindex $children($curview,$a) 0]
|
set a [lindex $kids 0]
|
||||||
}
|
}
|
||||||
if {$skipb} {
|
if {$skipb} {
|
||||||
if {[llength $children($curview,$b)] != 1} {
|
set kids [real_children $curview,$b]
|
||||||
|
if {[llength $kids] != 1} {
|
||||||
appendshortlink $b [mc "Commit "] \
|
appendshortlink $b [mc "Commit "] \
|
||||||
[mc " has %s children - stopping\n" \
|
[mc " has %s children - stopping\n" [llength $kids]]
|
||||||
[llength $children($curview,$b)]]
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
set b [lindex $children($curview,$b) 0]
|
set b [lindex $kids 0]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$ctext conf -state disabled
|
$ctext conf -state disabled
|
||||||
|
|
Loading…
Reference in New Issue