X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-gui%2Flib%2Fmergetool.tcl;h=6ab5701d937b9a719570907e745609b60d1d56a8;hb=81b84bcbe3cc6a29a62fb1a69c68764ad6c0feeb;hp=79c58bc7bc8c79a13acd1370b184a530d67eaa20;hpb=11bd3ddb913afd9665e7e822ea54be4fc8d2d5ea;p=git.git diff --git a/git-gui/lib/mergetool.tcl b/git-gui/lib/mergetool.tcl index 79c58bc7b..6ab5701d9 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