summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2019-07-05 16:11:43 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2019-07-05 16:28:43 +0100
commit2193c15cf92d4765da004a310bf684b61718eedf (patch)
tree0ebc61b7cc72f6d9a28add024f5895dff5968d80 /dgit
parent5986b06eef2f0132f9eda164939e74558301988b (diff)
dgit: rpush protocol version 6: Include splitbrain param
And, in the push responder, check that we agree. No overall functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit11
1 files changed, 10 insertions, 1 deletions
diff --git a/dgit b/dgit
index 43d2286..e9b2cd5 100755
--- a/dgit
+++ b/dgit
@@ -53,7 +53,7 @@ use Debian::Dgit;
our $our_version = 'UNRELEASED'; ###substituted###
our $absurdity = undef; ###substituted###
-our @rpushprotovsn_support = qw(5 4); # Reverse order!
+our @rpushprotovsn_support = qw(6 5 4); # Reverse order!
our $protovsn;
our $cmd;
@@ -473,6 +473,7 @@ sub branch_is_gdr ($) {
# > param head DGIT-VIEW-HEAD
# > param csuite SUITE
# > param tagformat new # $protovsn == 4
+# > param splitbrain 0|1 # $protovsn >= 6
# > param maint-view MAINT-VIEW-HEAD
#
# > param buildinfo-filename P_V_X.buildinfo # zero or more times
@@ -4681,6 +4682,7 @@ ENDT
responder_send_command("param csuite $csuite");
responder_send_command("param isuite $isuite");
responder_send_command("param tagformat new"); # needed in $protovsn==4
+ responder_send_command("param splitbrain $do_split_brain");
if (defined $maintviewhead) {
responder_send_command("param maint-view $maintviewhead");
}
@@ -5193,6 +5195,13 @@ sub i_resp_want ($) {
pushing();
rpush_handle_protovsn_bothends();
push_parse_dsc $i_dscfn, 'remote dsc', $i_version;
+ if ($protovsn >= 6) {
+ determine_whether_split_brain getfield $dsc, 'Format';
+ $do_split_brain eq ($i_param{'splitbrain'} // '<unsent>')
+ or badproto \*RO,
+ "split brain mismatch, $do_split_brain != $i_param{'split_brain'}";
+ printdebug "rpush split brain $do_split_brain\n";
+ }
}
my @localpaths = i_method "i_want", $keyword;