diff options
Diffstat (limited to 'gitk-git/gitk')
-rwxr-xr-x | gitk-git/gitk | 104 |
1 files changed, 35 insertions, 69 deletions
diff --git a/gitk-git/gitk b/gitk-git/gitk index c8df35dee5..78358a712a 100755 --- a/gitk-git/gitk +++ b/gitk-git/gitk @@ -294,6 +294,8 @@ proc parseviewrevs {view revs} { if {$revs eq {}} { set revs HEAD + } elseif {[lsearch -exact $revs --all] >= 0} { + lappend revs HEAD } if {[catch {set ids [eval exec git rev-parse $revs]} err]} { # we get stdout followed by stderr in $err @@ -445,7 +447,7 @@ proc stop_instance {inst} { set pid [pid $fd] if {$::tcl_platform(platform) eq {windows}} { - exec kill -f $pid + exec taskkill /pid $pid } else { exec kill $pid } @@ -2594,6 +2596,9 @@ proc makewindow {} { bind $ctext $ctxbut {pop_diff_menu %W %X %Y %x %y} bind $ctext <Button-1> {focus %W} bind $ctext <<Selection>> rehighlight_search_results + for {set i 1} {$i < 10} {incr i} { + bind . <$M1B-Key-$i> [list go_to_parent $i] + } set maincursor [. cget -cursor] set textcursor [$ctext cget -cursor] @@ -2772,23 +2777,11 @@ proc doprogupdate {} { } proc savestuff {w} { - global canv canv2 canv3 mainfont textfont uifont tabstop - global stuffsaved findmergefiles maxgraphpct - global maxwidth showneartags showlocalchanges global viewname viewfiles viewargs viewargscmd viewperm nextviewnum - global cmitmode wrapcomment datetimeformat limitdiffs - global colors uicolor bgcolor fgcolor diffcolors diffcontext selectbgcolor - global uifgcolor uifgdisabledcolor - global headbgcolor headfgcolor headoutlinecolor remotebgcolor - global tagbgcolor tagfgcolor tagoutlinecolor - global reflinecolor filesepbgcolor filesepfgcolor - global mergecolors foundbgcolor currentsearchhitbgcolor - global linehoverbgcolor linehoverfgcolor linehoveroutlinecolor circlecolors - global mainheadcirclecolor workingfilescirclecolor indexcirclecolor - global linkfgcolor circleoutlinecolor - global autoselect autosellen extdifftool perfile_attrs markbgcolor use_ttk - global hideremotes want_ttk maxrefs visiblerefs + global use_ttk + global stuffsaved global config_file config_file_tmp + global config_variables if {$stuffsaved} return if {![winfo viewable .]} return @@ -2800,59 +2793,10 @@ proc savestuff {w} { if {$::tcl_platform(platform) eq {windows}} { file attributes $config_file_tmp -hidden true } - puts $f [list set mainfont $mainfont] - puts $f [list set textfont $textfont] - puts $f [list set uifont $uifont] - puts $f [list set tabstop $tabstop] - puts $f [list set findmergefiles $findmergefiles] - puts $f [list set maxgraphpct $maxgraphpct] - puts $f [list set maxwidth $maxwidth] - puts $f [list set cmitmode $cmitmode] - puts $f [list set wrapcomment $wrapcomment] - puts $f [list set autoselect $autoselect] - puts $f [list set autosellen $autosellen] - puts $f [list set showneartags $showneartags] - puts $f [list set maxrefs $maxrefs] - puts $f [list set visiblerefs $visiblerefs] - puts $f [list set hideremotes $hideremotes] - puts $f [list set showlocalchanges $showlocalchanges] - puts $f [list set datetimeformat $datetimeformat] - puts $f [list set limitdiffs $limitdiffs] - puts $f [list set uicolor $uicolor] - puts $f [list set want_ttk $want_ttk] - puts $f [list set bgcolor $bgcolor] - puts $f [list set fgcolor $fgcolor] - puts $f [list set uifgcolor $uifgcolor] - puts $f [list set uifgdisabledcolor $uifgdisabledcolor] - puts $f [list set colors $colors] - puts $f [list set diffcolors $diffcolors] - puts $f [list set mergecolors $mergecolors] - puts $f [list set markbgcolor $markbgcolor] - puts $f [list set diffcontext $diffcontext] - puts $f [list set selectbgcolor $selectbgcolor] - puts $f [list set foundbgcolor $foundbgcolor] - puts $f [list set currentsearchhitbgcolor $currentsearchhitbgcolor] - puts $f [list set extdifftool $extdifftool] - puts $f [list set perfile_attrs $perfile_attrs] - puts $f [list set headbgcolor $headbgcolor] - puts $f [list set headfgcolor $headfgcolor] - puts $f [list set headoutlinecolor $headoutlinecolor] - puts $f [list set remotebgcolor $remotebgcolor] - puts $f [list set tagbgcolor $tagbgcolor] - puts $f [list set tagfgcolor $tagfgcolor] - puts $f [list set tagoutlinecolor $tagoutlinecolor] - puts $f [list set reflinecolor $reflinecolor] - puts $f [list set filesepbgcolor $filesepbgcolor] - puts $f [list set filesepfgcolor $filesepfgcolor] - puts $f [list set linehoverbgcolor $linehoverbgcolor] - puts $f [list set linehoverfgcolor $linehoverfgcolor] - puts $f [list set linehoveroutlinecolor $linehoveroutlinecolor] - puts $f [list set mainheadcirclecolor $mainheadcirclecolor] - puts $f [list set workingfilescirclecolor $workingfilescirclecolor] - puts $f [list set indexcirclecolor $indexcirclecolor] - puts $f [list set circlecolors $circlecolors] - puts $f [list set linkfgcolor $linkfgcolor] - puts $f [list set circleoutlinecolor $circleoutlinecolor] + foreach var_name $config_variables { + upvar #0 $var_name var + puts $f [list set $var_name $var] + } puts $f "set geometry(main) [wm geometry .]" puts $f "set geometry(state) [wm state .]" @@ -3017,6 +2961,7 @@ proc keys {} { [mc "<Down>, n, j Move down one commit"] [mc "<Left>, z, h Go back in history list"] [mc "<Right>, x, l Go forward in history list"] +[mc "<%s-n> Go to n-th parent of current commit in history list" $M1T] [mc "<PageUp> Move up one page in commit list"] [mc "<PageDown> Move down one page in commit list"] [mc "<%s-Home> Scroll to top of commit list" $M1T] @@ -7497,6 +7442,14 @@ proc goforw {} { } } +proc go_to_parent {i} { + global parents curview targetid + set ps $parents($curview,$targetid) + if {[llength $ps] >= $i} { + selbyid [lindex $ps [expr $i - 1]] + } +} + proc gettree {id} { global treefilelist treeidlist diffids diffmergeid treepending global nullid nullid2 @@ -12157,6 +12110,19 @@ catch { source $config_file } +set config_variables { + mainfont textfont uifont tabstop findmergefiles maxgraphpct maxwidth + cmitmode wrapcomment autoselect autosellen showneartags maxrefs visiblerefs + hideremotes showlocalchanges datetimeformat limitdiffs uicolor want_ttk + bgcolor fgcolor uifgcolor uifgdisabledcolor colors diffcolors mergecolors + markbgcolor diffcontext selectbgcolor foundbgcolor currentsearchhitbgcolor + extdifftool perfile_attrs headbgcolor headfgcolor headoutlinecolor + remotebgcolor tagbgcolor tagfgcolor tagoutlinecolor reflinecolor + filesepbgcolor filesepfgcolor linehoverbgcolor linehoverfgcolor + linehoveroutlinecolor mainheadcirclecolor workingfilescirclecolor + indexcirclecolor circlecolors linkfgcolor circleoutlinecolor +} + parsefont mainfont $mainfont eval font create mainfont [fontflags mainfont] eval font create mainfontbold [fontflags mainfont 1] |