]> asedeno.scripts.mit.edu Git - git.git/blobdiff - lib/remote_branch_delete.tcl
git-gui: Correct file_states when unstaging partly staged entry
[git.git] / lib / remote_branch_delete.tcl
index 06b5eabf91bda920c1ce382ce8ec970b0bdf4b0c..241642062e7d4b8ad267f10fc6123bab52dfc744 100644 (file)
@@ -26,12 +26,12 @@ constructor dialog {} {
        global all_remotes M1B
 
        make_toplevel top w
-       wm title $top [append "[appname] ([reponame]): " [mc "Delete Remote Branch"]]
+       wm title $top [append "[appname] ([reponame]): " [mc "Delete Branch Remotely"]]
        if {$top ne {.}} {
                wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
        }
 
-       label $w.header -text [mc "Delete Remote Branch"] -font font_uibold
+       label $w.header -text [mc "Delete Branch Remotely"] -font font_uibold
        pack $w.header -side top -fill x
 
        frame $w.buttons
@@ -63,7 +63,7 @@ constructor dialog {} {
                set urltype url
        }
        radiobutton $w.dest.url_r \
-               -text [mc "Arbitrary URL:"] \
+               -text [mc "Arbitrary Location:"] \
                -value url \
                -variable @urltype
        entry $w.dest.url_t \
@@ -181,9 +181,9 @@ method _delete {} {
        }
 
        if {$not_merged ne {}} {
-               set msg "The following branches are not completely merged into $check_head:
+               set msg [mc "The following branches are not completely merged into %s:
 
- - [join $not_merged "\n - "]"
+ - %s" $check_head [join $not_merged "\n - "]]
 
                if {$need_fetch} {
                        append msg "\n\n" [mc "One or more of the merge tests failed because you have not fetched the necessary commits.  Try fetching from %s first." $uri]
@@ -208,15 +208,15 @@ method _delete {} {
                return
        }
 
-       if {[tk_messageBox \
-               -icon warning \
-               -type yesno \
-               -title [wm title $w] \
-               -parent $w \
-               -message [mc "Recovering deleted branches is difficult.
-
-Delete the selected branches?"]] ne yes} {
-               return
+       if {$checktype ne {head}} {
+               if {[tk_messageBox \
+                       -icon warning \
+                       -type yesno \
+                       -title [wm title $w] \
+                       -parent $w \
+                       -message [mc "Recovering deleted branches is difficult.\n\nDelete the selected branches?"]] ne yes} {
+                       return
+               }
        }
 
        destroy $w
@@ -250,6 +250,8 @@ method _write_url        {args} { set urltype url    }
 method _write_check_head {args} { set checktype head }
 
 method _write_head_list {args} {
+       global current_branch
+
        $head_m delete 0 end
        foreach abr $head_list {
                $head_m insert end radiobutton \
@@ -258,7 +260,11 @@ method _write_head_list {args} {
                        -variable @check_head
        }
        if {[lsearch -exact -sorted $head_list $check_head] < 0} {
-               set check_head {}
+               if {[lsearch -exact -sorted $head_list $current_branch] < 0} {
+                       set check_head {}
+               } else {
+                       set check_head $current_branch
+               }
        }
 }