git-gui: convert new/amend commit radiobutton to checkbutton
[gitweb.git] / lib / merge.tcl
index cc26b0780882b6e8bde122c2a724d110f439d84f..9f253db5b37e5633c19914248a58a3f2feb3c512 100644 (file)
@@ -40,6 +40,7 @@ The rescan will be automatically started now.
                _O {
                        continue; # and pray it works!
                }
+               _U -
                U? {
                        error_popup [mc "You are in the middle of a conflicted merge.
 
@@ -82,6 +83,7 @@ method _visualize {} {
 
 method _start {} {
        global HEAD current_branch remote_url
+       global _last_merged_branch
 
        set name [_rev $this]
        if {$name eq {}} {
@@ -108,13 +110,18 @@ 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
-       lappend cmd --strategy=recursive
-       lappend cmd [git fmt-merge-msg <[gitdir FETCH_HEAD]]
-       lappend cmd HEAD
-       lappend cmd $name
+       if {[git-version >= "2.5.0"]} {
+               set cmd [list git merge --strategy=recursive FETCH_HEAD]
+       } else {
+               set cmd [list git]
+               lappend cmd merge
+               lappend cmd --strategy=recursive
+               lappend cmd [git fmt-merge-msg <[gitdir FETCH_HEAD]]
+               lappend cmd HEAD
+               lappend cmd $name
+       }
 
        ui_status [mc "Merging %s and %s..." $current_branch $stitle]
        set cons [console::new [mc "Merge"] "merge $stitle"]
@@ -138,36 +145,36 @@ method _finish {cons ok} {
 
 constructor dialog {} {
        global current_branch
-       global M1B
+       global M1B use_ttk NS
 
        if {![_can_merge $this]} {
                delete_this
                return
        }
 
-       make_toplevel top w
-       wm title $top [append "[appname] ([reponame]): " [mc "Merge"]]
+       make_dialog top w
+       wm title $top [mc "%s (%s): Merge" [appname] [reponame]]
        if {$top ne {.}} {
                wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
        }
 
        set _start [cb _start]
 
-       label $w.header \
+       ${NS}::label $w.header \
                -text [mc "Merge Into %s" $current_branch] \
                -font font_uibold
        pack $w.header -side top -fill x
 
-       frame $w.buttons
-       button $w.buttons.visualize \
+       ${NS}::frame $w.buttons
+       ${NS}::button $w.buttons.visualize \
                -text [mc Visualize] \
                -command [cb _visualize]
        pack $w.buttons.visualize -side left
-       button $w.buttons.merge \
+       ${NS}::button $w.buttons.merge \
                -text [mc Merge] \
                -command $_start
        pack $w.buttons.merge -side right
-       button $w.buttons.cancel \
+       ${NS}::button $w.buttons.cancel \
                -text [mc "Cancel"] \
                -command [cb _cancel]
        pack $w.buttons.cancel -side right -padx 5
@@ -257,6 +264,7 @@ proc _reset_wait {fd} {
 
                catch {file delete [gitdir MERGE_HEAD]}
                catch {file delete [gitdir rr-cache MERGE_RR]}
+               catch {file delete [gitdir MERGE_RR]}
                catch {file delete [gitdir SQUASH_MSG]}
                catch {file delete [gitdir MERGE_MSG]}
                catch {file delete [gitdir GITGUI_MSG]}