Merge git://repo.or.cz/git-gui

* git://repo.or.cz/git-gui: (96 commits)
  git-gui 0.9.0
  git-gui: Bind Meta-T for "Stage To Commit" menu action
  git-gui: Allow users to set font weights to bold
  git-gui: Update Japanese strings (part 2)
  git-gui: Update Japanese strings
  Updated russian translation of git-gui
  po2msg: actually output statistics
  po2msg: ignore untranslated messages
  po2msg: ignore entries marked with "fuzzy"
  git-gui: Protect against bad translation strings
  git-gui: Make sure we get errors from git-update-index
  More updates and corrections to the russian translation of git-gui
  Updated Russian translation.
  git-gui: Update German translation
  git-gui: Add more terms to glossary.
  git-gui: Paper bag fix the global config parsing
  git-gui: Honor a config.mak in git-gui's top level
  git-gui: Collapse $env(HOME) to ~/ in recent repositories on Windows
  git-gui: Support cloning Cygwin based work-dirs
  git-gui: Use proper Windows shortcuts instead of bat files
  ...
pull/288/head
Junio C Hamano 15 years ago
commit d794d9e70e
  1. 5
      git-gui/.gitignore
  2. 2
      git-gui/GIT-VERSION-GEN
  3. 190
      git-gui/Makefile
  4. 723
      git-gui/git-gui.sh
  5. 81
      git-gui/lib/about.tcl
  6. 54
      git-gui/lib/blame.tcl
  7. 16
      git-gui/lib/branch_checkout.tcl
  8. 38
      git-gui/lib/branch_create.tcl
  9. 22
      git-gui/lib/branch_delete.tcl
  10. 22
      git-gui/lib/branch_rename.tcl
  11. 22
      git-gui/lib/browser.tcl
  12. 54
      git-gui/lib/checkout_op.tcl
  13. 1044
      git-gui/lib/choose_repository.tcl
  14. 34
      git-gui/lib/choose_rev.tcl
  15. 56
      git-gui/lib/commit.tcl
  16. 91
      git-gui/lib/console.tcl
  17. 34
      git-gui/lib/database.tcl
  18. 53
      git-gui/lib/date.tcl
  19. 29
      git-gui/lib/diff.tcl
  20. 8
      git-gui/lib/error.tcl
  21. BIN
      git-gui/lib/git-gui.ico
  22. 140
      git-gui/lib/index.tcl
  23. 43
      git-gui/lib/logo.tcl
  24. 60
      git-gui/lib/merge.tcl
  25. 131
      git-gui/lib/option.tcl
  26. 53
      git-gui/lib/remote.tcl
  27. 46
      git-gui/lib/remote_branch_delete.tcl
  28. 57
      git-gui/lib/shortcut.tcl
  29. 38
      git-gui/lib/status_bar.tcl
  30. 48
      git-gui/lib/transport.tcl
  31. 26
      git-gui/lib/win32.tcl
  32. 34
      git-gui/lib/win32_shortcut.js
  33. 22
      git-gui/macosx/AppMain.tcl
  34. 28
      git-gui/macosx/Info.plist
  35. BIN
      git-gui/macosx/git-gui.icns
  36. 2
      git-gui/po/.gitignore
  37. 209
      git-gui/po/README
  38. 1878
      git-gui/po/de.po
  39. 1704
      git-gui/po/git-gui.pot
  40. 9
      git-gui/po/glossary/Makefile
  41. 185
      git-gui/po/glossary/de.po
  42. 164
      git-gui/po/glossary/git-gui-glossary.pot
  43. 37
      git-gui/po/glossary/git-gui-glossary.txt
  44. 180
      git-gui/po/glossary/it.po
  45. 48
      git-gui/po/glossary/txt-to-pot.sh
  46. 170
      git-gui/po/glossary/zh_cn.po
  47. 1895
      git-gui/po/hu.po
  48. 1872
      git-gui/po/it.po
  49. 1843
      git-gui/po/ja.po
  50. 133
      git-gui/po/po2msg.sh
  51. 1893
      git-gui/po/ru.po
  52. 1769
      git-gui/po/zh_cn.po
  53. 16
      git-gui/windows/git-gui.sh

@ -1,5 +1,8 @@
.DS_Store
config.mak
Git Gui.app*
git-gui.tcl
GIT-VERSION-FILE
GIT-GUI-VARS
git-citool
git-gui
lib/tclIndex

@ -1,7 +1,7 @@
#!/bin/sh
GVF=GIT-VERSION-FILE
DEF_VER=0.8.GITGUI
DEF_VER=0.9.GITGUI
LF='
'

@ -2,18 +2,27 @@ all::
# Define V=1 to have a more verbose compile.
#
# Define NO_MSGFMT if you do not have msgfmt from the GNU gettext
# package and want to use our rough pure Tcl po->msg translator.
# TCL_PATH must be vaild for this to work.
#
GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
@$(SHELL_PATH) ./GIT-VERSION-GEN
-include GIT-VERSION-FILE
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')
SCRIPT_SH = git-gui.sh
GITGUI_MAIN := git-gui
GITGUI_BUILT_INS = git-citool
ALL_PROGRAMS = $(GITGUI_BUILT_INS) $(patsubst %.sh,%,$(SCRIPT_SH))
ALL_LIBFILES = $(wildcard lib/*.tcl)
PRELOAD_FILES = lib/class.tcl
NONTCL_LIBFILES = \
lib/git-gui.ico \
$(wildcard lib/win32_*.js) \
#end NONTCL_LIBFILES
ifndef SHELL_PATH
SHELL_PATH = /bin/sh
@ -31,7 +40,7 @@ ifndef INSTALL
INSTALL = install
endif
RM_F ?= rm -f
RM_RF ?= rm -rf
RMDIR ?= rmdir
INSTALL_D0 = $(INSTALL) -d -m755 # space is required here
@ -40,6 +49,8 @@ INSTALL_R0 = $(INSTALL) -m644 # space is required here
INSTALL_R1 =
INSTALL_X0 = $(INSTALL) -m755 # space is required here
INSTALL_X1 =
INSTALL_A0 = find # space is required here
INSTALL_A1 = | cpio -pud
INSTALL_L0 = rm -f # space is required here
INSTALL_L1 = && ln # space is required here
INSTALL_L2 =
@ -47,15 +58,16 @@ INSTALL_L3 =
REMOVE_D0 = $(RMDIR) # space is required here
REMOVE_D1 = || true
REMOVE_F0 = $(RM_F) # space is required here
REMOVE_F0 = $(RM_RF) # space is required here
REMOVE_F1 =
CLEAN_DST = true
ifndef V
QUIET = @
QUIET_GEN = $(QUIET)echo ' ' GEN $@ &&
QUIET_BUILT_IN = $(QUIET)echo ' ' BUILTIN $@ &&
QUIET_GEN = $(QUIET)echo ' ' GEN '$@' &&
QUIET_INDEX = $(QUIET)echo ' ' INDEX $(dir $@) &&
QUIET_MSGFMT0 = $(QUIET)printf ' MSGFMT %12s ' $@ && v=`
QUIET_MSGFMT1 = 2>&1` && echo "$$v" | sed -e 's/fuzzy translations/fuzzy/' | sed -e 's/ messages//g'
QUIET_2DEVNULL = 2>/dev/null
INSTALL_D0 = dir=
@ -64,6 +76,8 @@ ifndef V
INSTALL_R1 = && echo ' ' INSTALL 644 `basename $$src` && $(INSTALL) -m644 $$src
INSTALL_X0 = src=
INSTALL_X1 = && echo ' ' INSTALL 755 `basename $$src` && $(INSTALL) -m755 $$src
INSTALL_A0 = src=
INSTALL_A1 = && echo ' ' INSTALL ' ' `basename "$$src"` && find "$$src" | cpio -pud
INSTALL_L0 = dst=
INSTALL_L1 = && src=
@ -74,51 +88,133 @@ ifndef V
REMOVE_D0 = dir=
REMOVE_D1 = && echo ' ' REMOVE $$dir && test -d "$$dir" && $(RMDIR) "$$dir" || true
REMOVE_F0 = dst=
REMOVE_F1 = && echo ' ' REMOVE `basename "$$dst"` && $(RM_F) "$$dst"
REMOVE_F1 = && echo ' ' REMOVE `basename "$$dst"` && $(RM_RF) "$$dst"
endif
TCL_PATH ?= tclsh
TCLTK_PATH ?= wish
TKFRAMEWORK = /Library/Frameworks/Tk.framework/Resources/Wish.app
ifeq ($(findstring $(MAKEFLAGS),s),s)
QUIET_GEN =
QUIET_BUILT_IN =
endif
-include config.mak
DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
TCL_PATH_SQ = $(subst ','\'',$(TCL_PATH))
TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
TCLTK_PATH_SED = $(subst ','\'',$(subst \,\\,$(TCLTK_PATH)))
gg_libdir ?= $(sharedir)/git-gui/lib
libdir_SQ = $(subst ','\'',$(gg_libdir))
libdir_SED = $(subst ','\'',$(subst \,\\,$(gg_libdir)))
exedir = $(dir $(gitexecdir))share/git-gui/lib
GITGUI_SCRIPT := $$0
GITGUI_RELATIVE :=
GITGUI_MACOSXAPP :=
ifeq ($(exedir),$(gg_libdir))
GITGUI_RELATIVE := 1
endif
ifeq ($(uname_O),Cygwin)
GITGUI_SCRIPT := `cygpath --windows --absolute "$(GITGUI_SCRIPT)"`
ifeq ($(GITGUI_RELATIVE),)
gg_libdir := $(shell cygpath --windows --absolute "$(gg_libdir)")
endif
endif
ifeq ($(uname_S),Darwin)
ifeq ($(shell test -d $(TKFRAMEWORK) && echo y),y)
GITGUI_MACOSXAPP := YesPlease
endif
endif
ifneq (,$(findstring MINGW,$(uname_S)))
NO_MSGFMT=1
GITGUI_WINDOWS_WRAPPER := YesPlease
endif
ifdef GITGUI_MACOSXAPP
GITGUI_MAIN := git-gui.tcl
git-gui: GIT-VERSION-FILE GIT-GUI-VARS
$(QUIET_GEN)rm -f $@ $@+ && \
echo '#!$(SHELL_PATH_SQ)' >$@+ && \
echo 'if test "z$$*" = zversion ||' >>$@+ && \
echo ' test "z$$*" = z--version' >>$@+ && \
echo then >>$@+ && \
echo ' 'echo \'git-gui version '$(GITGUI_VERSION)'\' >>$@+ && \
echo else >>$@+ && \
echo ' 'exec \''$(libdir_SQ)/Git Gui.app/Contents/MacOS/Wish'\' \
'"$$0" "$$@"' >>$@+ && \
echo fi >>$@+ && \
chmod +x $@+ && \
mv $@+ $@
Git\ Gui.app: GIT-VERSION-FILE GIT-GUI-VARS \
macosx/Info.plist \
macosx/git-gui.icns \
macosx/AppMain.tcl \
$(TKFRAMEWORK)/Contents/MacOS/Wish
$(QUIET_GEN)rm -rf '$@' '$@'+ && \
mkdir -p '$@'+/Contents/MacOS && \
mkdir -p '$@'+/Contents/Resources/Scripts && \
cp '$(subst ','\'',$(TKFRAMEWORK))/Contents/MacOS/Wish' \
'$@'+/Contents/MacOS && \
cp macosx/git-gui.icns '$@'+/Contents/Resources && \
sed -e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \
macosx/Info.plist \
>'$@'+/Contents/Info.plist && \
sed -e 's|@@gitexecdir@@|$(gitexecdir_SQ)|' \
-e 's|@@GITGUI_LIBDIR@@|$(libdir_SED)|' \
macosx/AppMain.tcl \
>'$@'+/Contents/Resources/Scripts/AppMain.tcl && \
mv '$@'+ '$@'
endif
ifdef GITGUI_WINDOWS_WRAPPER
GITGUI_MAIN := git-gui.tcl
exedir = $(dir $(gitexecdir))share/git-gui/lib
exedir_SQ = $(subst ','\'',$(exedir))
git-gui: windows/git-gui.sh
cp $< $@
endif
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
$(GITGUI_MAIN): git-gui.sh GIT-VERSION-FILE GIT-GUI-VARS
$(QUIET_GEN)rm -f $@ $@+ && \
GITGUI_RELATIVE= && \
if test '$(exedir_SQ)' = '$(libdir_SQ)'; then \
if test "$(uname_O)" = Cygwin; \
then GITGUI_RELATIVE= ; \
else GITGUI_RELATIVE=1; \
fi; \
fi && \
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
-e 's|^ exec wish "$$0"| exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' \
-e '1,30s|^ argv0=$$0| argv0=$(GITGUI_SCRIPT)|' \
-e '1,30s|^ exec wish | exec '\''$(TCLTK_PATH_SED)'\'' |' \
-e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \
-e 's|@@GITGUI_RELATIVE@@|'$$GITGUI_RELATIVE'|' \
-e $$GITGUI_RELATIVE's|@@GITGUI_LIBDIR@@|$(libdir_SQ)|' \
$@.sh >$@+ && \
-e 's|@@GITGUI_RELATIVE@@|$(GITGUI_RELATIVE)|' \
-e '$(GITGUI_RELATIVE)s|@@GITGUI_LIBDIR@@|$(libdir_SED)|' \
git-gui.sh >$@+ && \
chmod +x $@+ && \
mv $@+ $@
$(GITGUI_BUILT_INS): git-gui
$(QUIET_BUILT_IN)rm -f $@ && ln git-gui $@
XGETTEXT ?= xgettext
ifdef NO_MSGFMT
MSGFMT ?= $(TCL_PATH) po/po2msg.sh
else
MSGFMT ?= msgfmt
endif
msgsdir = $(gg_libdir)/msgs
msgsdir_SQ = $(subst ','\'',$(msgsdir))
PO_TEMPLATE = po/git-gui.pot
ALL_POFILES = $(wildcard po/*.po)
ALL_MSGFILES = $(subst .po,.msg,$(ALL_POFILES))
$(PO_TEMPLATE): $(SCRIPT_SH) $(ALL_LIBFILES)
$(XGETTEXT) -kmc -LTcl -o $@ $(SCRIPT_SH) $(ALL_LIBFILES)
update-po:: $(PO_TEMPLATE)
$(foreach p, $(ALL_POFILES), echo Updating $p ; msgmerge -U $p $(PO_TEMPLATE) ; )
$(ALL_MSGFILES): %.msg : %.po
$(QUIET_MSGFMT0)$(MSGFMT) --statistics --tcl $< -l $(basename $(notdir $<)) -d $(dir $@) $(QUIET_MSGFMT1)
lib/tclIndex: $(ALL_LIBFILES)
lib/tclIndex: $(ALL_LIBFILES) GIT-GUI-VARS
$(QUIET_INDEX)if echo \
$(foreach p,$(PRELOAD_FILES),source $p\;) \
auto_mkindex lib '*.tcl' \
@ -132,16 +228,13 @@ lib/tclIndex: $(ALL_LIBFILES)
echo >>$@ ; \
fi
# These can record GITGUI_VERSION
$(patsubst %.sh,%,$(SCRIPT_SH)): GIT-VERSION-FILE GIT-GUI-VARS
lib/tclIndex: GIT-GUI-VARS
TRACK_VARS = \
$(subst ','\'',SHELL_PATH='$(SHELL_PATH_SQ)') \
$(subst ','\'',TCL_PATH='$(TCL_PATH_SQ)') \
$(subst ','\'',TCLTK_PATH='$(TCLTK_PATH_SQ)') \
$(subst ','\'',gitexecdir='$(gitexecdir_SQ)') \
$(subst ','\'',gg_libdir='$(libdir_SQ)') \
GITGUI_MACOSXAPP=$(GITGUI_MACOSXAPP) \
#end TRACK_VARS
GIT-GUI-VARS: .FORCE-GIT-GUI-VARS
@ -151,24 +244,49 @@ GIT-GUI-VARS: .FORCE-GIT-GUI-VARS
echo 1>$@ "$$VARS"; \
fi
all:: $(ALL_PROGRAMS) lib/tclIndex
ifdef GITGUI_MACOSXAPP
all:: git-gui Git\ Gui.app
endif
ifdef GITGUI_WINDOWS_WRAPPER
all:: git-gui
endif
all:: $(GITGUI_MAIN) lib/tclIndex $(ALL_MSGFILES)
install: all
$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(gitexecdir_SQ)' $(INSTALL_D1)
$(QUIET)$(INSTALL_X0)git-gui $(INSTALL_X1) '$(DESTDIR_SQ)$(gitexecdir_SQ)'
$(QUIET)$(foreach p,$(GITGUI_BUILT_INS), $(INSTALL_L0)'$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' $(INSTALL_L1)'$(DESTDIR_SQ)$(gitexecdir_SQ)/git-gui' $(INSTALL_L2)'$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' $(INSTALL_L3) &&) true
ifdef GITGUI_WINDOWS_WRAPPER
$(QUIET)$(INSTALL_R0)git-gui.tcl $(INSTALL_R1) '$(DESTDIR_SQ)$(gitexecdir_SQ)'
endif
$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(libdir_SQ)' $(INSTALL_D1)
$(QUIET)$(INSTALL_R0)lib/tclIndex $(INSTALL_R1) '$(DESTDIR_SQ)$(libdir_SQ)'
$(QUIET)$(foreach p,$(ALL_LIBFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(libdir_SQ)' &&) true
ifdef GITGUI_MACOSXAPP
$(QUIET)$(INSTALL_A0)'Git Gui.app' $(INSTALL_A1) '$(DESTDIR_SQ)$(libdir_SQ)'
$(QUIET)$(INSTALL_X0)git-gui.tcl $(INSTALL_X1) '$(DESTDIR_SQ)$(libdir_SQ)'
endif
$(QUIET)$(foreach p,$(ALL_LIBFILES) $(NONTCL_LIBFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(libdir_SQ)' &&) true
$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(msgsdir_SQ)' $(INSTALL_D1)
$(QUIET)$(foreach p,$(ALL_MSGFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(msgsdir_SQ)' &&) true
uninstall:
$(QUIET)$(CLEAN_DST) '$(DESTDIR_SQ)$(gitexecdir_SQ)'
$(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/git-gui $(REMOVE_F1)
$(QUIET)$(foreach p,$(GITGUI_BUILT_INS), $(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/$p $(REMOVE_F1) &&) true
ifdef GITGUI_WINDOWS_WRAPPER
$(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/git-gui.tcl $(REMOVE_F1)
endif
$(QUIET)$(CLEAN_DST) '$(DESTDIR_SQ)$(libdir_SQ)'
$(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(libdir_SQ)'/tclIndex $(REMOVE_F1)
$(QUIET)$(foreach p,$(ALL_LIBFILES), $(REMOVE_F0)'$(DESTDIR_SQ)$(libdir_SQ)'/$(notdir $p) $(REMOVE_F1) &&) true
ifdef GITGUI_MACOSXAPP
$(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(libdir_SQ)/Git Gui.app' $(REMOVE_F1)
$(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(libdir_SQ)'/git-gui.tcl $(REMOVE_F1)
endif
$(QUIET)$(foreach p,$(ALL_LIBFILES) $(NONTCL_LIBFILES), $(REMOVE_F0)'$(DESTDIR_SQ)$(libdir_SQ)'/$(notdir $p) $(REMOVE_F1) &&) true
$(QUIET)$(CLEAN_DST) '$(DESTDIR_SQ)$(msgsdir_SQ)'
$(QUIET)$(foreach p,$(ALL_MSGFILES), $(REMOVE_F0)'$(DESTDIR_SQ)$(msgsdir_SQ)'/$(notdir $p) $(REMOVE_F1) &&) true
$(QUIET)$(REMOVE_D0)'$(DESTDIR_SQ)$(gitexecdir_SQ)' $(REMOVE_D1)
$(QUIET)$(REMOVE_D0)'$(DESTDIR_SQ)$(msgsdir_SQ)' $(REMOVE_D1)
$(QUIET)$(REMOVE_D0)'$(DESTDIR_SQ)$(libdir_SQ)' $(REMOVE_D1)
$(QUIET)$(REMOVE_D0)`dirname '$(DESTDIR_SQ)$(libdir_SQ)'` $(REMOVE_D1)
@ -177,8 +295,14 @@ dist-version:
@echo $(GITGUI_VERSION) > $(TARDIR)/version
clean::
rm -f $(ALL_PROGRAMS) lib/tclIndex
rm -f GIT-VERSION-FILE GIT-GUI-VARS
$(RM_RF) $(GITGUI_MAIN) lib/tclIndex po/*.msg
$(RM_RF) GIT-VERSION-FILE GIT-GUI-VARS
ifdef GITGUI_MACOSXAPP
$(RM_RF) 'Git Gui.app'* git-gui
endif
ifdef GITGUI_WINDOWS_WRAPPER
$(RM_RF) git-gui
endif
.PHONY: all install uninstall dist-version clean
.PHONY: .FORCE-GIT-VERSION-FILE

@ -6,11 +6,12 @@
echo 'git-gui version @@GITGUI_VERSION@@'; \
exit; \
fi; \
exec wish "$0" -- "$@"
argv0=$0; \
exec wish "$argv0" -- "$@"
set appvers {@@GITGUI_VERSION@@}
set copyright {
Copyright © 2006, 2007 Shawn Pearce, et. al.
set copyright [encoding convertfrom utf-8 {
Copyright © 2006, 2007 Shawn Pearce, et. al.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -24,7 +25,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA}
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA}]
######################################################################
##
@ -37,13 +38,31 @@ if {[catch {package require Tcl 8.4} err]
tk_messageBox \
-icon error \
-type ok \
-title "git-gui: fatal error" \
-title [mc "git-gui: fatal error"] \
-message $err
exit 1
}
catch {rename send {}} ; # What an evil concept...
######################################################################
##
## locate our library
set oguilib {@@GITGUI_LIBDIR@@}
set oguirel {@@GITGUI_RELATIVE@@}
if {$oguirel eq {1}} {
set oguilib [file dirname [file dirname [file normalize $argv0]]]
set oguilib [file join $oguilib share git-gui lib]
set oguimsg [file join $oguilib msgs]
} elseif {[string match @@* $oguirel]} {
set oguilib [file join [file dirname [file normalize $argv0]] lib]
set oguimsg [file join [file dirname [file normalize $argv0]] po]
} else {
set oguimsg [file join $oguilib msgs]
}
unset oguirel
######################################################################
##
## enable verbose loading?
@ -64,21 +83,39 @@ if {![catch {set _verbose $env(GITGUI_VERBOSE)}]} {
######################################################################
##
## Fake internationalization to ease backporting of changes.
## Internationalization (i18n) through msgcat and gettext. See
## http://www.gnu.org/software/gettext/manual/html_node/Tcl.html
package require msgcat
proc mc {fmt args} {
proc _mc_trim {fmt} {
set cmk [string first @@ $fmt]
if {$cmk > 0} {
set fmt [string range $fmt 0 [expr {$cmk - 1}]]
return [string range $fmt 0 [expr {$cmk - 1}]]
}
return [eval [list format $fmt] $args]
return $fmt
}
proc mc {en_fmt args} {
set fmt [_mc_trim [::msgcat::mc $en_fmt]]
if {[catch {set msg [eval [list format $fmt] $args]} err]} {
set msg [eval [list format [_mc_trim $en_fmt]] $args]
}
return $msg
}
proc strcat {args} {
return [join $args {}]
}
::msgcat::mcload $oguimsg
unset oguimsg
######################################################################
##
## read only globals
set _appname [lindex [file split $argv0] end]
set _appname {Git Gui}
set _gitdir {}
set _gitexec {}
set _reponame {}
@ -175,6 +212,7 @@ proc disable_option {option} {
proc is_many_config {name} {
switch -glob -- $name {
gui.recentrepo -
remote.*.fetch -
remote.*.push
{return 1}
@ -203,51 +241,6 @@ proc get_config {name} {
}
}
proc load_config {include_global} {
global repo_config global_config default_config
array unset global_config
if {$include_global} {
catch {
set fd_rc [git_read config --global --list]
while {[gets $fd_rc line] >= 0} {
if {[regexp {^([^=]+)=(.*)$} $line line name value]} {
if {[is_many_config $name]} {
lappend global_config($name) $value
} else {
set global_config($name) $value
}
}
}
close $fd_rc
}
}
array unset repo_config
catch {
set fd_rc [git_read config --list]
while {[gets $fd_rc line] >= 0} {
if {[regexp {^([^=]+)=(.*)$} $line line name value]} {
if {[is_many_config $name]} {
lappend repo_config($name) $value
} else {
set repo_config($name) $value
}
}
}
close $fd_rc
}
foreach name [array names default_config] {
if {[catch {set v $global_config($name)}]} {
set global_config($name) $default_config($name)
}
if {[catch {set v $repo_config($name)}]} {
set repo_config($name) $default_config($name)
}
}
}
######################################################################
##
## handy utils
@ -313,6 +306,9 @@ proc _which {what} {
$env(PATH)] {;}]
set _search_exe .exe
} elseif {[is_Windows]} {
set gitguidir [file dirname [info script]]
regsub -all ";" $gitguidir "\\;" gitguidir
set env(PATH) "$gitguidir;$env(PATH)"
set _search_path [split $env(PATH) {;}]
set _search_exe .exe
} else {
@ -491,6 +487,110 @@ proc rmsel_tag {text} {
return $text
}
set root_exists 0
bind . <Visibility> {
bind . <Visibility> {}
set root_exists 1
}
if {[is_Windows]} {
wm iconbitmap . -default $oguilib/git-gui.ico
}
######################################################################
##
## config defaults
set cursor_ptr arrow
font create font_diff -family Courier -size 10
font create font_ui
catch {
label .dummy
eval font configure font_ui [font actual [.dummy cget -font]]
destroy .dummy
}
font create font_uiitalic
font create font_uibold
font create font_diffbold
font create font_diffitalic
foreach class {Button Checkbutton Entry Label
Labelframe Listbox Menu Message
Radiobutton Spinbox Text} {
option add *$class.font font_ui
}
unset class
if {[is_Windows] || [is_MacOSX]} {
option add *Menu.tearOff 0
}
if {[is_MacOSX]} {
set M1B M1
set M1T Cmd
} else {
set M1B Control
set M1T Ctrl
}
proc bind_button3 {w cmd} {
bind $w <Any-Button-3> $cmd
if {[is_MacOSX]} {
# Mac OS X sends Button-2 on right click through three-button mouse,
# or through trackpad right-clicking (two-finger touch + click).
bind $w <Any-Button-2> $cmd
bind $w <Control-Button-1> $cmd
}
}
proc apply_config {} {
global repo_config font_descs
foreach option $font_descs {
set name [lindex $option 0]
set font [lindex $option 1]
if {[catch {
set need_weight 1
foreach {cn cv} $repo_config(gui.$name) {
if {$cn eq {-weight}} {
set need_weight 0
}
font configure $font $cn $cv
}
if {$need_weight} {
font configure $font -weight normal
}
} err]} {
error_popup [strcat [mc "Invalid font specified in %s:" "gui.$name"] "\n\n$err"]
}
foreach {cn cv} [font configure $font] {
font configure ${font}bold $cn $cv
font configure ${font}italic $cn $cv
}
font configure ${font}bold -weight bold
font configure ${font}italic -slant italic
}
}
set default_config(merge.diffstat) true
set default_config(merge.summary) false
set default_config(merge.verbosity) 2
set default_config(user.name) {}
set default_config(user.email) {}
set default_config(gui.matchtrackingbranch) false
set default_config(gui.pruneduringfetch) false
set default_config(gui.trustmtime) false
set default_config(gui.diffcontext) 5
set default_config(gui.newbranchtemplate) {}
set default_config(gui.fontui) [font configure font_ui]
set default_config(gui.fontdiff) [font configure font_diff]
set font_descs {
{fontui font_ui {mc "Main Font"}}
{fontdiff font_diff {mc "Diff/Console Font"}}
}
######################################################################
##
## find git
@ -515,7 +615,7 @@ if {[catch {set _git_version [git --version]} err]} {
tk_messageBox \
-icon error \
-type ok \
-title "git-gui: fatal error" \
-title [mc "git-gui: fatal error"] \
-message "Cannot determine Git version:
$err
@ -528,8 +628,8 @@ if {![regsub {^git version } $_git_version {} _git_version]} {
tk_messageBox \
-icon error \
-type ok \
-title "git-gui: fatal error" \
-message "Cannot parse Git version string:\n\n$_git_version"
-title [mc "git-gui: fatal error"] \
-message [strcat [mc "Cannot parse Git version string:"] "\n\n$_git_version"]
exit 1
}
@ -547,14 +647,14 @@ if {![regexp {^[1-9]+(\.[0-9]+)+$} $_git_version]} {
-type yesno \
-default no \
-title "[appname]: warning" \
-message "Git version cannot be determined.
-message [mc "Git version cannot be determined.
$_git claims it is version '$_real_git_version'.
%s claims it is version '%s'.
[appname] requires at least Git 1.5.0 or later.
%s requires at least Git 1.5.0 or later.
Assume '$_real_git_version' is version 1.5.0?
"] eq {yes}} {
Assume '%s' is version 1.5.0?
" $_git $_real_git_version [appname] $_real_git_version]] eq {yes}} {
set _git_version 1.5.0
} else {
exit 1
@ -611,7 +711,7 @@ if {[git-version < 1.5]} {
tk_messageBox \
-icon error \
-type ok \
-title "git-gui: fatal error" \
-title [mc "git-gui: fatal error"] \
-message "[appname] requires Git 1.5.0 or later.
You are using [git-version]:
@ -624,22 +724,13 @@ You are using [git-version]:
##
## configure our library
set oguilib {@@GITGUI_LIBDIR@@}
set oguirel {@@GITGUI_RELATIVE@@}
if {$oguirel eq {1}} {
set oguilib [file dirname [file dirname [file normalize $argv0]]]
set oguilib [file join $oguilib share git-gui lib]
} elseif {[string match @@* $oguirel]} {
set oguilib [file join [file dirname [file normalize $argv0]] lib]
}
set idx [file join $oguilib tclIndex]
if {[catch {set fd [open $idx r]} err]} {
catch {wm withdraw .}
tk_messageBox \
-icon error \
-type ok \
-title "git-gui: fatal error" \
-title [mc "git-gui: fatal error"] \
-message $err
exit 1
}
@ -666,13 +757,78 @@ if {$idx ne {}} {
} else {
set auto_path [concat [list $oguilib] $auto_path]
}
unset -nocomplain oguirel idx fd
unset -nocomplain idx fd
######################################################################
##
## config file parsing
git-version proc _parse_config {arr_name args} {
>= 1.5.3 {
upvar $arr_name arr
array unset arr
set buf {}
catch {
set fd_rc [eval \
[list git_read config] \
$args \
[list --null --list]]
fconfigure $fd_rc -translation binary
set buf [read $fd_rc]
close $fd_rc
}
foreach line [split $buf "\0"] {
if {[regexp {^([^\n]+)\n(.*)$} $line line name value]} {
if {[is_many_config $name]} {
lappend arr($name) $value
} else {
set arr($name) $value
}
}
}
}
default {
upvar $arr_name arr
array unset arr
catch {
set fd_rc [eval [list git_read config --list] $args]
while {[gets $fd_rc line] >= 0} {
if {[regexp {^([^=]+)=(.*)$} $line line name value]} {
if {[is_many_config $name]} {
lappend arr($name) $value
} else {
set arr($name) $value
}
}
}
close $fd_rc
}
}
}
proc load_config {include_global} {
global repo_config global_config default_config
if {$include_global} {
_parse_config global_config --global
}
_parse_config repo_config
foreach name [array names default_config] {
if {[catch {set v $global_config($name)}]} {
set global_config($name) $default_config($name)
}
if {[catch {set v $repo_config($name)}]} {
set repo_config($name) $default_config($name)
}
}
}
######################################################################
##
## feature option selection
if {[regexp {^git-(.+)$} [appname] _junk subcommand]} {
if {[regexp {^git-(.+)$} [file tail $argv0] _junk subcommand]} {
unset _junk
} else {
set subcommand gui
@ -720,35 +876,35 @@ if {[catch {
set _gitdir [git rev-parse --git-dir]
set _prefix [git rev-parse --show-prefix]
} err]} {
catch {wm withdraw .}
error_popup "Cannot find the git directory:\n\n$err"
exit 1
load_config 1
apply_config
choose_repository::pick
}
if {![file isdirectory $_gitdir] && [is_Cygwin]} {
catch {set _gitdir [exec cygpath --unix $_gitdir]}
catch {set _gitdir [exec cygpath --windows $_gitdir]}
}
if {![file isdirectory $_gitdir]} {
catch {wm withdraw .}
error_popup "Git directory not found:\n\n$_gitdir"
error_popup [strcat [mc "Git directory not found:"] "\n\n$_gitdir"]
exit 1
}
if {$_prefix ne {}} {
regsub -all {[^/]+/} $_prefix ../ cdup
if {[catch {cd $cdup} err]} {
catch {wm withdraw .}
error_popup "Cannot move to top of working directory:\n\n$err"
error_popup [strcat [mc "Cannot move to top of working directory:"] "\n\n$err"]
exit 1
}
unset cdup
} elseif {![is_enabled bare]} {
if {[lindex [file split $_gitdir] end] ne {.git}} {
catch {wm withdraw .}
error_popup "Cannot use funny .git directory:\n\n$_gitdir"
error_popup [strcat [mc "Cannot use funny .git directory:"] "\n\n$_gitdir"]
exit 1
}
if {[catch {cd [file dirname $_gitdir]} err]} {
catch {wm withdraw .}
error_popup "No working directory [file dirname $_gitdir]:\n\n$err"
error_popup [strcat [mc "No working directory"] " [file dirname $_gitdir]:\n\n$err"]
exit 1
}
}
@ -895,7 +1051,7 @@ proc rescan {after {honor_trustmtime 1}} {
rescan_stage2 {} $after
} else {
set rescan_active 1
ui_status {Refreshing file status...}
ui_status [mc "Refreshing file status..."]
set fd_rf [git_read update-index \
-q \
--unmerged \
@ -960,7 +1116,7 @@ proc rescan_stage2 {fd after} {
set buf_rlo {}
set rescan_active 3
ui_status {Scanning for modified files ...}
ui_status [mc "Scanning for modified files ..."]
set fd_di [git_read diff-index --cached -z [PARENT]]
set fd_df [git_read diff-files -z]
set fd_lo [eval git_read ls-files --others -z $ls_others]
@ -1401,31 +1557,32 @@ set all_icons(O$ui_workdir) file_plain
set max_status_desc 0
foreach i {
{__ "Unmodified"}
{_M "Modified, not staged"}
{M_ "Staged for commit"}
{MM "Portions staged for commit"}
{MD "Staged for commit, missing"}
{_O "Untracked, not staged"}
{A_ "Staged for commit"}
{AM "Portions staged for commit"}
{AD "Staged for commit, missing"}
{_D "Missing"}
{D_ "Staged for removal"}
{DO "Staged for removal, still present"}
{U_ "Requires merge resolution"}
{UU "Requires merge resolution"}
{UM "Requires merge resolution"}
{UD "Requires merge resolution"}
{__ {mc "Unmodified"}}
{_M {mc "Modified, not staged"}}
{M_ {mc "Staged for commit"}}
{MM {mc "Portions staged for commit"}}
{MD {mc "Staged for commit, missing"}}
{_O {mc "Untracked, not staged"}}
{A_ {mc "Staged for commit"}}
{AM {mc "Portions staged for commit"}}
{AD {mc "Staged for commit, missing"}}
{_D {mc "Missing"}}
{D_ {mc "Staged for removal"}}
{DO {mc "Staged for removal, still present"}}
{U_ {mc "Requires merge resolution"}}
{UU {mc "Requires merge resolution"}}
{UM {mc "Requires merge resolution"}}
{UD {mc "Requires merge resolution"}}
} {
if {$max_status_desc < [string length [lindex $i 1]]} {
set max_status_desc [string length [lindex $i 1]]
set text [eval [lindex $i 1]]
if {$max_status_desc < [string length $text]} {
set max_status_desc [string length $text]
}
set all_descs([lindex $i 0]) [lindex $i 1]
set all_descs([lindex $i 0]) $text
}
unset i
@ -1433,16 +1590,6 @@ unset i
##
## util
proc bind_button3 {w cmd} {
bind $w <Any-Button-3> $cmd
if {[is_MacOSX]} {
# Mac OS X sends Button-2 on right click through three-button mouse,
# or through trackpad right-clicking (two-finger touch + click).
bind $w <Any-Button-2> $cmd
bind $w <Control-Button-1> $cmd
}
}
proc scrollbar2many {list mode args} {
foreach w $list {eval $w $mode $args}
}
@ -1464,7 +1611,7 @@ proc incr_font_size {font {amt 1}} {
##
## ui commands
set starting_gitk_msg {Starting gitk... please wait...}
set starting_gitk_msg [mc "Starting gitk... please wait..."]
proc do_gitk {revs} {
# -- Always start gitk through whatever we were loaded with. This
@ -1473,7 +1620,7 @@ proc do_gitk {revs} {
set exe [file join [file dirname $::_git] gitk]
set cmd [list [info nameofexecutable] $exe]
if {! [file exists $exe]} {
error_popup "Unable to start gitk:\n\n$exe does not exist"
error_popup [mc "Unable to start gitk:\n\n%s does not exist" $exe]
} else {
global env
@ -1546,8 +1693,8 @@ proc do_quit {} {
#
set cfg_geometry [list]
lappend cfg_geometry [wm geometry .]
lappend cfg_geometry [lindex [.vpane sash coord 0] 1]
lappend cfg_geometry [lindex [.vpane.files sash coord 0] 0]
lappend cfg_geometry [lindex [.vpane sash coord 0] 0]
lappend cfg_geometry [lindex [.vpane.files sash coord 0] 1]
if {[catch {set rc_geometry $repo_config(gui.geometry)}]} {
set rc_geometry {}
}
@ -1664,104 +1811,26 @@ proc add_range_to_selection {w x y} {
######################################################################
##
## config defaults
set cursor_ptr arrow
font create font_diff -family Courier -size 10
font create font_ui
catch {
label .dummy
eval font configure font_ui [font actual [.dummy cget -font]]
destroy .dummy
}
font create font_uiitalic
font create font_uibold
font create font_diffbold
font create font_diffitalic
foreach class {Button Checkbutton Entry Label
Labelframe Listbox Menu Message
Radiobutton Spinbox Text} {
option add *$class.font font_ui
}
unset class
if {[is_Windows] || [is_MacOSX]} {
option add *Menu.tearOff 0
}
if {[is_MacOSX]} {
set M1B M1
set M1T Cmd
} else {
set M1B Control
set M1T Ctrl
}
proc apply_config {} {
global repo_config font_descs
foreach option $font_descs {
set name [lindex $option 0]
set font [lindex $option 1]
if {[catch {
foreach {cn cv} $repo_config(gui.$name) {
font configure $font $cn $cv -weight normal
}
} err]} {
error_popup "Invalid font specified in gui.$name:\n\n$err"
}
foreach {cn cv} [font configure $font] {
font configure ${font}bold $cn $cv
font configure ${font}italic $cn $cv
}
font configure ${font}bold -weight bold
font configure ${font}italic -slant italic
}
}
set default_config(merge.diffstat) true
set default_config(merge.summary) false
set default_config(merge.verbosity) 2
set default_config(user.name) {}
set default_config(user.email) {}
## ui construction
set default_config(gui.matchtrackingbranch) false
set default_config(gui.pruneduringfetch) false
set default_config(gui.trustmtime) false
set default_config(gui.diffcontext) 5
set default_config(gui.newbranchtemplate) {}
set default_config(gui.fontui) [font configure font_ui]
set default_config(gui.fontdiff) [font configure font_diff]
set font_descs {
{fontui font_ui {Main Font}}
{fontdiff font_diff {Diff/Console Font}}
}
load_config 0
apply_config
######################################################################
##
## ui construction
set ui_comm {}
# -- Menu Bar
#
menu .mbar -tearoff 0
.mbar add cascade -label Repository -menu .mbar.repository
.mbar add cascade -label Edit -menu .mbar.edit
.mbar add cascade -label [mc Repository] -menu .mbar.repository
.mbar add cascade -label [mc Edit] -menu .mbar.edit
if {[is_enabled branch]} {
.mbar add cascade -label Branch -menu .mbar.branch
.mbar add cascade -label [mc Branch] -menu .mbar.branch
}
if {[is_enabled multicommit] || [is_enabled singlecommit]} {
.mbar add cascade -label Commit -menu .mbar.commit
.mbar add cascade -label [mc Commit@@noun] -menu .mbar.commit
}
if {[is_enabled transport]} {
.mbar add cascade -label Merge -menu .mbar.merge
.mbar add cascade -label Fetch -menu .mbar.fetch
.mbar add cascade -label Push -menu .mbar.push
.mbar add cascade -label [mc Merge] -menu .mbar.merge
.mbar add cascade -label [mc Remote] -menu .mbar.remote
}
. configure -menu .mbar
@ -1770,87 +1839,87 @@ if {[is_enabled transport]} {
menu .mbar.repository
.mbar.repository add command \
-label {Browse Current Branch's Files} \
-label [mc "Browse Current Branch's Files"] \
-command {browser::new $current_branch}
set ui_browse_current [.mbar.repository index last]
.mbar.repository add command \
-label {Browse Branch Files...} \
-label [mc "Browse Branch Files..."] \
-command browser_open::dialog
.mbar.repository add separator
.mbar.repository add command \
-label {Visualize Current Branch's History} \
-label [mc "Visualize Current Branch's History"] \
-command {do_gitk $current_branch}
set ui_visualize_current [.mbar.repository index last]
.mbar.repository add command \
-label {Visualize All Branch History} \
-label [mc "Visualize All Branch History"] \
-command {do_gitk --all}
.mbar.repository add separator
proc current_branch_write {args} {
global current_branch
.mbar.repository entryconf $::ui_browse_current \
-label "Browse $current_branch's Files"
-label [mc "Browse %s's Files" $current_branch]
.mbar.repository entryconf $::ui_visualize_current \
-label "Visualize $current_branch's History"
-label [mc "Visualize %s's History" $current_branch]
}
trace add variable current_branch write current_branch_write
if {[is_enabled multicommit]} {
.mbar.repository add command -label {Database Statistics} \
.mbar.repository add command -label [mc "Database Statistics"] \
-command do_stats
.mbar.repository add command -label {Compress Database} \
.mbar.repository add command -label [mc "Compress Database"] \
-command do_gc
.mbar.repository add command -label {Verify Database} \
.mbar.repository add command -label [mc "Verify Database"] \
-command do_fsck_objects
.mbar.repository add separator
if {[is_Cygwin]} {
.mbar.repository add command \
-label {Create Desktop Icon} \
-label [mc "Create Desktop Icon"] \
-command do_cygwin_shortcut
} elseif {[is_Windows]} {
.mbar.repository add command \
-label {Create Desktop Icon} \
-label [mc "Create Desktop Icon"] \
-command do_windows_shortcut
} elseif {[is_MacOSX]} {
.mbar.repository add command \
-label {Create Desktop Icon} \
-label [mc "Create Desktop Icon"] \
-command do_macosx_app
}
}
.mbar.repository add command -label Quit \
.mbar.repository add command -label [mc Quit] \
-command do_quit \
-accelerator $M1T-Q
# -- Edit Menu
#
menu .mbar.edit
.mbar.edit add command -label Undo \
.mbar.edit add command -label [mc Undo] \
-command {catch {[focus] edit undo}} \
-accelerator $M1T-Z
.mbar.edit add command -label Redo \
.mbar.edit add command -label [mc Redo] \
-command {catch {[focus] edit redo}} \
-accelerator $M1T-Y
.mbar.edit add separator
.mbar.edit add command -label Cut \
.mbar.edit add command -label [mc Cut] \
-command {catch {tk_textCut [focus]}} \
-accelerator $M1T-X
.mbar.edit add command -label Copy \
.mbar.edit add command -label [mc Copy] \
-command {catch {tk_textCopy [focus]}} \
-accelerator $M1T-C
.mbar.edit add command -label Paste \
.mbar.edit add command -label [mc Paste] \
-command {catch {tk_textPaste [focus]; [focus] see insert}} \
-accelerator $M1T-V
.mbar.edit add command -label Delete \
.mbar.edit add command -label [mc Delete] \
-command {catch {[focus] delete sel.first sel.last}} \
-accelerator Del
.mbar.edit add separator
.mbar.edit add command -label {Select All} \
.mbar.edit add command -label [mc "Select All"] \
-command {catch {[focus] tag add sel 0.0 end}} \
-accelerator $M1T-A
@ -1859,29 +1928,29 @@ menu .mbar.edit
if {[is_enabled branch]} {
menu .mbar.branch
.mbar.branch add command -label {Create...} \
.mbar.branch add command -label [mc "Create..."] \
-command branch_create::dialog \
-accelerator $M1T-N
lappend disable_on_lock [list .mbar.branch entryconf \
[.mbar.branch index last] -state]
.mbar.branch add command -label {Checkout...} \
.mbar.branch add command -label [mc "Checkout..."] \
-command branch_checkout::dialog \
-accelerator $M1T-O
lappend disable_on_lock [list .mbar.branch entryconf \
[.mbar.branch index last] -state]
.mbar.branch add command -label {Rename...} \
.mbar.branch add command -label [mc "Rename..."] \
-command branch_rename::dialog
lappend disable_on_lock [list .mbar.branch entryconf \
[.mbar.branch index last] -state]
.mbar.branch add command -label {Delete...} \
.mbar.branch add command -label [mc "Delete..."] \
-command branch_delete::dialog
lappend disable_on_lock [list .mbar.branch entryconf \
[.mbar.branch index last] -state]
.mbar.branch add command -label {Reset...} \
.mbar.branch add command -label [mc "Reset..."] \
-command merge::reset_hard
lappend disable_on_lock [list .mbar.branch entryconf \
[.mbar.branch index last] -state]
@ -1893,7 +1962,7 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
menu .mbar.commit
.mbar.commit add radiobutton \
-label {New Commit} \
-label [mc "New Commit"] \
-command do_select_commit_type \
-variable selected_commit_type \
-value new
@ -1901,7 +1970,7 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
[list .mbar.commit entryconf [.mbar.commit index last] -state]
.mbar.commit add radiobutton \
-label {Amend Last Commit} \
-label [mc "Amend Last Commit"] \
-command do_select_commit_type \
-variable selected_commit_type \
-value amend
@ -1910,40 +1979,41 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
.mbar.commit add separator
.mbar.commit add command -label Rescan \
.mbar.commit add command -label [mc Rescan] \
-command do_rescan \
-accelerator F5
lappend disable_on_lock \
[list .mbar.commit entryconf [.mbar.commit index last] -state]
.mbar.commit add command -label {Stage To Commit} \
-command do_add_selection
.mbar.commit add command -label [mc "Stage To Commit"] \
-command do_add_selection \
-accelerator $M1T-T
lappend disable_on_lock \
[list .mbar.commit entryconf [.mbar.commit index last] -state]
.mbar.commit add command -label {Stage Changed Files To Commit} \
.mbar.commit add command -label [mc "Stage Changed Files To Commit"] \
-command do_add_all \
-accelerator $M1T-I
lappend disable_on_lock \
[list .mbar.commit entryconf [.mbar.commit index last] -state]
.mbar.commit add command -label {Unstage From Commit} \
.mbar.commit add command -label [mc "Unstage From Commit"] \
-command do_unstage_selection
lappend disable_on_lock \
[list .mbar.commit entryconf [.mbar.commit index last] -state]
.mbar.commit add command -label {Revert Changes} \
.mbar.commit add command -label [mc "Revert Changes"] \
-command do_revert_selection
lappend disable_on_lock \
[list .mbar.commit entryconf [.mbar.commit index last] -state]
.mbar.commit add separator
.mbar.commit add command -label {Sign Off} \
.mbar.commit add command -label [mc "Sign Off"] \
-command do_signoff \
-accelerator $M1T-S
.mbar.commit add command -label Commit \
.mbar.commit add command -label [mc Commit@@verb] \
-command do_commit \
-accelerator $M1T-Return
lappend disable_on_lock \
@ -1954,12 +2024,12 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
#
if {[is_enabled branch]} {
menu .mbar.merge
.mbar.merge add command -label {Local Merge...} \
.mbar.merge add command -label [mc "Local Merge..."] \
-command merge::dialog \
-accelerator $M1T-M
lappend disable_on_lock \
[list .mbar.merge entryconf [.mbar.merge index last] -state]
.mbar.merge add command -label {Abort Merge...} \
.mbar.merge add command -label [mc "Abort Merge..."] \
-command merge::reset_hard
lappend disable_on_lock \
[list .mbar.merge entryconf [.mbar.merge index last] -state]
@ -1968,41 +2038,46 @@ if {[is_enabled branch]} {
# -- Transport Menu
#
if {[is_enabled transport]} {
menu .mbar.fetch
menu .mbar.remote
menu .mbar.push
.mbar.push add command -label {Push...} \
.mbar.remote add command \
-label [mc "Push..."] \
-command do_push_anywhere \
-accelerator $M1T-P
.mbar.push add command -label {Delete...} \
.mbar.remote add command \
-label [mc "Delete..."] \
-command remote_branch_delete::dialog
}
if {[is_MacOSX]} {
# -- Apple Menu (Mac OS X only)
#
.mbar add cascade -label Apple -menu .mbar.apple
.mbar add cascade -label [mc Apple] -menu .mbar.apple
menu .mbar.apple
.mbar.apple add command -label "About [appname]" \
.mbar.apple add command -label [mc "About %s" [appname]] \
-command do_about
.mbar.apple add command -label "Options..." \
-command do_options
.mbar.apple add separator
.mbar.apple add command \
-label [mc "Preferences..."] \
-command do_options \
-accelerator $M1T-,
bind . <$M1B-,> do_options
} else {
# -- Edit Menu
#
.mbar.edit add separator
.mbar.edit add command -label {Options...} \
.mbar.edit add command -label [mc "Options..."] \
-command do_options
}
# -- Help Menu
#
.mbar add cascade -label Help -menu .mbar.help
.mbar add cascade -label [mc Help] -menu .mbar.help
menu .mbar.help
if {![is_MacOSX]} {
.mbar.help add command -label "About [appname]" \
.mbar.help add command -label [mc "About %s" [appname]] \
-command do_about
}
@ -2039,17 +2114,11 @@ if {[file isfile $doc_path]} {
}
if {$browser ne {}} {
.mbar.help add command -label {Online Documentation} \
.mbar.help add command -label [mc "Online Documentation"] \
-command [list exec $browser $doc_url &]
}
unset browser doc_path doc_url
set root_exists 0
bind . <Visibility> {
bind . <Visibility> {}
set root_exists 1
}
# -- Standard bindings
#
wm protocol . WM_DELETE_WINDOW do_quit
@ -2129,7 +2198,7 @@ blame {
}
blame {
if {$head eq {} && ![file exists $path]} {