chiark / gitweb /
dgit-repos-server: Prepare for modes which take arguments
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 1fa1f529561f3e45d871eb4bf3116e6ef2842a9a..6926c3883a9c9c187b5994ad4258859c45463891 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -4363,7 +4363,6 @@ sub push_mktags ($$ $$ $) {
     # We make the git tag by hand because (a) that makes it easier
     # to control the "tagger" (b) we can do remote signing
     my $authline = clogp_authline $clogp;
-    my @dtxinfo = @deliberatelies;
 
     my $mktag = sub {
        my ($tw) = @_;
@@ -4379,27 +4378,31 @@ tag $tag
 tagger $authline
 
 END
+
+       my @dtxinfo = @deliberatelies;
+       unshift @dtxinfo, "--quilt=$quilt_mode" if madformat($format);
+       unshift @dtxinfo, do_split_brain() ? "split" : "no-split"
+           # rpush protocol 5 and earlier don't tell us
+           unless $we_are_initiator && $protovsn < 6;
+       my $dtxinfo = join(" ", "",@dtxinfo);
+       my $tag_metadata = <<END;
+[dgit distro=$declaredistro$dtxinfo]
+END
+       foreach my $ref (sort keys %previously) {
+           $tag_metadata .= <<END or confess "$!";
+[dgit previously:$ref=$previously{$ref}]
+END
+       }
+
        if ($tw->{View} eq 'dgit') {
            print TO f_ <<ENDT, $package, $cversion, $clogsuite, $csuite
 %s release %s for %s (%s) [dgit]
 ENDT
                or confess "$!";
-           unshift @dtxinfo, "--quilt=$quilt_mode" if madformat($format);
-           unshift @dtxinfo, do_split_brain() ? "split" : "no-split"
-               # rpush protocol 5 and earlier don't tell us
-               unless $we_are_initiator && $protovsn < 6;
-           my $dtxinfo = join(" ", "",@dtxinfo);
-           print TO <<END or confess "$!";
-[dgit distro=$declaredistro$dtxinfo]
-END
-           foreach my $ref (sort keys %previously) {
-               print TO <<END or confess "$!";
-[dgit previously:$ref=$previously{$ref}]
-END
-           }
        } elsif ($tw->{View} eq 'maint') {
            print TO f_ <<END, $package, $cversion, $clogsuite, $csuite,
 %s release %s for %s (%s)
+
 (maintainer view tag generated by dgit --quilt=%s)
 END
                $quilt_mode
@@ -4407,6 +4410,7 @@ END
        } else {
            confess Dumper($tw)."?";
        }
+       print TO "\n", $tag_metadata;
 
        close TO or confess "$!";