summaryrefslogtreecommitdiff
path: root/git-gui/lib/mergetool.tcl
diff options
context:
space:
mode:
authorLibravatar Shawn O. Pearce <spearce@spearce.org>2008-09-25 08:41:07 -0700
committerLibravatar Shawn O. Pearce <spearce@spearce.org>2008-09-25 08:41:07 -0700
commit1500f7bc1366e71edb7e8a31f3cf5614e9591cc2 (patch)
tree350805ff81d52e8c3a0eb0c8d71ae78662969664 /git-gui/lib/mergetool.tcl
parentMerge branch 'maint' (diff)
parentgit-gui: Reenable staging unmerged files by clicking the icon. (diff)
downloadtgif-1500f7bc1366e71edb7e8a31f3cf5614e9591cc2.tar.xz
Merge git://repo.or.cz/git-gui
* git://repo.or.cz/git-gui: git-gui: Reenable staging unmerged files by clicking the icon. git-gui: Support the encoding menu in gui blame. git-gui: Optimize encoding name resolution using a lookup table. git-gui: Allow forcing display encoding for diffs using a submenu. git-gui: Add a menu of available encodings. git-gui: Cleanup handling of the default encoding. git-gui: Assume `blame --incremental` output is in UTF-8 git-gui: Use gitattribute "encoding" for file content display git-gui: Add support for calling out to the prepare-commit-msg hook git-gui: Hide commit related UI during citool --nocommit git-gui: Add more integration options to citool. git-gui: Updated German translation. git-gui: I18n fix sentence parts into full sentences for translation again. git-gui: Restore ability to Stage Working Copy for conflicts. git-gui: Fix Blame Parent & Context for working copy lines.
Diffstat (limited to 'git-gui/lib/mergetool.tcl')
-rw-r--r--git-gui/lib/mergetool.tcl39
1 files changed, 33 insertions, 6 deletions
diff --git a/git-gui/lib/mergetool.tcl b/git-gui/lib/mergetool.tcl
index 79c58bc7bc..6ab5701d93 100644
--- a/git-gui/lib/mergetool.tcl
+++ b/git-gui/lib/mergetool.tcl
@@ -5,24 +5,51 @@ proc merge_resolve_one {stage} {
global current_diff_path
switch -- $stage {
- 1 { set target [mc "the base version"] }
- 2 { set target [mc "this branch"] }
- 3 { set target [mc "the other branch"] }
+ 1 { set targetquestion [mc "Force resolution to the base version?"] }
+ 2 { set targetquestion [mc "Force resolution to this branch?"] }
+ 3 { set targetquestion [mc "Force resolution to the other branch?"] }
}
- set op_question [mc "Force resolution to %s?
-Note that the diff shows only conflicting changes.
+ set op_question [strcat $targetquestion "\n" \
+[mc "Note that the diff shows only conflicting changes.
%s will be overwritten.
This operation can be undone only by restarting the merge." \
- $target [short_path $current_diff_path]]
+ [short_path $current_diff_path]]]
if {[ask_popup $op_question] eq {yes}} {
merge_load_stages $current_diff_path [list merge_force_stage $stage]
}
}
+proc merge_stage_workdir {path w lno} {
+ global current_diff_path diff_active
+
+ if {$diff_active} return
+
+ if {$path ne $current_diff_path} {
+ show_diff $path $w $lno {} [list do_merge_stage_workdir $path]
+ } else {
+ do_merge_stage_workdir $path
+ }
+}
+
+proc do_merge_stage_workdir {path} {
+ global current_diff_path is_conflict_diff
+
+ if {$path ne $current_diff_path} return;
+
+ if {$is_conflict_diff} {
+ if {[ask_popup [mc "File %s seems to have unresolved conflicts, still stage?" \
+ [short_path $path]]] ne {yes}} {
+ return
+ }
+ }
+
+ merge_add_resolution $path
+}
+
proc merge_add_resolution {path} {
global current_diff_path ui_workdir