From b3cdbe8e96dc753610db4936385afa1de1aa39a6 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Tue, 18 Jun 2019 18:50:52 -0500 Subject: [PATCH] Allow --force --dry-run No reason for it not to work. Signed-off-by: Felipe Contreras --- git-remote-hg | 2 +- test/main.t | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/git-remote-hg b/git-remote-hg index 0fd487d..023bbb4 100755 --- a/git-remote-hg +++ b/git-remote-hg @@ -1243,7 +1243,7 @@ def do_export(parser): return if dry_run: - if peer and not force_push: + if peer: checkheads(parser.repo, peer, p_revs) print return diff --git a/test/main.t b/test/main.t index 700e4de..10456ee 100755 --- a/test/main.t +++ b/test/main.t @@ -760,6 +760,36 @@ test_expect_success 'remote big push dry-run' ' check_bookmark hgrepo new_bmark ' +test_expect_success 'remote big push force dry-run' ' + test_when_finished "rm -rf hgrepo gitrepo*" && + + setup_big_push + + ( + cd gitrepo && + + check_push 0 --force --dry-run --all <<-\EOF + master + good_bmark + branches/good_branch + new_bmark:new + branches/new_branch:new + bad_bmark1:forced-update + bad_bmark2:forced-update + branches/bad_branch:forced-update + EOF + ) && + + check_branch hgrepo default one && + check_branch hgrepo good_branch "good branch" && + check_branch hgrepo bad_branch "bad branch" && + check_branch hgrepo new_branch && + check_bookmark hgrepo good_bmark one && + check_bookmark hgrepo bad_bmark1 one && + check_bookmark hgrepo bad_bmark2 one && + check_bookmark hgrepo new_bmark +' + test_expect_success 'remote double failed push' ' test_when_finished "rm -rf hgrepo gitrepo*" &&