our ($tagname, $tagval, $suite, $oldcommit, $commit);
our ($version, %tagh);
+our ($tagexists_error);
+
sub readupdates () {
printdebug " updates ...\n";
while (<STDIN>) {
reject "pushing multiple tags!" if defined $tagname;
$tagname = $'; #';
$tagval = $sha1;
- reject "tag $tagname already exists -".
+ $tagexists_error= "tag $tagname already exists -".
" not replacing previously-pushed version"
if $old =~ m/[^0]/;
} elsif ($refname =~ m{^refs/dgit/}) {
my ($tagobjid,$refobjid,$fullrefname,$tagname) = @_;
$check_ref_superseded->($tagobjid,undef,$fullrefname,undef);
});
- printdebug "checktagnoreply - not FRESHREPO, nchecked=$nchecked";
+ printdebug "checktagnoreplay - not FRESHREPO, nchecked=$nchecked";
push @problems, "does not supersede any tag".
" referring to branch head $branch=$branchhead"
unless $nchecked;
join("; ", @problems).
"\n";
}
- printdebug "checktagnoreply - all ok\n"
+ printdebug "checktagnoreplay - all ok ($tagval)\n"
}
sub tagh1 ($) {
join(",",@deliberatelies));
$policy = policyhook(NOFFCHECK|FRESHREPO, 'push', @policy_args);
+ if (defined $tagexists_error) {
+ if ($policy & FRESHREPO) {
+ printdebug "ignoring tagexists_error: $tagexists_error\n";
+ } else {
+ reject $tagexists_error;
+ }
+ }
+
checktagnoreplay();
checksuite();