chiark / gitweb /
dgit: Move tag metadata calculation earlier
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 1fa1f529561f3e45d871eb4bf3116e6ef2842a9a..6bb1f488d6a01c8eee5cf130863dd7a8027f1faa 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,24 +4378,28 @@ 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
-           }
+           print TO $tag_metadata;
        } elsif ($tw->{View} eq 'maint') {
            print TO f_ <<END, $package, $cversion, $clogsuite, $csuite,
 %s release %s for %s (%s)