X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=dgit;h=548a25bddf7badb5a8390ef2374450535e43f581;hb=045ec681a42fd823280cdec86a177309ddd741f0;hp=102864cf1a326bec0261158301f38e7b625986a0;hpb=3e228ac23b8b7351a7de2957de1f42fb894bb1f5;p=dgit.git diff --git a/dgit b/dgit index 102864cf..548a25bd 100755 --- a/dgit +++ b/dgit @@ -40,7 +40,7 @@ use Debian::Dgit; our $our_version = 'UNRELEASED'; ###substituted### -our @rpushprotovsn_support = qw(3 2); # 4 is new tag format +our @rpushprotovsn_support = qw(4 3 2); # 4 is new tag format our $protovsn; our $isuite = 'unstable'; @@ -141,6 +141,12 @@ sub debiantag ($$) { return $tagformatfn->($v, $distro); } +sub debiantag_maintview ($$) { + my ($v,$distro) = @_; + $v =~ y/~:/_%/; + return "$distro/$v"; +} + sub lbranch () { return "$branchprefix/$csuite"; } my $lbranch_re = '^refs/heads/'.$branchprefix.'/([^/.]+)$'; sub lref () { return "refs/heads/".lbranch(); } @@ -245,9 +251,10 @@ sub quiltmode_splitbrain () { # > file changes # [etc] # -# > param head HEAD +# > param head DGIT-VIEW-HEAD # > param csuite SUITE # > param tagformat old|new +# > param maint-view MAINT-VIEW-HEAD # # > previously REFNAME=OBJNAME # if --deliberately-not-fast-forward # # goes into tag, for replay prevention @@ -1956,8 +1963,8 @@ sub push_parse_dsc ($$$) { " but debian/changelog is for $package $cversion"; } -sub push_tagwants ($$$) { - my ($cversion, $dgithead, $tfbase) = @_; +sub push_tagwants ($$$$) { + my ($cversion, $dgithead, $maintviewhead, $tfbase) = @_; my @tagwants; push @tagwants, { TagFn => \&debiantag, @@ -1965,6 +1972,14 @@ sub push_tagwants ($$$) { TfSuffix => '', View => 'dgit', }; + if (defined $maintviewhead) { + push @tagwants, { + TagFn => \&debiantag_maintview, + Objid => $maintviewhead, + TfSuffix => '-maintview', + View => 'maint', + }; + } foreach my $tw (@tagwants) { $tw->{Tag} = $tw->{TagFn}($cversion, access_basedistro); $tw->{Tfn} = sub { $tfbase.$tw->{TfSuffix}.$_[0]; }; @@ -2011,13 +2026,24 @@ type commit tag $tag tagger $authline +END + if ($tw->{View} eq 'dgit') { + print TO <{View} eq 'maint') { + print TO <= 4; + responder_send_command("param maint-view $maintviewhead"); + } if (deliberately_not_fast_forward) { git_for_each_ref(lrfetchrefs, sub { @@ -2168,7 +2202,7 @@ END }); } - my @tagwants = push_tagwants($cversion, $dgithead, + my @tagwants = push_tagwants($cversion, $dgithead, $maintviewhead, ".git/dgit/tag"); my @tagobjfns; @@ -2212,6 +2246,8 @@ END my @pushrefs = $forceflag."HEAD:".rrref(); foreach my $tw (@tagwants) { + my $view = $tw->{View}; + next unless $view eq 'dgit'; push @pushrefs, $forceflag."refs/tags/$tw->{Tag}"; } @@ -2506,6 +2542,11 @@ sub cmd_rpush { ($protovsn) = initiator_expect { m/^dgit-remote-push-ready (\S+)/ }; 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 { @@ -2611,6 +2652,9 @@ sub i_want_signed_tag { my $head = $i_param{'head'}; die if $head =~ m/[^0-9a-f]/ || $head !~ m/^../; + my $maintview = $i_param{'maint-view'}; + die if defined $maintview && $maintview =~ m/[^0-9a-f]/; + select_tagformat(); if ($protovsn >= 4) { my $p = $i_param{'tagformat'} // ''; @@ -2622,7 +2666,7 @@ sub i_want_signed_tag { $csuite = $&; push_parse_dsc $i_dscfn, 'remote dsc', $i_version; - my @tagwants = push_tagwants $i_version, $head, "tag"; + my @tagwants = push_tagwants $i_version, $head, $maintview, "tag"; return push_mktags $i_clogp, $i_dscfn,