Patchwork [PoC] relnotes: various tweaks for release notes (PoC)

login
register
mail settings
Submitter Anton Shestakov
Date Oct. 19, 2018, 2:25 p.m.
Message ID <a9decc4cc129f53082c5.1539959135@neuro>
Download mbox | patch
Permalink /patch/36174/
State New
Headers show

Comments

Anton Shestakov - Oct. 19, 2018, 2:25 p.m.
# HG changeset patch
# User Anton Shestakov <av6@dwimlabs.net>
# Date 1539958193 -28800
#      Fri Oct 19 22:09:53 2018 +0800
# Node ID a9decc4cc129f53082c5bc4b1bc3597cf2ab167f
# Parent  a9838dfc27b81bc3618b187c172d55e102b4faa8
# EXP-Topic stream-obsmarkers
relnotes: various tweaks for release notes (PoC)

This is a rough version of what I'm planning to use to post release notes for
4.8rc0 when it gets released (but if someone beats me to it: use this patch).

Stop filtering out commits that are expected to be covered by releasenotes
extension: now we want two lists, one for WhatsNew and one for ReleaseX.Y.

Exclude starting revision. When 4.7.2 was released, its section on WhatsNew
page included one fix from 4.7.1 because it was the last commit included in
that release (IOW it was tagged 4.7.1).

AFAIU nargs=1 is not needed, and it was making args.startrev and args.stoprev
be lists.

Also just skip BC and API sections if there are no such items.
Augie Fackler - Oct. 23, 2018, 2:53 p.m.
This looks like a huge improvement. When you're ready, please feel encouraged to send a patch for me to check-in.

Thanks for improving our release notes! It's been on my "we should fix that" list for so long I mostly forgot.


> On Oct 19, 2018, at 10:25, Anton Shestakov <av6@dwimlabs.net> wrote:
> 
> # HG changeset patch
> # User Anton Shestakov <av6@dwimlabs.net>
> # Date 1539958193 -28800
> #      Fri Oct 19 22:09:53 2018 +0800
> # Node ID a9decc4cc129f53082c5bc4b1bc3597cf2ab167f
> # Parent  a9838dfc27b81bc3618b187c172d55e102b4faa8
> # EXP-Topic stream-obsmarkers
> relnotes: various tweaks for release notes (PoC)
> 
> This is a rough version of what I'm planning to use to post release notes for
> 4.8rc0 when it gets released (but if someone beats me to it: use this patch).
> 
> Stop filtering out commits that are expected to be covered by releasenotes
> extension: now we want two lists, one for WhatsNew and one for ReleaseX.Y.
> 
> Exclude starting revision. When 4.7.2 was released, its section on WhatsNew
> page included one fix from 4.7.1 because it was the last commit included in
> that release (IOW it was tagged 4.7.1).
> 
> AFAIU nargs=1 is not needed, and it was making args.startrev and args.stoprev
> be lists.
> 
> Also just skip BC and API sections if there are no such items.
> 
> diff --git a/contrib/relnotes b/contrib/relnotes
> --- a/contrib/relnotes
> +++ b/contrib/relnotes
> @@ -9,11 +9,6 @@ import argparse
> import re
> import subprocess
> 
> -# Regenerate this list with
> -#   hg export 'grep("\.\. [a-z]+::")' | grep '^\.\.' | \
> -#     sed 's/.. //;s/::.*//' | sort -u
> -rnsections = ["api", "bc", "container", "feature", "fix", "note", "perf"]
> -
> rules = {
>     # keep
>     r"\(issue": 100,
> @@ -88,7 +83,6 @@ def main():
>         "startrev",
>         metavar="REV",
>         type=str,
> -        nargs=1,
>         help=(
>             "Starting revision for the release notes. This revision "
>             "won't be included, but later revisions will."
> @@ -99,7 +93,6 @@ def main():
>         metavar="REV",
>         type=str,
>         default="@",
> -        nargs=1,
>         help=(
>             "Stop revision for release notes. This revision will be included,"
>             " but no later revisions will. This revision needs to be "
> @@ -114,7 +107,7 @@ def main():
>             "extensions.releasenotes=",
>             "releasenotes",
>             "-r",
> -            "%s::%s" % (args.startrev[0], args.stoprev[0]),
> +            "%s::%s - %s" % (args.startrev, args.stoprev, args.startrev),
>         ]
>     ).decode("utf-8")
>     # Find all release notes from un-relnotes-flagged commits.
> @@ -124,8 +117,8 @@ def main():
>                 "hg",
>                 "log",
>                 "-r",
> -                r'%s::%s - merge() - grep("\n\.\. (%s)::")'
> -                % (args.startrev[0], args.stoprev[0], "|".join(rnsections)),
> +                r'%s::%s - merge() - %s'
> +                % (args.startrev, args.stoprev, args.startrev),
>                 "-T",
>                 r"{desc|firstline}\n",
>             ]
> @@ -167,12 +160,14 @@ def main():
>         for d in sorted(groups[g]):
>             print(" * %s" % d)
> 
> -    print("\n=== BC ===\n")
> +    if bcs:
> +        print("\n=== BC ===\n")
> 
>     for d in sorted(bcs):
>         print(" * %s" % d)
> 
> -    print("\n=== API Changes ===\n")
> +    if apis:
> +        print("\n=== API Changes ===\n")
> 
>     for d in sorted(apis):
>         print(" * %s" % d)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/contrib/relnotes b/contrib/relnotes
--- a/contrib/relnotes
+++ b/contrib/relnotes
@@ -9,11 +9,6 @@  import argparse
 import re
 import subprocess
 
-# Regenerate this list with
-#   hg export 'grep("\.\. [a-z]+::")' | grep '^\.\.' | \
-#     sed 's/.. //;s/::.*//' | sort -u
-rnsections = ["api", "bc", "container", "feature", "fix", "note", "perf"]
-
 rules = {
     # keep
     r"\(issue": 100,
@@ -88,7 +83,6 @@  def main():
         "startrev",
         metavar="REV",
         type=str,
-        nargs=1,
         help=(
             "Starting revision for the release notes. This revision "
             "won't be included, but later revisions will."
@@ -99,7 +93,6 @@  def main():
         metavar="REV",
         type=str,
         default="@",
-        nargs=1,
         help=(
             "Stop revision for release notes. This revision will be included,"
             " but no later revisions will. This revision needs to be "
@@ -114,7 +107,7 @@  def main():
             "extensions.releasenotes=",
             "releasenotes",
             "-r",
-            "%s::%s" % (args.startrev[0], args.stoprev[0]),
+            "%s::%s - %s" % (args.startrev, args.stoprev, args.startrev),
         ]
     ).decode("utf-8")
     # Find all release notes from un-relnotes-flagged commits.
@@ -124,8 +117,8 @@  def main():
                 "hg",
                 "log",
                 "-r",
-                r'%s::%s - merge() - grep("\n\.\. (%s)::")'
-                % (args.startrev[0], args.stoprev[0], "|".join(rnsections)),
+                r'%s::%s - merge() - %s'
+                % (args.startrev, args.stoprev, args.startrev),
                 "-T",
                 r"{desc|firstline}\n",
             ]
@@ -167,12 +160,14 @@  def main():
         for d in sorted(groups[g]):
             print(" * %s" % d)
 
-    print("\n=== BC ===\n")
+    if bcs:
+        print("\n=== BC ===\n")
 
     for d in sorted(bcs):
         print(" * %s" % d)
 
-    print("\n=== API Changes ===\n")
+    if apis:
+        print("\n=== API Changes ===\n")
 
     for d in sorted(apis):
         print(" * %s" % d)