Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add option to push --force-with-lease #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions lib/transport.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ proc push_to {remote} {

proc start_push_anywhere_action {w} {
global push_urltype push_remote push_url push_thin push_tags
global push_force
global push_force push_forcewithlease
global repo_config

set is_mirror 0
Expand All @@ -83,6 +83,9 @@ proc start_push_anywhere_action {w} {
if {$push_force} {
lappend cmd --force
}
if {$push_forcewithlease} {
lappend cmd --force-with-lease
}
if {$push_tags} {
lappend cmd --tags
}
Expand Down Expand Up @@ -120,7 +123,7 @@ trace add variable push_remote write \
proc do_push_anywhere {} {
global all_remotes current_branch
global push_urltype push_remote push_url push_thin push_tags
global push_force use_ttk NS
global push_force push_forcewithlease use_ttk NS

set w .push_setup
toplevel $w
Expand Down Expand Up @@ -207,6 +210,10 @@ proc do_push_anywhere {} {
-text [mc "Force overwrite existing branch (may discard changes)"] \
-variable push_force
grid $w.options.force -columnspan 2 -sticky w
${NS}::checkbutton $w.options.forcewithlease \
-text [mc "Force overwrite existing branch (if remote base is same as local base, '--force-with-lease')"] \
-variable push_forcewithlease
grid $w.options.forcewithlease -columnspan 2 -sticky w
${NS}::checkbutton $w.options.thin \
-text [mc "Use thin pack (for slow network connections)"] \
-variable push_thin
Expand All @@ -220,6 +227,7 @@ proc do_push_anywhere {} {

set push_url {}
set push_force 0
set push_forcewithlease 0
set push_thin 0
set push_tags 0

Expand Down