From f7bc31163bafc752eebea3fc175a5aeeff3f63d9 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Thu, 13 Jul 2017 10:34:05 +0200 Subject: [PATCH 1/3] Add --release-type to pick the main Ddoc template --- changed.d | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/changed.d b/changed.d index d93aff2aea..47f869fa2f 100755 --- a/changed.d +++ b/changed.d @@ -344,6 +344,7 @@ int main(string[] args) auto outputFile = "./changelog.dd"; auto nextVersionString = "LATEST"; bool useNightlyTemplate; + string releaseType = "stable"; auto currDate = Clock.currTime(); auto nextVersionDate = "%s %02d, %04d" @@ -360,6 +361,7 @@ int main(string[] args) "date", &nextVersionDate, "version", &nextVersionString, "nightly", &useNightlyTemplate, + "release-type", &releaseType, // e.g. beta or nightly (stable by default) "prev-version", &previousVersion, // this can automatically be detected "no-text", &hideTextChanges); @@ -390,11 +392,8 @@ Please supply a bugzilla version w.formattedWrite("$(CHANGELOG_NAV_LAST %s)\n\n", previousVersion); { - // NITGHLY_VERSION is a special ddoc macro with e.g. different download links - if (useNightlyTemplate) - w.formattedWrite("$(NIGHTLY_VERSION %s,\n,\n,", nextVersionDate); - else - w.formattedWrite("$(VERSION %s, =================================================,\n\n", nextVersionDate); + import std.uni : asUpperCase; + w.formattedWrite("$(%sVERSION %s, =================================================,\n\n", text(releaseType.asUpperCase, "_"), nextVersionDate); scope(exit) w.put(")\n"); From ea2f13eb0f8bd530ba0d6c911e4b937e5bff0fc7 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Thu, 13 Jul 2017 10:34:26 +0200 Subject: [PATCH 2/3] Deprecate --nightly --- changed.d | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/changed.d b/changed.d index 47f869fa2f..aed63e1497 100755 --- a/changed.d +++ b/changed.d @@ -360,7 +360,7 @@ int main(string[] args) "output|o", &outputFile, "date", &nextVersionDate, "version", &nextVersionString, - "nightly", &useNightlyTemplate, + "nightly", &useNightlyTemplate, // deprecated, use --version=nightly "release-type", &releaseType, // e.g. beta or nightly (stable by default) "prev-version", &previousVersion, // this can automatically be detected "no-text", &hideTextChanges); @@ -386,6 +386,12 @@ Please supply a bugzilla version writeln("Skipped querying Bugzilla for changes. Please define a revision range e.g ./changed v2.072.2..upstream/stable"); } + if (useNightlyTemplate) + { + stderr.writeln("--nightly is deprecated. Use --release-type=nightly instead."); + releaseType = "nightly"; + } + auto f = File(outputFile, "w"); auto w = f.lockingTextWriter(); w.put("Ddoc\n\n"); @@ -418,12 +424,7 @@ Please supply a bugzilla version changedRepos.each!(r => r.changes.writeTextChangesHeader(w, r.headline)); if (!revRange.empty) - { - if (useNightlyTemplate) - w.put("$(BR)$(BIG $(RELATIVE_LINK2 bugfix-list, List of all upcoming bug fixes and enhancements.))\n\n"); - else - w.put("$(BR)$(BIG $(RELATIVE_LINK2 bugfix-list, List of all bug fixes and enhancements in D $(VER).))\n\n"); - } + w.put("$(BR)$(BIG $(RELATIVE_LINK2 bugfix-list, List of all bug fixes and enhancements in D $(VER).))\n\n"); w.put("$(HR)\n\n"); From 5098cb491ed8b37cd2abf2bbb1ac905be6d3fdee Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Thu, 13 Jul 2017 10:35:05 +0200 Subject: [PATCH 3/3] change.d: small style fixes --- changed.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changed.d b/changed.d index aed63e1497..d28350cd1b 100755 --- a/changed.d +++ b/changed.d @@ -431,7 +431,7 @@ Please supply a bugzilla version // print the detailed descriptions changedRepos.each!(x => x.changes.writeTextChangesBody(w, x.headline)); - if (revRange.length) + if (revRange.empty) w.put("$(BR)$(BIG $(LNAME2 bugfix-list, List of all bug fixes and enhancements in D $(VER):))\n\n"); } else