summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2016-12-15 00:54:21 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2016-12-19 16:58:57 +0000
commita99b94f7071fb3d3db2d679af5a736627ef10102 (patch)
tree7558abe2dd5764bf7ba7035ad8545768a2d7e5b9
parent2d8ed57a73f0b8cc4ca31e60f85b24d4f6437075 (diff)
By default, generate a DEP-14 tag as well as a dgit archive/* tag
Even in non-split-view quilt modes. Closes:#844129. This breaks one of the test suite test cases, so disable it there. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rw-r--r--debian/changelog2
-rwxr-xr-xdgit35
-rw-r--r--dgit.120
-rwxr-xr-xtests/tests/trustingpolicy-replay2
4 files changed, 58 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index 91f52da..bb5db14 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -15,6 +15,8 @@ dgit (2.12~) unstable; urgency=medium
instead. Closes:#844570.
* Suppress some leftover debugging output from import-dsc.
Closes:#847658.
+ * By default, generate a DEP-14 tag as well as a dgit archive/*
+ tag, even in non-split-view quilt modes. Closes:#844129.
Test suite:
* Provide and use stunt lintian and debuild, to avoid lintian
diff --git a/dgit b/dgit
index 1a23d1a..7996227 100755
--- a/dgit
+++ b/dgit
@@ -69,6 +69,8 @@ our $rmchanges;
our $overwrite_version; # undef: not specified; '': check changelog
our $quilt_mode;
our $quilt_modes_re = 'linear|smash|auto|nofix|nocheck|gbp|dpm|unapplied';
+our $dodep14tag;
+our $dodep14tag_re = 'want|no|always';
our $split_brain_save;
our $we_are_responder;
our $initiator_tempdir;
@@ -3674,7 +3676,21 @@ sub push_tagwants ($$$$) {
TfSuffix => '-maintview',
View => 'maint',
};
- }
+ } elsif ($dodep14tag eq 'no' ? 0
+ : $dodep14tag eq 'want' ? access_cfg_tagformats_can_splitbrain
+ : $dodep14tag eq 'always'
+ ? (access_cfg_tagformats_can_splitbrain or fail <<END)
+--dep14tag-always (or equivalent in config) means server must support
+ both "new" and "maint" tag formats, but config says it doesn't.
+END
+ : die "$dodep14tag ?") {
+ push @tagwants, {
+ TagFn => \&debiantag_maintview,
+ Objid => $dgithead,
+ TfSuffix => '-dgit',
+ View => 'dgit',
+ };
+ };
foreach my $tw (@tagwants) {
$tw->{Tag} = $tw->{TagFn}($cversion, access_nomdistro);
$tw->{Tfn} = sub { $tfbase.$tw->{TfSuffix}.$_[0]; };
@@ -6095,6 +6111,15 @@ sub parseopts () {
} elsif (m/^--overwrite=(.+)$/s) {
push @ropts, $_;
$overwrite_version = $1;
+ } elsif (m/^--dep14tag$/s) {
+ push @ropts, $_;
+ $dodep14tag= 'want';
+ } elsif (m/^--no-dep14tag$/s) {
+ push @ropts, $_;
+ $dodep14tag= 'no';
+ } elsif (m/^--always-dep14tag$/s) {
+ push @ropts, $_;
+ $dodep14tag= 'always';
} elsif (m/^--delayed=(\d+)$/s) {
push @ropts, $_;
push @dput, $_;
@@ -6279,6 +6304,14 @@ if (!defined $quilt_mode) {
$quilt_mode = $1;
}
+if (!defined $dodep14tag) {
+ local $access_forpush;
+ $dodep14tag = access_cfg('dep14tag', 'RETURN-UNDEF') // 'want';
+ $dodep14tag =~ m/^($dodep14tag_re)$/
+ or badcfg "unknown dep14tag setting \`$dodep14tag'";
+ $dodep14tag = $1;
+}
+
$need_split_build_invocation ||= quiltmode_splitbrain();
if (!defined $cleanmode) {
diff --git a/dgit.1 b/dgit.1
index 33d24a9..63a7021 100644
--- a/dgit.1
+++ b/dgit.1
@@ -665,6 +665,24 @@ By default, dgit looks in the parent directory
.BI --no-rm-on-error
Do not delete the destination directory if clone fails.
.TP
+.BI --dep14tag
+Generates a DEP-14 tag (eg
+.BR debian/ \fIversion\fR)
+as well as a dgit tag (eg
+.BR archive/debian/ \fIversion\fR)
+where possible. This is the default.
+.TP
+.BI --no-dep14tag
+Do not generate a DEP-14 tag, except in split quilt view mode.
+(On servers where only the old tag format is supported,
+the dgit tag will have the DEP-14 name.
+This option does not prevent that.)
+.TP
+.BI --dep14tag-always
+Insist on generating a DEP-14 tag
+as well as a dgit tag.
+If the server does not support that, dgit push will fail.
+.TP
.BI -D
Prints debugging information to stderr. Repeating the option produces
more output (currently, up to -DDDD is meaningfully different).
@@ -999,6 +1017,8 @@ or when pushing and
.TP
.BI dgit-distro. distro .dgit-tag-format
.TP
+.BR dgit-distro. \fIdistro\fR .dep14tag " " want | no | always
+.TP
.BI dgit-distro. distro .ssh
.TP
.BI dgit-distro. distro .sshpsql-dbname
diff --git a/tests/tests/trustingpolicy-replay b/tests/tests/trustingpolicy-replay
index 8cc205c..2039ec6 100755
--- a/tests/tests/trustingpolicy-replay
+++ b/tests/tests/trustingpolicy-replay
@@ -4,6 +4,8 @@ set -e
t-tstunt-parsechangelog
+t-git-config dgit.default.dep14tag no
+
t-dsd
t-policy dgit-repos-policy-trusting
t-prep-newpackage example 1.0