chiark / gitweb /
dgit: Drop $protovsn < 4; part of tidying up after tag format
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 28 Jun 2019 11:09:20 +0000 (12:09 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 28 Jun 2019 15:01:33 +0000 (16:01 +0100)
This drops support for rpush where our peer is older than dgit 2.0.
(This does not include the dgit in any Debian release.)

No nontrivial functional change, since we already rejected older dgits
due to them implying the old tag format.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit

diff --git a/dgit b/dgit
index 46a7ffc7f21257c513ce1af51aa21acca1cc2394..e179e3608abe1621aec27573fda68115e298574a 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -53,7 +53,7 @@ use Debian::Dgit;
 our $our_version = 'UNRELEASED'; ###substituted###
 our $absurdity = undef; ###substituted###
 
-our @rpushprotovsn_support = qw(4 3 2); # 4 is new tag format
+our @rpushprotovsn_support = qw(4); # 4 is new tag format
 our $protovsn;
 
 our $cmd;
@@ -445,7 +445,7 @@ sub branch_is_gdr ($) {
 #  > progress NBYTES
 #  [NBYTES message]
 #
-#  > supplementary-message NBYTES          # $protovsn >= 3
+#  > supplementary-message NBYTES
 #  [NBYTES message]
 #
 # main sequence:
@@ -975,7 +975,7 @@ sub supplementary_message ($) {
     if (!$we_are_responder) {
        $supplementary_message = $msg;
        return;
-    } elsif ($protovsn >= 3) {
+    } else {
        responder_send_command "supplementary-message ".length($msg)
            or confess "$!";
        print PO $msg or confess "$!";
@@ -4634,8 +4634,6 @@ ENDT
     responder_send_command("param isuite $isuite");
     responder_send_command("param tagformat new");
     if (defined $maintviewhead) {
-       confess "internal error (protovsn=$protovsn)"
-           if defined $protovsn and $protovsn < 4;
        responder_send_command("param maint-view $maintviewhead");
     }
 
@@ -5005,9 +5003,6 @@ sub cmd_remote_push_responder { cmd_remote_push_build_host(); }
 #     a good error message)
 
 sub rpush_handle_protovsn_bothends () {
-    if ($protovsn < 4) {
-       fail "negotiated protocol version $protovsn but need at least 4";
-    }
 }
 
 our $i_tmp;
@@ -5075,7 +5070,6 @@ sub cmd_rpush {
     changedir $i_tmp;
     ($protovsn) = initiator_expect { m/^dgit-remote-push-ready (\S+)/ };
     die "$protovsn ?" unless grep { $_ eq $protovsn } @rpushprotovsn_support;
-    $supplementary_message = '' unless $protovsn >= 3;
 
     for (;;) {
        my ($icmd,$iargs) = initiator_expect {
@@ -5148,11 +5142,6 @@ sub i_resp_want ($) {
     pushing();
     rpush_handle_protovsn_bothends();
 
-    fail f_ "rpush negotiated protocol version %s".
-       " which does not support quilt mode %s",
-       $protovsn, $quilt_mode
-       if quiltmode_splitbrain && $protovsn < 4;
-
     my @localpaths = i_method "i_want", $keyword;
     printdebug "[[  $keyword @localpaths\n";
     foreach my $localpath (@localpaths) {