Patchwork relnotes: more improvements

login
register
mail settings
Submitter Anton Shestakov
Date Feb. 2, 2019, 2:35 a.m.
Message ID <b66fff9e37c56d874f8a.1549074955@neuro>
Download mbox | patch
Permalink /patch/38319/
State Accepted
Headers show

Comments

Anton Shestakov - Feb. 2, 2019, 2:35 a.m.
# HG changeset patch
# User Anton Shestakov <av6@dwimlabs.net>
# Date 1548138145 -28800
#      Tue Jan 22 14:22:25 2019 +0800
# Branch stable
# Node ID b66fff9e37c56d874f8aabcac4153e9b5a3e4148
# Parent  8b2892d5a9f2c06c998c977015a9ad3e3a3c9b5f
relnotes: more improvements
Pulkit Goyal - Feb. 2, 2019, 3:30 p.m.
On Sat, Feb 2, 2019 at 8:07 AM Anton Shestakov <av6@dwimlabs.net> wrote:

> # HG changeset patch
> # User Anton Shestakov <av6@dwimlabs.net>
> # Date 1548138145 -28800
> #      Tue Jan 22 14:22:25 2019 +0800
> # Branch stable
> # Node ID b66fff9e37c56d874f8aabcac4153e9b5a3e4148
> # Parent  8b2892d5a9f2c06c998c977015a9ad3e3a3c9b5f
> relnotes: more improvements
>

Queued this many thanks!
via Mercurial-devel - Feb. 3, 2019, 10:27 p.m.
test-contrib-relnotes.t fails as follows. Expected? Should we amend it in
in flight?

@@ -266,7 +266,6 @@
    * diff: disable diff.noprefix option for diffstat (Bts:issue5759)
    * evolution: make reporting of new unstable changesets optional
    * extdata: abort if external command exits with non-zero status (BC)
-   * fancyopts: add early-options parser compatible with getopt()
    * graphlog: add another graph node type, unstable, using character "*"
(BC)
    * hgdemandimport: use correct hyperlink to python-bug in comments
(Bts:issue5765)
    * httppeer: add support for tracing all http request made by the peer
@@ -277,17 +276,18 @@
    * morestatus: don't crash with different drive letters for repo.root
and CWD
    * outgoing: respect ":pushurl" paths (Bts:issue5365)
    * remove: print message for each file in verbose mode only while using
'-A' (BC)
-   * rewriteutil: use precheck() in uncommit and amend commands
    * scmutil: don't try to delete origbackup symlinks to directories
(Bts:issue5731)
    * sshpeer: add support for request tracing
    * subrepo: add config option to reject any subrepo operations (SEC)
    * subrepo: disable git and svn subrepos by default (BC) (SEC)
+   * subrepo: disallow symlink traversal across subrepo mount point (SEC)
    * subrepo: extend config option to disable subrepos by type (SEC)
    * subrepo: handle 'C:' style paths on the command line (Bts:issue5770)
    * subrepo: use per-type config options to enable subrepos
    * svnsubrepo: check if subrepo is missing when checking dirty state
(Bts:issue5657)
    * test-bookmarks-pushpull: stabilize for Windows
    * test-run-tests: stabilize the test (Bts:issue5735)
+   * tests: show symlink traversal across subrepo mount point (SEC)
    * tr-summary: keep a weakref to the unfiltered repository
    * unamend: fix command summary line
    * uncommit: unify functions _uncommitdirstate and _unamenddirstate to
one

On Sat, Feb 2, 2019 at 7:32 AM Pulkit Goyal <7895pulkit@gmail.com> wrote:

>
>
> On Sat, Feb 2, 2019 at 8:07 AM Anton Shestakov <av6@dwimlabs.net> wrote:
>
>> # HG changeset patch
>> # User Anton Shestakov <av6@dwimlabs.net>
>> # Date 1548138145 -28800
>> #      Tue Jan 22 14:22:25 2019 +0800
>> # Branch stable
>> # Node ID b66fff9e37c56d874f8aabcac4153e9b5a3e4148
>> # Parent  8b2892d5a9f2c06c998c977015a9ad3e3a3c9b5f
>> relnotes: more improvements
>>
>
> Queued this many thanks!
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
Anton Shestakov - Feb. 4, 2019, 3:41 a.m.
On Sun, 3 Feb 2019 14:27:22 -0800
Martin von Zweigbergk <martinvonz@google.com> wrote:

> test-contrib-relnotes.t fails as follows. Expected? Should we amend it in
> in flight?

Oops, yes. TIL there are python3-only tests.
via Mercurial-devel - Feb. 4, 2019, 4:57 a.m.
On Sun, Feb 3, 2019 at 7:41 PM Anton Shestakov <av6@dwimlabs.net> wrote:

> On Sun, 3 Feb 2019 14:27:22 -0800
> Martin von Zweigbergk <martinvonz@google.com> wrote:
>
> > test-contrib-relnotes.t fails as follows. Expected? Should we amend it in
> > in flight?
>
> Oops, yes. TIL there are python3-only tests.
>

Fixed in the hg-committed repo.

Patch

diff --git a/contrib/relnotes b/contrib/relnotes
--- a/contrib/relnotes
+++ b/contrib/relnotes
@@ -14,6 +14,7 @@  rules = {
     r"\(issue": 100,
     r"\(BC\)": 100,
     r"\(API\)": 100,
+    r"\(SEC\)": 100,
     # core commands, bump up
     r"(commit|files|log|pull|push|patch|status|tag|summary)(|s|es):": 20,
     r"(annotate|alias|branch|bookmark|clone|graft|import|verify).*:": 20,
@@ -21,6 +22,7 @@  rules = {
     r"(mq|shelve|rebase):": 20,
     # newsy
     r": deprecate": 20,
+    r": new.*(extension|flag|module)": 10,
     r"( ability|command|feature|option|support)": 10,
     # experimental
     r"hg-experimental": 20,
@@ -29,22 +31,23 @@  rules = {
     # bug-like?
     r"(fix|don't break|improve)": 7,
     r"(not|n't|avoid|fix|prevent).*crash": 10,
+    r"vulnerab": 10,
     # boring stuff, bump down
     r"^contrib": -5,
     r"debug": -5,
     r"help": -5,
+    r"minor": -5,
     r"(doc|metavar|bundle2|obsolete|obsmarker|rpm|setup|debug\S+:)": -15,
     r"(check-code|check-commit|check-config|import-checker)": -20,
     r"(flake8|lintian|pyflakes|pylint)": -20,
     # cleanups and refactoring
-    r"(cleanup|white ?space|spelling|quoting)": -20,
+    r"(clean ?up|white ?space|spelling|quoting)": -20,
     r"(flatten|dedent|indent|nesting|unnest)": -20,
     r"(typo|hint|note|comment|TODO|FIXME)": -20,
     r"(style:|convention|one-?liner)": -20,
-    r"_": -10,
     r"(argument|absolute_import|attribute|assignment|mutable)": -15,
     r"(scope|True|False)": -10,
-    r"(unused|useless|unnecessary|superfluous|duplicate|deprecated)": -10,
+    r"(unused|useless|unnecessar|superfluous|duplicate|deprecated)": -10,
     r"(redundant|pointless|confusing|uninitialized|meaningless|dead)": -10,
     r": (drop|remove|delete|rip out)": -10,
     r": (inherit|rename|simplify|naming|inline)": -10,
@@ -54,9 +57,12 @@  rules = {
     r": (move|extract) .* (to|into|from|out of)": -20,
     r": implement ": -5,
     r": use .* implementation": -20,
+    r": use .* instead of": -20,
+    # code
+    r"_": -10,
+    r"__": -5,
+    r"\(\)": -5,
     r"\S\S\S+\.\S\S\S\S+": -5,
-    r": use .* instead of": -20,
-    r"__": -5,
     # dumb keywords
     r"\S+/\S+:": -10,
     r"\S+\.\S+:": -10,
@@ -92,6 +98,15 @@  groupings = [
     (r"shelve|unshelve", "extensions"),
 ]
 
+def wikify(desc):
+    desc = desc.replace("(issue", "(Bts:issue")
+    desc = re.sub(r"\b([0-9a-f]{12})\b", r"Cset:\1", desc)
+    # stop ParseError from being recognized as a (nonexistent) wiki page
+    desc = re.sub(r" ([A-Z][a-z]+[A-Z][a-z]+)\b", r" !\1", desc)
+    # prevent wiki markup of magic methods
+    desc = re.sub(r"\b(\S*__\S*)\b", r"`\1`", desc)
+    return desc
+
 def main():
     desc = "example: %(prog)s 4.7.2 --stoprev 4.8rc0"
     ap = argparse.ArgumentParser(description=desc)
@@ -148,10 +163,8 @@  def main():
             if re.search(rule, desc):
                 score += val
 
-        desc = desc.replace("(issue", "(Bts:issue")
-
         if score >= cutoff:
-            commits.append(desc)
+            commits.append(wikify(desc))
     # Group unflagged notes.
     groups = {}
     bcs = []