Merge git-gui 0.14.0
This commit is contained in:
commit
42f9874573
@ -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 {
|
||||
|
@ -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]
|
||||
|
@ -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 \
|
||||
|
@ -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] \
|
||||
|
@ -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 {
|
||||
|
@ -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} {
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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} {
|
||||
|
@ -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
|
||||
|
169
git-gui/po/glossary/pt_br.po
Normal file
169
git-gui/po/glossary/pt_br.po
Normal 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
2568
git-gui/po/pt_br.po
Normal file
File diff suppressed because it is too large
Load Diff
631
git-gui/po/ru.po
631
git-gui/po/ru.po
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user