chiark / gitweb /
Split tags: Push the maintainer view tag, where supported
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 31 Jul 2016 17:49:55 +0000 (18:49 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 5 Sep 2016 12:41:48 +0000 (13:41 +0100)
We introduce a new `maint' possibility in to the dgit-tag-format
access cfg list, presence of which indicates that the receiver is
content to receive DEP-14-style maintainer-view (ie, non-dgit0 tags.

For now, we default this to true.  However, repos handled by
dgit-repos-server cannot currently cope with this, because:
 * dgit-repos-server currently tries to be compatible with old
   dgits which send DEP-14-named dgit tags;
 * dgit-repos-server doesn't currently permit the creation of
   `extraneous' (ie, non-dgit) tags and branches.

So for Debian, we do not set this flag.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
TODO.BRANCH
dgit
tests/lib

index 7138c3b541e6f47093e50bfdfe56613713e7541c..745147689aa14f16c6b745ae6c7570ed22f8e4b0 100644 (file)
@@ -20,6 +20,8 @@ Want tests for
    old tag
  - rejecting push of same version with one tag when then the other
 
+That, where appropriate, maint view tags are pushed to dgit git repo
+
 ----------
 
 Provide --gpbpq[=:] options
diff --git a/dgit b/dgit
index 548a25bddf7badb5a8390ef2374450535e43f581..288fc78deabf983970c5a3be740e9032deb834ef 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -34,6 +34,7 @@ use POSIX;
 use IPC::Open2;
 use Digest::SHA;
 use Digest::MD5;
+use List::Util qw(any);
 use List::MoreUtils qw(pairwise);
 
 use Debian::Dgit;
@@ -513,7 +514,7 @@ our %defcfg = ('dgit.default.distro' => 'debian',
               'dgit.default.ssh' => 'ssh',
               'dgit.default.archive-query' => 'madison:',
               'dgit.default.sshpsql-dbname' => 'service=projectb',
-              'dgit.default.dgit-tag-format' => 'old,new',
+              'dgit.default.dgit-tag-format' => 'old,new,maint',
               'dgit-distro.debian.archive-query' => 'ftpmasterapi:',
               'dgit-distro.debian.git-check' => 'url',
               'dgit-distro.debian.git-check-suffix' => '/info/refs',
@@ -1161,7 +1162,7 @@ sub select_tagformat () {
     die 'bug' if $tagformatfn && $tagformat_want;
     # ... $tagformat_want assigned after previous select_tagformat
 
-    my (@supported) = access_cfg_tagformats();
+    my (@supported) = grep { $_ ne 'maint' } access_cfg_tagformats();
     printdebug "select_tagformat supported @supported\n";
 
     $tagformat_want //= [ $supported[0], "distro access configuration", 0 ];
@@ -2247,7 +2248,8 @@ END
     my @pushrefs = $forceflag."HEAD:".rrref();
     foreach my $tw (@tagwants) {
        my $view = $tw->{View};
-       next unless $view eq 'dgit';
+       next unless $view eq 'dgit'
+           or any { $_ eq $view } access_cfg_tagformats();
        push @pushrefs, $forceflag."refs/tags/$tw->{Tag}";
     }
 
index f1ffa8b11563219b2f3082a591fca04ed4d16c9c..bd83be70a69d930a54af356a763c4ad2071718e0 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -594,6 +594,7 @@ t-drs () {
  t-git-config dgit-distro.test-dummy.git-url "ext::$troot/drs-git-ext %S "
  t-git-config dgit-distro.test-dummy.git-check true
  t-git-config dgit-distro.test-dummy.git-create true
+ t-git-config dgit-distro.test-dummy.dgit-tag-format old,new
        cp $troot/gnupg/{dd.gpg,dm.gpg,dm.txt} $tmp/.
        cp $troot/suites $tmp/.
        cp $troot/suites $tmp/suites-master