summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2017-01-09 16:07:15 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2017-01-09 16:07:15 +0000
commit65c5679375e4c1b05bb621624bc9686cab422561 (patch)
treec75e93a4e4f8823cdcbf2116314de7c9e409ee4d /dgit
parent1837d3b05b891491c548a4a3b869f5ed24239886 (diff)
dgit: $isuite handling: Defer calls to access_* until first `want'
pushing, rpush_handle_protovsn_bothends, and quiltmode, all depend on access_*. For that we need $isuite, but we only get that (in the form of $csuite) from the build host. We can move all of these calls into i_resp_want, which is called the first time the build host actually wants something from us. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit17
1 files changed, 11 insertions, 6 deletions
diff --git a/dgit b/dgit
index 11f473c..f677562 100755
--- a/dgit
+++ b/dgit
@@ -4440,7 +4440,6 @@ sub i_method {
}
sub cmd_rpush {
- pushing();
my $host = nextarg;
my $dir;
if ($host =~ m/^((?:[^][]|\[[^][]*\])*)\:/) {
@@ -4475,11 +4474,6 @@ sub cmd_rpush {
die "$protovsn ?" unless grep { $_ eq $protovsn } @rpushprotovsn_support;
$supplementary_message = '' unless $protovsn >= 3;
- fail "rpush negotiated protocol version $protovsn".
- " which does not support quilt mode $quilt_mode"
- if quiltmode_splitbrain;
-
- rpush_handle_protovsn_bothends();
for (;;) {
my ($icmd,$iargs) = initiator_expect {
m/^(\S+)(?: (.*))?$/;
@@ -4543,6 +4537,17 @@ our %i_wanted;
sub i_resp_want ($) {
my ($keyword) = @_;
die "$keyword ?" if $i_wanted{$keyword}++;
+
+ defined $i_param{'csuite'} or badproto \*RO, "premature desire, no csuite";
+ $isuite = $i_param{'csuite'};
+
+ pushing();
+ rpush_handle_protovsn_bothends();
+
+ fail "rpush negotiated protocol version $protovsn".
+ " which does not support quilt mode $quilt_mode"
+ if quiltmode_splitbrain;
+
my @localpaths = i_method "i_want", $keyword;
printdebug "[[ $keyword @localpaths\n";
foreach my $localpath (@localpaths) {