Merge git-gui 0.14.0

This commit is contained in:
Junio C Hamano 2011-03-26 10:42:26 -07:00
commit 42f9874573
14 changed files with 3383 additions and 449 deletions

View File

@ -93,6 +93,25 @@ if {![catch {set _verbose $env(GITGUI_VERBOSE)}]} {
package require msgcat
# Check for Windows 7 MUI language pack (missed by msgcat < 1.4.4)
if {[tk windowingsystem] eq "win32"
&& [package vcompare [package provide msgcat] 1.4.4] < 0
} then {
proc _mc_update_locale {} {
set key {HKEY_CURRENT_USER\Control Panel\Desktop}
if {![catch {
package require registry
set uilocale [registry get $key "PreferredUILanguages"]
msgcat::ConvertLocale [string map {- _} [lindex $uilocale 0]]
} uilocale]} {
if {[string length $uilocale] > 0} {
msgcat::mclocale $uilocale
}
}
}
_mc_update_locale
}
proc _mc_trim {fmt} {
set cmk [string first @@ $fmt]
if {$cmk > 0} {
@ -139,6 +158,10 @@ if {$_trace >= 0} {
set _trace 0
}
# variable for the last merged branch (useful for a default when deleting
# branches).
set _last_merged_branch {}
proc shellpath {} {
global _shellpath env
if {[string match @@* $_shellpath]} {
@ -1448,13 +1471,17 @@ proc rescan_stage2 {fd after} {
close $fd
}
set ls_others [list --exclude-per-directory=.gitignore]
if {[have_info_exclude]} {
lappend ls_others "--exclude-from=[gitdir info exclude]"
}
set user_exclude [get_config core.excludesfile]
if {$user_exclude ne {} && [file readable $user_exclude]} {
lappend ls_others "--exclude-from=$user_exclude"
if {[package vsatisfies $::_git_version 1.6.3]} {
set ls_others [list --exclude-standard]
} else {
set ls_others [list --exclude-per-directory=.gitignore]
if {[have_info_exclude]} {
lappend ls_others "--exclude-from=[gitdir info exclude]"
}
set user_exclude [get_config core.excludesfile]
if {$user_exclude ne {} && [file readable $user_exclude]} {
lappend ls_others "--exclude-from=[file normalize $user_exclude]"
}
}
set buf_rdi {}
@ -1958,8 +1985,8 @@ static unsigned char file_merge_bits[] = {
} -maskdata $filemask
image create bitmap file_statechange -background white -foreground green -data {
#define file_merge_width 14
#define file_merge_height 15
#define file_statechange_width 14
#define file_statechange_height 15
static unsigned char file_statechange_bits[] = {
0xfe, 0x01, 0x02, 0x03, 0x02, 0x05, 0x02, 0x09, 0x02, 0x1f, 0x62, 0x10,
0x62, 0x10, 0xba, 0x11, 0xba, 0x11, 0x62, 0x10, 0x62, 0x10, 0x02, 0x10,
@ -1993,7 +2020,11 @@ foreach i {
{MD {mc "Staged for commit, missing"}}
{_T {mc "File type changed, not staged"}}
{MT {mc "File type changed, old type staged for commit"}}
{AT {mc "File type changed, old type staged for commit"}}
{T_ {mc "File type changed, staged"}}
{TM {mc "File type change staged, modification not staged"}}
{TD {mc "File type change staged, file missing"}}
{_O {mc "Untracked, not staged"}}
{A_ {mc "Staged for commit"}}
@ -3331,6 +3362,8 @@ foreach {n c} {0 black 1 red4 2 green4 3 yellow4 4 blue4 5 magenta4 6 cyan4 7 gr
}
$ui_diff tag configure clr1 -font font_diffbold
$ui_diff tag conf d_info -foreground blue -font font_diffbold
$ui_diff tag conf d_cr -elide true
$ui_diff tag conf d_@ -font font_diffbold
$ui_diff tag conf d_+ -foreground {#00a000}
@ -3351,13 +3384,13 @@ $ui_diff tag conf d_s- \
-foreground red \
-background ivory1
$ui_diff tag conf d<<<<<<< \
$ui_diff tag conf d< \
-foreground orange \
-font font_diffbold
$ui_diff tag conf d======= \
$ui_diff tag conf d= \
-foreground orange \
-font font_diffbold
$ui_diff tag conf d>>>>>>> \
$ui_diff tag conf d> \
-foreground orange \
-font font_diffbold
@ -3533,8 +3566,8 @@ proc popup_diff_menu {ctxm ctxmmg ctxmsm x y X Y} {
|| $current_diff_path eq {}
|| {__} eq $state
|| {_O} eq $state
|| {_T} eq $state
|| {T_} eq $state
|| [string match {?T} $state]
|| [string match {T?} $state]
|| [has_textconv $current_diff_path]} {
set s disabled
} else {

View File

@ -121,7 +121,7 @@ method _parent {} {
if {$browser_stack eq {}} {
regsub {:.*$} $browser_path {:} browser_path
} else {
regsub {/[^/]+$} $browser_path {} browser_path
regsub {/[^/]+/$} $browser_path {/} browser_path
}
set browser_status [mc "Loading %s..." $browser_path]
_ls $this [lindex $parent 0] [lindex $parent 1]

View File

@ -214,14 +214,6 @@ constructor pick {} {
}
}
proc _home {} {
if {[catch {set h $::env(HOME)}]
|| ![file isdirectory $h]} {
set h .
}
return $h
}
method _center {} {
set nx [winfo reqwidth $top]
set ny [winfo reqheight $top]
@ -420,7 +412,7 @@ method _new_local_path {} {
if {$local_path ne {}} {
set p [file dirname $local_path]
} else {
set p [_home]
set p [pwd]
}
set p [tk_chooseDirectory \
@ -541,7 +533,7 @@ method _open_origin {} {
if {$origin_url ne {} && [file isdirectory $origin_url]} {
set p $origin_url
} else {
set p [_home]
set p [pwd]
}
set p [tk_chooseDirectory \
@ -1042,7 +1034,7 @@ method _open_local_path {} {
if {$local_path ne {}} {
set p $local_path
} else {
set p [_home]
set p [pwd]
}
set p [tk_chooseDirectory \

View File

@ -161,11 +161,12 @@ The rescan will be automatically started now.
#
set files_ready 0
foreach path [array names file_states] {
switch -glob -- [lindex $file_states($path) 0] {
set s $file_states($path)
switch -glob -- [lindex $s 0] {
_? {continue}
A? -
D? -
T_ -
T? -
M? {set files_ready 1}
_U -
U? {
@ -452,7 +453,11 @@ A rescan will be automatically started now.
}
AM -
AD -
AT -
TM -
TD -
MM -
MT -
MD {
set file_states($path) [list \
_[string index $m 1] \

View File

@ -122,22 +122,22 @@ proc show_unmerged_diff {cont_info} {
if {$merge_stages(2) eq {}} {
set is_conflict_diff 1
lappend current_diff_queue \
[list [mc "LOCAL: deleted\nREMOTE:\n"] d======= \
[list [mc "LOCAL: deleted\nREMOTE:\n"] d= \
[list ":1:$current_diff_path" ":3:$current_diff_path"]]
} elseif {$merge_stages(3) eq {}} {
set is_conflict_diff 1
lappend current_diff_queue \
[list [mc "REMOTE: deleted\nLOCAL:\n"] d======= \
[list [mc "REMOTE: deleted\nLOCAL:\n"] d= \
[list ":1:$current_diff_path" ":2:$current_diff_path"]]
} elseif {[lindex $merge_stages(1) 0] eq {120000}
|| [lindex $merge_stages(2) 0] eq {120000}
|| [lindex $merge_stages(3) 0] eq {120000}} {
set is_conflict_diff 1
lappend current_diff_queue \
[list [mc "LOCAL:\n"] d======= \
[list [mc "LOCAL:\n"] d= \
[list ":1:$current_diff_path" ":2:$current_diff_path"]]
lappend current_diff_queue \
[list [mc "REMOTE:\n"] d======= \
[list [mc "REMOTE:\n"] d= \
[list ":1:$current_diff_path" ":3:$current_diff_path"]]
} else {
start_show_diff $cont_info
@ -208,32 +208,32 @@ proc show_other_diff {path w m cont_info} {
$ui_diff insert end [append \
"* " \
[mc "Git Repository (subproject)"] \
"\n"] d_@
"\n"] d_info
} elseif {![catch {set type [exec file $path]}]} {
set n [string length $path]
if {[string equal -length $n $path $type]} {
set type [string range $type $n end]
regsub {^:?\s*} $type {} type
}
$ui_diff insert end "* $type\n" d_@
$ui_diff insert end "* $type\n" d_info
}
if {[string first "\0" $content] != -1} {
$ui_diff insert end \
[mc "* Binary file (not showing content)."] \
d_@
d_info
} else {
if {$sz > $max_sz} {
$ui_diff insert end [mc \
"* Untracked file is %d bytes.
* Showing only first %d bytes.
" $sz $max_sz] d_@
" $sz $max_sz] d_info
}
$ui_diff insert end $content
if {$sz > $max_sz} {
$ui_diff insert end [mc "
* Untracked file clipped here by %s.
* To see the entire file, use an external editor.
" [appname]] d_@
" [appname]] d_info
}
}
$ui_diff conf -state disabled
@ -253,6 +253,19 @@ proc show_other_diff {path w m cont_info} {
}
}
proc get_conflict_marker_size {path} {
set size 7
catch {
set fd_rc [eval [list git_read check-attr "conflict-marker-size" -- $path]]
set ret [gets $fd_rc line]
close $fd_rc
if {$ret > 0} {
regexp {.*: conflict-marker-size: (\d+)$} $line line size
}
}
return $size
}
proc start_show_diff {cont_info {add_opts {}}} {
global file_states file_lists
global is_3way_diff is_submodule_diff diff_active repo_config
@ -268,6 +281,7 @@ proc start_show_diff {cont_info {add_opts {}}} {
set is_submodule_diff 0
set diff_active 1
set current_diff_header {}
set conflict_size [get_conflict_marker_size $path]
set cmd [list]
if {$w eq $ui_index} {
@ -329,7 +343,7 @@ proc start_show_diff {cont_info {add_opts {}}} {
-blocking 0 \
-encoding [get_path_encoding $path] \
-translation lf
fileevent $fd readable [list read_diff $fd $cont_info]
fileevent $fd readable [list read_diff $fd $conflict_size $cont_info]
}
proc parse_color_line {line} {
@ -337,19 +351,27 @@ proc parse_color_line {line} {
set result ""
set markup [list]
set regexp {\033\[((?:\d+;)*\d+)?m}
set need_reset 0
while {[regexp -indices -start $start $regexp $line match code]} {
foreach {begin end} $match break
append result [string range $line $start [expr {$begin - 1}]]
lappend markup [string length $result] \
[eval [linsert $code 0 string range $line]]
set pos [string length $result]
set col [eval [linsert $code 0 string range $line]]
set start [incr end]
if {$col eq "0" || $col eq ""} {
if {!$need_reset} continue
set need_reset 0
} else {
set need_reset 1
}
lappend markup $pos $col
}
append result [string range $line $start end]
if {[llength $markup] < 4} {set markup {}}
return [list $result $markup]
}
proc read_diff {fd cont_info} {
proc read_diff {fd conflict_size cont_info} {
global ui_diff diff_active is_submodule_diff
global is_3way_diff is_conflict_diff current_diff_header
global current_diff_queue
@ -360,37 +382,50 @@ proc read_diff {fd cont_info} {
foreach {line markup} [parse_color_line $line] break
set line [string map {\033 ^} $line]
# -- Cleanup uninteresting diff header lines.
set tags {}
# -- Check for start of diff header.
if { [string match {diff --git *} $line]
|| [string match {diff --cc *} $line]
|| [string match {diff --combined *} $line]} {
set ::current_diff_inheader 1
}
# -- Check for end of diff header (any hunk line will do this).
#
if {$::current_diff_inheader} {
if { [string match {diff --git *} $line]
|| [string match {diff --cc *} $line]
|| [string match {diff --combined *} $line]
|| [string match {--- *} $line]
|| [string match {+++ *} $line]} {
append current_diff_header $line "\n"
continue
}
}
if {[string match {index *} $line]} continue
if {$line eq {deleted file mode 120000}} {
set line "deleted symlink"
}
set ::current_diff_inheader 0
if {[regexp {^@@+ } $line]} {set ::current_diff_inheader 0}
# -- Automatically detect if this is a 3 way diff.
#
if {[string match {@@@ *} $line]} {set is_3way_diff 1}
if {[string match {mode *} $line]
|| [string match {new file *} $line]
|| [regexp {^(old|new) mode *} $line]
|| [string match {deleted file *} $line]
|| [string match {deleted symlink} $line]
|| [string match {Binary files * and * differ} $line]
|| $line eq {\ No newline at end of file}
|| [regexp {^\* Unmerged path } $line]} {
set tags {}
if {$::current_diff_inheader} {
# -- These two lines stop a diff header and shouldn't be in there
if { [string match {Binary files * and * differ} $line]
|| [regexp {^\* Unmerged path } $line]} {
set ::current_diff_inheader 0
} else {
append current_diff_header $line "\n"
}
# -- Cleanup uninteresting diff header lines.
#
if { [string match {diff --git *} $line]
|| [string match {diff --cc *} $line]
|| [string match {diff --combined *} $line]
|| [string match {--- *} $line]
|| [string match {+++ *} $line]
|| [string match {index *} $line]} {
continue
}
# -- Name it symlink, not 120000
# Note, that the original line is in $current_diff_header
regsub {^(deleted|new) file mode 120000} $line {\1 symlink} line
} elseif { $line eq {\ No newline at end of file}} {
# -- Handle some special lines
} elseif {$is_3way_diff} {
set op [string range $line 0 1]
switch -- $op {
@ -402,7 +437,9 @@ proc read_diff {fd cont_info} {
{- } {set tags d_-s}
{--} {set tags d_--}
{++} {
if {[regexp {^\+\+([<>]{7} |={7})} $line _g op]} {
set regexp [string map [list %conflict_size $conflict_size]\
{^\+\+([<>=]){%conflict_size}(?: |$)}]
if {[regexp $regexp $line _g op]} {
set is_conflict_diff 1
set line [string replace $line 0 1 { }]
set tags d$op
@ -418,10 +455,10 @@ proc read_diff {fd cont_info} {
} elseif {$is_submodule_diff} {
if {$line == ""} continue
if {[regexp {^Submodule } $line]} {
set tags d_@
set tags d_info
} elseif {[regexp {^\* } $line]} {
set line [string replace $line 0 1 {Submodule }]
set tags d_@
set tags d_info
} else {
set op [string range $line 0 2]
switch -- $op {
@ -441,7 +478,9 @@ proc read_diff {fd cont_info} {
{@} {set tags d_@}
{-} {set tags d_-}
{+} {
if {[regexp {^\+([<>]{7} |={7})} $line _g op]} {
set regexp [string map [list %conflict_size $conflict_size]\
{^\+([<>=]){%conflict_size}(?: |$)}]
if {[regexp $regexp $line _g op]} {
set is_conflict_diff 1
set tags d$op
} else {

View File

@ -103,8 +103,11 @@ proc write_update_indexinfo {fd pathList totalCnt batch after} {
set s $file_states($path)
switch -glob -- [lindex $s 0] {
A? {set new _O}
M? {set new _M}
MT -
TM -
T_ {set new _T}
M? {set new _M}
TD -
D_ {set new _D}
D? {set new _?}
?? {continue}
@ -167,7 +170,10 @@ proc write_update_index {fd pathList totalCnt batch after} {
AD {set new __}
?D {set new D_}
_O -
AT -
AM {set new A_}
TM -
MT -
_T {set new T_}
_U -
U? {
@ -261,7 +267,7 @@ proc unstage_helper {txt paths} {
switch -glob -- [lindex $file_states($path) 0] {
A? -
M? -
T_ -
T? -
D? {
lappend pathList $path
if {$path eq $current_diff_path} {

View File

@ -83,6 +83,7 @@ method _visualize {} {
method _start {} {
global HEAD current_branch remote_url
global _last_merged_branch
set name [_rev $this]
if {$name eq {}} {
@ -109,6 +110,7 @@ method _start {} {
regsub ^refs/heads/ $branch {} branch
puts $fh "$cmit\t\tbranch '$branch' of $remote"
close $fh
set _last_merged_branch $branch
set cmd [list git]
lappend cmd merge

View File

@ -175,48 +175,23 @@ proc merge_resolve_tool2 {} {
# Build the command line
switch -- $tool {
kdiff3 {
araxis {
if {$base_stage ne {}} {
set cmdline [list "$merge_tool_path" --auto --L1 "$MERGED (Base)" \
--L2 "$MERGED (Local)" --L3 "$MERGED (Remote)" -o "$MERGED" "$BASE" "$LOCAL" "$REMOTE"]
set cmdline [list "$merge_tool_path" -wait -merge -3 -a1 \
-title1:"'$MERGED (Base)'" -title2:"'$MERGED (Local)'" \
-title3:"'$MERGED (Remote)'" \
"$BASE" "$LOCAL" "$REMOTE" "$MERGED"]
} else {
set cmdline [list "$merge_tool_path" --auto --L1 "$MERGED (Local)" \
--L2 "$MERGED (Remote)" -o "$MERGED" "$LOCAL" "$REMOTE"]
set cmdline [list "$merge_tool_path" -wait -2 \
-title1:"'$MERGED (Local)'" -title2:"'$MERGED (Remote)'" \
"$LOCAL" "$REMOTE" "$MERGED"]
}
}
tkdiff {
bc3 {
if {$base_stage ne {}} {
set cmdline [list "$merge_tool_path" -a "$BASE" -o "$MERGED" "$LOCAL" "$REMOTE"]
set cmdline [list "$merge_tool_path" "$LOCAL" "$REMOTE" "$BASE" -mergeoutput="$MERGED"]
} else {
set cmdline [list "$merge_tool_path" -o "$MERGED" "$LOCAL" "$REMOTE"]
}
}
meld {
set cmdline [list "$merge_tool_path" "$LOCAL" "$MERGED" "$REMOTE"]
}
gvimdiff {
set cmdline [list "$merge_tool_path" -f "$LOCAL" "$MERGED" "$REMOTE"]
}
xxdiff {
if {$base_stage ne {}} {
set cmdline [list "$merge_tool_path" -X --show-merged-pane \
-R {Accel.SaveAsMerged: "Ctrl-S"} \
-R {Accel.Search: "Ctrl+F"} \
-R {Accel.SearchForward: "Ctrl-G"} \
--merged-file "$MERGED" "$LOCAL" "$BASE" "$REMOTE"]
} else {
set cmdline [list "$merge_tool_path" -X --show-merged-pane \
-R {Accel.SaveAsMerged: "Ctrl-S"} \
-R {Accel.Search: "Ctrl+F"} \
-R {Accel.SearchForward: "Ctrl-G"} \
--merged-file "$MERGED" "$LOCAL" "$REMOTE"]
}
}
opendiff {
if {$base_stage ne {}} {
set cmdline [list "$merge_tool_path" "$LOCAL" "$REMOTE" -ancestor "$BASE" -merge "$MERGED"]
} else {
set cmdline [list "$merge_tool_path" "$LOCAL" "$REMOTE" -merge "$MERGED"]
set cmdline [list "$merge_tool_path" "$LOCAL" "$REMOTE" -mergeoutput="$MERGED"]
}
}
ecmerge {
@ -235,6 +210,42 @@ proc merge_resolve_tool2 {} {
"$LOCAL" "$REMOTE" "$basename"]
}
}
gvimdiff {
set cmdline [list "$merge_tool_path" -f "$LOCAL" "$MERGED" "$REMOTE"]
}
kdiff3 {
if {$base_stage ne {}} {
set cmdline [list "$merge_tool_path" --auto --L1 "$MERGED (Base)" \
--L2 "$MERGED (Local)" --L3 "$MERGED (Remote)" -o "$MERGED" "$BASE" "$LOCAL" "$REMOTE"]
} else {
set cmdline [list "$merge_tool_path" --auto --L1 "$MERGED (Local)" \
--L2 "$MERGED (Remote)" -o "$MERGED" "$LOCAL" "$REMOTE"]
}
}
meld {
set cmdline [list "$merge_tool_path" "$LOCAL" "$MERGED" "$REMOTE"]
}
opendiff {
if {$base_stage ne {}} {
set cmdline [list "$merge_tool_path" "$LOCAL" "$REMOTE" -ancestor "$BASE" -merge "$MERGED"]
} else {
set cmdline [list "$merge_tool_path" "$LOCAL" "$REMOTE" -merge "$MERGED"]
}
}
p4merge {
set cmdline [list "$merge_tool_path" "$BASE" "$REMOTE" "$LOCAL" "$MERGED"]
}
tkdiff {
if {$base_stage ne {}} {
set cmdline [list "$merge_tool_path" -a "$BASE" -o "$MERGED" "$LOCAL" "$REMOTE"]
} else {
set cmdline [list "$merge_tool_path" -o "$MERGED" "$LOCAL" "$REMOTE"]
}
}
vimdiff {
error_popup [mc "Not a GUI merge tool: '%s'" $tool]
return
}
winmerge {
if {$base_stage ne {}} {
# This tool does not support 3-way merges.
@ -245,25 +256,21 @@ proc merge_resolve_tool2 {} {
-dl "Theirs File" -dr "Mine File" "$REMOTE" "$LOCAL" "$MERGED"]
}
}
araxis {
xxdiff {
if {$base_stage ne {}} {
set cmdline [list "$merge_tool_path" -wait -merge -3 -a1 \
-title1:"'$MERGED (Base)'" -title2:"'$MERGED (Local)'" \
-title3:"'$MERGED (Remote)'" \
"$BASE" "$LOCAL" "$REMOTE" "$MERGED"]
set cmdline [list "$merge_tool_path" -X --show-merged-pane \
-R {Accel.SaveAsMerged: "Ctrl-S"} \
-R {Accel.Search: "Ctrl+F"} \
-R {Accel.SearchForward: "Ctrl-G"} \
--merged-file "$MERGED" "$LOCAL" "$BASE" "$REMOTE"]
} else {
set cmdline [list "$merge_tool_path" -wait -2 \
-title1:"'$MERGED (Local)'" -title2:"'$MERGED (Remote)'" \
"$LOCAL" "$REMOTE" "$MERGED"]
set cmdline [list "$merge_tool_path" -X --show-merged-pane \
-R {Accel.SaveAsMerged: "Ctrl-S"} \
-R {Accel.Search: "Ctrl+F"} \
-R {Accel.SearchForward: "Ctrl-G"} \
--merged-file "$MERGED" "$LOCAL" "$REMOTE"]
}
}
p4merge {
set cmdline [list "$merge_tool_path" "$BASE" "$REMOTE" "$LOCAL" "$MERGED"]
}
vimdiff {
error_popup [mc "Not a GUI merge tool: '%s'" $tool]
return
}
default {
error_popup [mc "Unsupported merge tool '%s'" $tool]
return

View File

@ -157,22 +157,7 @@ proc add_fetch_entry {r} {
}
if {$enable} {
if {![winfo exists $fetch_m]} {
menu $remove_m
$remote_m insert 0 cascade \
-label [mc "Remove Remote"] \
-menu $remove_m
menu $prune_m
$remote_m insert 0 cascade \
-label [mc "Prune from"] \
-menu $prune_m
menu $fetch_m
$remote_m insert 0 cascade \
-label [mc "Fetch from"] \
-menu $fetch_m
}
make_sure_remote_submenues_exist $remote_m
$fetch_m add command \
-label $r \
@ -222,6 +207,70 @@ proc add_push_entry {r} {
}
}
proc make_sure_remote_submenues_exist {remote_m} {
set fetch_m $remote_m.fetch
set prune_m $remote_m.prune
set remove_m $remote_m.remove
if {![winfo exists $fetch_m]} {
menu $remove_m
$remote_m insert 0 cascade \
-label [mc "Remove Remote"] \
-menu $remove_m
menu $prune_m
$remote_m insert 0 cascade \
-label [mc "Prune from"] \
-menu $prune_m
menu $fetch_m
$remote_m insert 0 cascade \
-label [mc "Fetch from"] \
-menu $fetch_m
}
}
proc update_all_remotes_menu_entry {} {
global all_remotes
if {[git-version < 1.6.6]} { return }
set have_remote 0
foreach r $all_remotes {
incr have_remote
}
set remote_m .mbar.remote
set fetch_m $remote_m.fetch
set prune_m $remote_m.prune
if {$have_remote > 1} {
make_sure_remote_submenues_exist $remote_m
if {[$fetch_m entrycget end -label] ne "All"} {
$fetch_m insert end separator
$fetch_m insert end command \
-label "All" \
-command fetch_from_all
$prune_m insert end separator
$prune_m insert end command \
-label "All" \
-command prune_from_all
}
} else {
if {[winfo exists $fetch_m]} {
if {[$fetch_m entrycget end -label] eq "All"} {
delete_from_menu $fetch_m end
delete_from_menu $fetch_m end
delete_from_menu $prune_m end
delete_from_menu $prune_m end
}
}
}
}
proc populate_remotes_menu {} {
global all_remotes
@ -229,6 +278,8 @@ proc populate_remotes_menu {} {
add_fetch_entry $r
add_push_entry $r
}
update_all_remotes_menu_entry
}
proc add_single_remote {name location} {
@ -244,6 +295,8 @@ proc add_single_remote {name location} {
add_fetch_entry $name
add_push_entry $name
update_all_remotes_menu_entry
}
proc delete_from_menu {menu name} {
@ -264,8 +317,8 @@ proc remove_remote {name} {
unset repo_config(remote.$name.push)
}
set i [lsearch -exact all_remotes $name]
lreplace all_remotes $i $i
set i [lsearch -exact $all_remotes $name]
set all_remotes [lreplace $all_remotes $i $i]
set remote_m .mbar.remote
delete_from_menu $remote_m.fetch $name
@ -273,4 +326,6 @@ proc remove_remote {name} {
delete_from_menu $remote_m.remove $name
# Not all remotes are in the push menu
catch { delete_from_menu $remote_m.push $name }
update_all_remotes_menu_entry
}

View File

@ -251,7 +251,7 @@ method _write_url {args} { set urltype url }
method _write_check_head {args} { set checktype head }
method _write_head_list {args} {
global current_branch
global current_branch _last_merged_branch
$head_m delete 0 end
foreach abr $head_list {
@ -267,6 +267,13 @@ method _write_head_list {args} {
set check_head $current_branch
}
}
set lmb [lsearch -exact -sorted $head_list $_last_merged_branch]
if {$lmb >= 0} {
$w.heads.l conf -state normal
$w.heads.l select set $lmb
$w.heads.l yview $lmb
$w.heads.l conf -state disabled
}
}
method _write_urltype {args} {

View File

@ -20,6 +20,35 @@ proc prune_from {remote} {
console::exec $w [list git remote prune $remote]
}
proc fetch_from_all {} {
set w [console::new \
[mc "fetch all remotes"] \
[mc "Fetching new changes from all remotes"]]
set cmd [list git fetch --all]
if {[is_config_true gui.pruneduringfetch]} {
lappend cmd --prune
}
console::exec $w $cmd
}
proc prune_from_all {} {
global all_remotes
set w [console::new \
[mc "remote prune all remotes"] \
[mc "Pruning tracking branches deleted from all remotes"]]
set cmd [list git remote prune]
foreach r $all_remotes {
lappend cmd $r
}
console::exec $w $cmd
}
proc push_to {remote} {
set w [console::new \
[mc "push %s" $remote] \
@ -123,6 +152,7 @@ proc do_push_anywhere {} {
$w.source.l insert end $h
if {$h eq $current_branch} {
$w.source.l select set end
$w.source.l yview end
}
}
pack $w.source.l -side left -fill both -expand 1
@ -135,7 +165,9 @@ proc do_push_anywhere {} {
-value remote \
-variable push_urltype
if {$use_ttk} {
ttk::combobox $w.dest.remote_m -textvariable push_remote \
ttk::combobox $w.dest.remote_m -state readonly \
-exportselection false \
-textvariable push_remote \
-values $all_remotes
} else {
eval tk_optionMenu $w.dest.remote_m push_remote $all_remotes

View File

@ -0,0 +1,169 @@
# Translation of git-gui to Brazilian Portuguese
# Copyright (C) 2007 Shawn Pearce, et al.
# This file is distributed under the same license as the git-gui package.
#
# Alexandre Erwin Ittner <alexandre@ittner.com.br>, 2010.
msgid ""
msgstr ""
"Project-Id-Version: git-gui\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-01-26 15:47-0800\n"
"PO-Revision-Date: 2010-09-18 11:09-0300\n"
"Last-Translator: Alexandre Erwin Ittner <alexandre@ittner.com.br>\n"
"Language-Team: Brazilian Portuguese <>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. "English Definition (Dear translator: This file will never be visible to the user! It should only serve as a tool for you, the translator. Nothing more.)"
msgid ""
"English Term (Dear translator: This file will never be visible to the user!)"
msgstr ""
#. ""
msgid "amend"
msgstr "corrigir"
#. ""
msgid "annotate"
msgstr "anotar"
#. "A 'branch' is an active line of development."
msgid "branch [noun]"
msgstr "ramo"
#. ""
msgid "branch [verb]"
msgstr "ramificar"
#. ""
msgid "checkout [noun]"
msgstr "checkout"
#. "The action of updating the working tree to a revision which was stored in the object database."
msgid "checkout [verb]"
msgstr "efetuar checkout"
#. ""
msgid "clone [verb]"
msgstr "clonar"
#. "A single point in the git history."
msgid "commit [noun]"
msgstr "revisão"
#. "The action of storing a new snapshot of the project's state in the git history."
msgid "commit [verb]"
msgstr "salvar revisão"
#. ""
msgid "diff [noun]"
msgstr "diff"
#. ""
msgid "diff [verb]"
msgstr "comparar"
#. "A fast-forward is a special type of merge where you have a revision and you are merging another branch's changes that happen to be a descendant of what you have."
msgid "fast forward merge"
msgstr "mesclagem rápida"
#. "Fetching a branch means to get the branch's head from a remote repository, to find out which objects are missing from the local object database, and to get them, too."
msgid "fetch"
msgstr "receber"
#. "One context of consecutive lines in a whole patch, which consists of many such hunks"
msgid "hunk"
msgstr "trecho"
#. "A collection of files. The index is a stored version of your working tree."
msgid "index (in git-gui: staging area)"
msgstr "índice"
#. "A successful merge results in the creation of a new commit representing the result of the merge."
msgid "merge [noun]"
msgstr "mesclagem"
#. "To bring the contents of another branch into the current branch."
msgid "merge [verb]"
msgstr "mesclar"
#. ""
msgid "message"
msgstr "descrição da revisão"
#. "Deletes all stale tracking branches under <name>. These stale branches have already been removed from the remote repository referenced by <name>, but are still locally available in 'remotes/<name>'."
msgid "prune"
msgstr "limpar"
#. "Pulling a branch means to fetch it and merge it."
msgid "pull"
msgstr "receber e mesclar"
#. "Pushing a branch means to get the branch's head ref from a remote repository, and ... (well, can someone please explain it for mere mortals?)"
msgid "push"
msgstr "enviar"
#. ""
msgid "redo"
msgstr "refazer"
#. "An other repository ('remote'). One might have a set of remotes whose branches one tracks."
msgid "remote"
msgstr "repositório remoto"
#. "A collection of refs (?) together with an object database containing all objects which are reachable from the refs... (oops, you've lost me here. Again, please an explanation for mere mortals?)"
msgid "repository"
msgstr "repositório"
#. ""
msgid "reset"
msgstr "descartar, redefinir"
#. ""
msgid "revert"
msgstr "reverter"
#. "A particular state of files and directories which was stored in the object database."
msgid "revision"
msgstr "revisão"
#. ""
msgid "sign off"
msgstr "assinar embaixo"
#. ""
msgid "staging area"
msgstr "???"
#. ""
msgid "status"
msgstr "status"
#. "A ref pointing to a tag or commit object"
msgid "tag [noun]"
msgstr "etiqueta"
#. ""
msgid "tag [verb]"
msgstr "marcar etiqueta"
#. "A regular git branch that is used to follow changes from another repository."
msgid "tracking branch"
msgstr "ramo de rastreamento"
#. ""
msgid "undo"
msgstr "desfazer"
#. ""
msgid "update"
msgstr "atualizar"
#. ""
msgid "verify"
msgstr "verificar"
#. "The tree of actual checked out files."
msgid "working copy, working tree"
msgstr "cópia de trabalho, árvore de trabalho"

2568
git-gui/po/pt_br.po Normal file
View File

@ -0,0 +1,2568 @@
# Translation of git-gui to Brazilian Portuguese
# Copyright (C) 2007 Shawn Pearce, et al.
# This file is distributed under the same license as the git-gui package.
#
# Alexandre Erwin Ittner <alexandre@ittner.com.br>, 2010.
msgid ""
msgstr ""
"Project-Id-Version: git-gui\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-01-26 15:47-0800\n"
"PO-Revision-Date: 2010-09-18 11:09-0300\n"
"Last-Translator: Alexandre Erwin Ittner <alexandre@ittner.com.br>\n"
"Language-Team: Brazilian Portuguese <>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: git-gui.sh:41 git-gui.sh:793 git-gui.sh:807 git-gui.sh:820 git-gui.sh:903
#: git-gui.sh:922
msgid "git-gui: fatal error"
msgstr "git-gui: erro fatal"
#: git-gui.sh:743
#, tcl-format
msgid "Invalid font specified in %s:"
msgstr "Fonte inválida indicada em %s:"
#: git-gui.sh:779
msgid "Main Font"
msgstr "Fonte principal"
#: git-gui.sh:780
msgid "Diff/Console Font"
msgstr "Fonte para o diff/console"
#: git-gui.sh:794
msgid "Cannot find git in PATH."
msgstr "Impossível encontrar o git no \"PATH\""
#: git-gui.sh:821
msgid "Cannot parse Git version string:"
msgstr "Impossível interpretar a versão do git:"
#: git-gui.sh:839
#, tcl-format
msgid ""
"Git version cannot be determined.\n"
"\n"
"%s claims it is version '%s'.\n"
"\n"
"%s requires at least Git 1.5.0 or later.\n"
"\n"
"Assume '%s' is version 1.5.0?\n"
msgstr ""
"Não foi possível determinar a versão do git:\n"
"\n"
"%s afirmar que sua versão é \"%s\".\n"
"\n"
"%s exige o Git 1.5.0 ou posterior.\n"
"\n"
"Assumir que '%s' é a versão 1.5.0?\n"
#: git-gui.sh:1128
msgid "Git directory not found:"
msgstr "Diretório do Git não encontrado:"
#: git-gui.sh:1146
msgid "Cannot move to top of working directory:"
msgstr "Impossível mover para o início do diretório de trabalho:"
#: git-gui.sh:1154
msgid "Cannot use bare repository:"
msgstr "Impossível usar repositório puro:"
#: git-gui.sh:1162
msgid "No working directory"
msgstr "Sem diretório de trabalho"
#: git-gui.sh:1334 lib/checkout_op.tcl:306
msgid "Refreshing file status..."
msgstr "Atualizando estado dos arquivos..."
#: git-gui.sh:1390
msgid "Scanning for modified files ..."
msgstr "Procurando por arquivos modificados ..."
#: git-gui.sh:1454
msgid "Calling prepare-commit-msg hook..."
msgstr "Executando hook \"prepare-commit-msg\"..."
#: git-gui.sh:1471
msgid "Commit declined by prepare-commit-msg hook."
msgstr "O script \"prepare-commit-msg\" negou a criação de uma nova revisão"
#: git-gui.sh:1629 lib/browser.tcl:246
msgid "Ready."
msgstr "Pronto."
#: git-gui.sh:1787
#, tcl-format
msgid "Displaying only %s of %s files."
msgstr "Exibindo apenas %s de %s arquivos."
#: git-gui.sh:1913
msgid "Unmodified"
msgstr "Não modificado"
#: git-gui.sh:1915
msgid "Modified, not staged"
msgstr "Modificado, não marcado"
#: git-gui.sh:1916 git-gui.sh:1924
msgid "Staged for commit"
msgstr "Marcado para uma nova revisão"
#: git-gui.sh:1917 git-gui.sh:1925
msgid "Portions staged for commit"
msgstr "Trechos marcados para revisão"
#: git-gui.sh:1918 git-gui.sh:1926
msgid "Staged for commit, missing"
msgstr "Marcado para revisão, faltando"
#: git-gui.sh:1920
msgid "File type changed, not staged"
msgstr "Tipo do arquivo modificado, não marcado"
#: git-gui.sh:1921
msgid "File type changed, staged"
msgstr "Tipo do arquivo modificado, marcado"
#: git-gui.sh:1923
msgid "Untracked, not staged"
msgstr "Não monitorado, não marcado"
#: git-gui.sh:1928
msgid "Missing"
msgstr "Faltando"
#: git-gui.sh:1929
msgid "Staged for removal"
msgstr "Marcado para remoção"
#: git-gui.sh:1930
msgid "Staged for removal, still present"
msgstr "Marcado para remoção, ainda presente"
#: git-gui.sh:1932 git-gui.sh:1933 git-gui.sh:1934 git-gui.sh:1935
#: git-gui.sh:1936 git-gui.sh:1937
msgid "Requires merge resolution"
msgstr "Requer resolução de conflitos"
#: git-gui.sh:1972
msgid "Starting gitk... please wait..."
msgstr "Iniciando gitk... Aguarde..."
#: git-gui.sh:1984
msgid "Couldn't find gitk in PATH"
msgstr "Impossível encontrar o gitk no PATH"
#: git-gui.sh:2043
msgid "Couldn't find git gui in PATH"
msgstr "Impossível encontrar o \"git gui\" no PATH"
#: git-gui.sh:2455 lib/choose_repository.tcl:36
msgid "Repository"
msgstr "Repositório"
#: git-gui.sh:2456
msgid "Edit"
msgstr "Editar"
#: git-gui.sh:2458 lib/choose_rev.tcl:561
msgid "Branch"
msgstr "Ramo"
#: git-gui.sh:2461 lib/choose_rev.tcl:548
msgid "Commit@@noun"
msgstr "Revisão"
#: git-gui.sh:2464 lib/merge.tcl:121 lib/merge.tcl:150 lib/merge.tcl:168
msgid "Merge"
msgstr "Mesclar"
#: git-gui.sh:2465 lib/choose_rev.tcl:557
msgid "Remote"
msgstr "Remoto"
#: git-gui.sh:2468
msgid "Tools"
msgstr "Ferramentas"
#: git-gui.sh:2477
msgid "Explore Working Copy"
msgstr "Explorar cópia de trabalho"
#: git-gui.sh:2483
msgid "Browse Current Branch's Files"
msgstr "Explorar arquivos do ramo atual"
#: git-gui.sh:2487
msgid "Browse Branch Files..."
msgstr "Explorar arquivos do ramo..."
#: git-gui.sh:2492
msgid "Visualize Current Branch's History"
msgstr "Visualizar histórico do ramo atual"
#: git-gui.sh:2496
msgid "Visualize All Branch History"
msgstr "Visualizar histórico de todos os ramos"
#: git-gui.sh:2503
#, tcl-format
msgid "Browse %s's Files"
msgstr "Explorar arquivos de %s"
#: git-gui.sh:2505
#, tcl-format
msgid "Visualize %s's History"
msgstr "Visualizar histórico de %s"
#: git-gui.sh:2510 lib/database.tcl:27 lib/database.tcl:67
msgid "Database Statistics"
msgstr "Estatísticas do banco de dados"
#: git-gui.sh:2513 lib/database.tcl:34
msgid "Compress Database"
msgstr "Compactar banco de dados"
#: git-gui.sh:2516
msgid "Verify Database"
msgstr "Verificar banco de dados"
#: git-gui.sh:2523 git-gui.sh:2527 git-gui.sh:2531 lib/shortcut.tcl:8
#: lib/shortcut.tcl:40 lib/shortcut.tcl:72
msgid "Create Desktop Icon"
msgstr "Criar ícone na área de trabalho"
#: git-gui.sh:2539 lib/choose_repository.tcl:183 lib/choose_repository.tcl:191
msgid "Quit"
msgstr "Sair"
#: git-gui.sh:2547
msgid "Undo"
msgstr "Desfazer"
#: git-gui.sh:2550
msgid "Redo"
msgstr "Refazer"
#: git-gui.sh:2554 git-gui.sh:3109
msgid "Cut"
msgstr "Recortar"
#: git-gui.sh:2557 git-gui.sh:3112 git-gui.sh:3186 git-gui.sh:3259
#: lib/console.tcl:69
msgid "Copy"
msgstr "Copiar"
#: git-gui.sh:2560 git-gui.sh:3115
msgid "Paste"
msgstr "Colar"
#: git-gui.sh:2563 git-gui.sh:3118 lib/branch_delete.tcl:26
#: lib/remote_branch_delete.tcl:38
msgid "Delete"
msgstr "Apagar"
#: git-gui.sh:2567 git-gui.sh:3122 git-gui.sh:3263 lib/console.tcl:71
msgid "Select All"
msgstr "Selecionar tudo"
#: git-gui.sh:2576
msgid "Create..."
msgstr "Criar..."
#: git-gui.sh:2582
msgid "Checkout..."
msgstr "Checkout..."
#: git-gui.sh:2588
msgid "Rename..."
msgstr "Renomear..."
#: git-gui.sh:2593
msgid "Delete..."
msgstr "Apagar..."
#: git-gui.sh:2598
msgid "Reset..."
msgstr "Redefinir..."
#: git-gui.sh:2608
msgid "Done"
msgstr "Pronto"
#: git-gui.sh:2610
msgid "Commit@@verb"
msgstr "Salvar revisão"
#: git-gui.sh:2619 git-gui.sh:3050
msgid "New Commit"
msgstr "Nova revisão"
#: git-gui.sh:2627 git-gui.sh:3057
msgid "Amend Last Commit"
msgstr "Corrigir última revisão"
#: git-gui.sh:2637 git-gui.sh:3011 lib/remote_branch_delete.tcl:99
msgid "Rescan"
msgstr "Atualizar"
#: git-gui.sh:2643
msgid "Stage To Commit"
msgstr "Marcar para revisão"
#: git-gui.sh:2649
msgid "Stage Changed Files To Commit"
msgstr "Marcar arquivos modificados"
#: git-gui.sh:2655
msgid "Unstage From Commit"
msgstr "Desmarcar"
#: git-gui.sh:2661 lib/index.tcl:412
msgid "Revert Changes"
msgstr "Reverter mudanças"
#: git-gui.sh:2669 git-gui.sh:3310 git-gui.sh:3341
msgid "Show Less Context"
msgstr "Mostrar menos contexto"
#: git-gui.sh:2673 git-gui.sh:3314 git-gui.sh:3345
msgid "Show More Context"
msgstr "Mostrar mais contexto"
#: git-gui.sh:2680 git-gui.sh:3024 git-gui.sh:3133
msgid "Sign Off"
msgstr "Assinar embaixo"
#: git-gui.sh:2696
msgid "Local Merge..."
msgstr "Mesclar localmente..."
#: git-gui.sh:2701
msgid "Abort Merge..."
msgstr "Abortar mesclagem..."
#: git-gui.sh:2713 git-gui.sh:2741
msgid "Add..."
msgstr "Adicionar..."
#: git-gui.sh:2717
msgid "Push..."
msgstr "Enviar..."
#: git-gui.sh:2721
msgid "Delete Branch..."
msgstr "Apagar ramo..."
#: git-gui.sh:2731 git-gui.sh:3292
msgid "Options..."
msgstr "Opções..."
#: git-gui.sh:2742
msgid "Remove..."
msgstr "Remover..."
#: git-gui.sh:2751 lib/choose_repository.tcl:50
msgid "Help"