@matheusbsbs / matheus-bagliano / commits / ff515d81fa
Fork 0

git-gui: Support conflict states _U & UT.

Support _U (local deleted, remote modified) and UT (file type changed in conflict) modes. Note that 'file type changed' does not refer to changes in the executable bit, instead it denotes replacing a file with a link, or vice versa. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Alexander Gavrilov committed Aug 31, 2008 at 01:00 UTC ff515d81faa22f26b611ed7fd06a76d0c300ea39
4 files changed +7 -3
git-gui.sh
+4 -2
@@ -1669,10 +1669,12 @@ foreach i {
1669 {D_ {mc "Staged for removal"}}
1670 {DO {mc "Staged for removal, still present"}}
1671
1672 + {_U {mc "Requires merge resolution"}}
1673 {U_ {mc "Requires merge resolution"}}
1674 {UU {mc "Requires merge resolution"}}
1675 {UM {mc "Requires merge resolution"}}
1676 {UD {mc "Requires merge resolution"}}
1677 + {UT {mc "Requires merge resolution"}}
1678 } {
1679 set text [eval [lindex $i 1]]
1680 if {$max_status_desc < [string length $text]} {
@@ -1843,7 +1845,7 @@ proc toggle_or_diff {w x y} {
1845 # Do not stage files with conflicts
1846 if {[info exists file_states($path)]} {
1847 set state [lindex $file_states($path) 0]
1846 - if {[string index $state 0] eq {U}} {
1848 + if {[string first {U} $state] >= 0} {
1849 set col 1
1850 }
1851 }
@@ -2814,7 +2816,7 @@ proc popup_diff_menu {ctxm ctxmmg x y X Y} {
2816 } else {
2817 set state {__}
2818 }
2817 - if {[string index $state 0] eq {U}} {
2819 + if {[string first {U} $state] >= 0} {
2820 tk_popup $ctxmmg $X $Y
2821 } else {
2822 if {$::ui_index eq $::current_diff_side} {
lib/commit.tcl
+1
@@ -151,6 +151,7 @@ The rescan will be automatically started now.
151 D? -
152 T_ -
153 M? {set files_ready 1}
154 + _U -
155 U? {
156 error_popup [mc "Unmerged files cannot be committed.
157
lib/diff.tcl
+1 -1
@@ -166,7 +166,7 @@ proc show_diff {path w {lno {}} {scroll_pos {}}} {
166 lappend cmd diff-index
167 lappend cmd --cached
168 } elseif {$w eq $ui_workdir} {
169 - if {[string index $m 0] eq {U}} {
169 + if {[string first {U} $m] >= 0} {
170 lappend cmd diff
171 } else {
172 lappend cmd diff-files
lib/index.tcl
+1
@@ -164,6 +164,7 @@ proc write_update_index {fd pathList totalCnt batch after} {
164 _O -
165 AM {set new A_}
166 _T {set new T_}
167 + _U -
168 U? {
169 if {[file exists $path]} {
170 set new M_