chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Infra: Allow FRESHREPO to override "tag already exists"
[dgit.git]
/
infra
/
dgit-repos-server
diff --git
a/infra/dgit-repos-server
b/infra/dgit-repos-server
index 7ab29e278f0058a3b56dca65c3567e4fe592b5ca..e2bec01e810b1dc512a2e7851a66934ae466282d 100755
(executable)
--- a/
infra/dgit-repos-server
+++ b/
infra/dgit-repos-server
@@
-447,6
+447,8
@@
sub main__git_receive_pack () {
our ($tagname, $tagval, $suite, $oldcommit, $commit);
our ($version, %tagh);
our ($tagname, $tagval, $suite, $oldcommit, $commit);
our ($version, %tagh);
+our ($tagexists_error);
+
sub readupdates () {
printdebug " updates ...\n";
while (<STDIN>) {
sub readupdates () {
printdebug " updates ...\n";
while (<STDIN>) {
@@
-458,7
+460,7
@@
sub readupdates () {
reject "pushing multiple tags!" if defined $tagname;
$tagname = $'; #';
$tagval = $sha1;
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/}) {
" not replacing previously-pushed version"
if $old =~ m/[^0]/;
} elsif ($refname =~ m{^refs/dgit/}) {
@@
-738,7
+740,7
@@
sub checktagnoreplay () {
my ($tagobjid,$refobjid,$fullrefname,$tagname) = @_;
$check_ref_superseded->($tagobjid,undef,$fullrefname,undef);
});
my ($tagobjid,$refobjid,$fullrefname,$tagname) = @_;
$check_ref_superseded->($tagobjid,undef,$fullrefname,undef);
});
- printdebug "checktagnoreply - not FRESHREPO, nchecked=$nchecked";
+ printdebug "checktagnorepl
a
y - not FRESHREPO, nchecked=$nchecked";
push @problems, "does not supersede any tag".
" referring to branch head $branch=$branchhead"
unless $nchecked;
push @problems, "does not supersede any tag".
" referring to branch head $branch=$branchhead"
unless $nchecked;
@@
-751,7
+753,7
@@
sub checktagnoreplay () {
join("; ", @problems).
"\n";
}
join("; ", @problems).
"\n";
}
- printdebug "checktagnorepl
y - all ok
\n"
+ printdebug "checktagnorepl
ay - all ok ($tagval)
\n"
}
sub tagh1 ($) {
}
sub tagh1 ($) {
@@
-781,6
+783,14
@@
sub checks () {
join(",",@deliberatelies));
$policy = policyhook(NOFFCHECK|FRESHREPO, 'push', @policy_args);
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();
checktagnoreplay();
checksuite();