gitk: Select something appropriate on cherry-pick, branch reset and checkout
This makes gitk select the new commit when cherry-picking, and select the new checked-out head when resetting or checking out a branch. This feels more natural because the user is usually more interested in that commit now than whatever was selected before. Signed-off-by: Paul Mackerras <paulus@samba.org>maint
parent
3e76608d39
commit
46308ea1da
5
gitk
5
gitk
|
@ -3397,7 +3397,7 @@ proc ordertoken {id} {
|
||||||
set id [first_real_child $curview,$p]
|
set id [first_real_child $curview,$p]
|
||||||
if {$id eq {}} {
|
if {$id eq {}} {
|
||||||
# it's a root
|
# it's a root
|
||||||
set tok [lindex $varctok($curview) $a]
|
set tok [lindex $varctok($curview) $varcid($curview,$p)]
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
if {[llength $parents($curview,$id)] == 1} {
|
if {[llength $parents($curview,$id)] == 1} {
|
||||||
|
@ -7028,6 +7028,7 @@ proc cherrypick {} {
|
||||||
}
|
}
|
||||||
redrawtags $oldhead
|
redrawtags $oldhead
|
||||||
redrawtags $newhead
|
redrawtags $newhead
|
||||||
|
selbyid $newhead
|
||||||
}
|
}
|
||||||
notbusy cherrypick
|
notbusy cherrypick
|
||||||
}
|
}
|
||||||
|
@ -7072,6 +7073,7 @@ proc resethead {} {
|
||||||
dohidelocalchanges
|
dohidelocalchanges
|
||||||
filerun $fd [list readresetstat $fd]
|
filerun $fd [list readresetstat $fd]
|
||||||
nowbusy reset [mc "Resetting"]
|
nowbusy reset [mc "Resetting"]
|
||||||
|
selbyid $rowmenuid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7144,6 +7146,7 @@ proc cobranch {} {
|
||||||
redrawtags $headids($oldmainhead)
|
redrawtags $headids($oldmainhead)
|
||||||
}
|
}
|
||||||
redrawtags $headmenuid
|
redrawtags $headmenuid
|
||||||
|
selbyid $headmenuid
|
||||||
}
|
}
|
||||||
if {$showlocalchanges} {
|
if {$showlocalchanges} {
|
||||||
dodiffindex
|
dodiffindex
|
||||||
|
|
Loading…
Reference in New Issue