Merge git://ozlabs.org/~paulus/gitk

* git://ozlabs.org/~paulus/gitk:
  gitk: Remove boilerplate for configuration variables
  gitk: Show detached HEAD if --all is specified
  gitk: Do not depend on Cygwin's "kill" command on Windows
This commit is contained in:
Junio C Hamano 2014-10-30 10:07:33 -07:00
Родитель 36666ce4da 9fabefb1f3
Коммит 81d645d1a1
1 изменённых файлов: 23 добавлений и 69 удалений

Просмотреть файл

@ -294,6 +294,8 @@ proc parseviewrevs {view revs} {
if {$revs eq {}} { if {$revs eq {}} {
set revs HEAD set revs HEAD
} elseif {[lsearch -exact $revs --all] >= 0} {
lappend revs HEAD
} }
if {[catch {set ids [eval exec git rev-parse $revs]} err]} { if {[catch {set ids [eval exec git rev-parse $revs]} err]} {
# we get stdout followed by stderr in $err # we get stdout followed by stderr in $err
@ -445,7 +447,7 @@ proc stop_instance {inst} {
set pid [pid $fd] set pid [pid $fd]
if {$::tcl_platform(platform) eq {windows}} { if {$::tcl_platform(platform) eq {windows}} {
exec kill -f $pid exec taskkill /pid $pid
} else { } else {
exec kill $pid exec kill $pid
} }
@ -2775,23 +2777,11 @@ proc doprogupdate {} {
} }
proc savestuff {w} { 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 viewname viewfiles viewargs viewargscmd viewperm nextviewnum
global cmitmode wrapcomment datetimeformat limitdiffs global use_ttk
global colors uicolor bgcolor fgcolor diffcolors diffcontext selectbgcolor global stuffsaved
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 config_file config_file_tmp global config_file config_file_tmp
global config_variables
if {$stuffsaved} return if {$stuffsaved} return
if {![winfo viewable .]} return if {![winfo viewable .]} return
@ -2803,59 +2793,10 @@ proc savestuff {w} {
if {$::tcl_platform(platform) eq {windows}} { if {$::tcl_platform(platform) eq {windows}} {
file attributes $config_file_tmp -hidden true file attributes $config_file_tmp -hidden true
} }
puts $f [list set mainfont $mainfont] foreach var_name $config_variables {
puts $f [list set textfont $textfont] upvar #0 $var_name var
puts $f [list set uifont $uifont] puts $f [list set $var_name $var]
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]
puts $f "set geometry(main) [wm geometry .]" puts $f "set geometry(main) [wm geometry .]"
puts $f "set geometry(state) [wm state .]" puts $f "set geometry(state) [wm state .]"
@ -12169,6 +12110,19 @@ catch {
source $config_file 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 parsefont mainfont $mainfont
eval font create mainfont [fontflags mainfont] eval font create mainfont [fontflags mainfont]
eval font create mainfontbold [fontflags mainfont 1] eval font create mainfontbold [fontflags mainfont 1]