Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions changed.d
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -359,7 +360,8 @@ 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)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not:

"nightly", { releaseType = "NIGHTLY_"; },
"beta", { releaseType = "BETA_"; },

"prev-version", &previousVersion, // this can automatically be detected
"no-text", &hideTextChanges);

Expand All @@ -384,17 +386,20 @@ 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");
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);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why append the underscore to the releaseType separately, instead of putting the underscore in the format string? Did you mean to make the releaseType including underscore optional?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why tie the name of a command-line switch to the name of a DDoc template?


scope(exit) w.put(")\n");

Expand All @@ -419,19 +424,14 @@ 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");
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt that anyone cared about this and this simplifies the generation.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand how this really simplifies generation, and I think saying "list of things in $VERSION" when $VERSION hasn't been released yet is a little bit worse?

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");

// print the detailed descriptions
changedRepos.each!(x => x.changes.writeTextChangesBody(w, x.headline));

if (revRange.length)
if (revRange.empty)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Err, did you mean to negate this?

w.put("$(BR)$(BIG $(LNAME2 bugfix-list, List of all bug fixes and enhancements in D $(VER):))\n\n");
}
else
Expand Down