# HG changeset patch # User Anton Shestakov # Date 1548138145 -28800 # Node ID 530d211ae9a8ab3b6616ad9793e3a745ca60a8fa # Parent 549f956ba2a9b9cda3f56ed80583bf1f975cad2e relnotes: more improvements diff -r 549f956ba2a9 -r 530d211ae9a8 contrib/relnotes --- a/contrib/relnotes Sat Feb 02 15:26:51 2019 +0900 +++ b/contrib/relnotes Tue Jan 22 14:22:25 2019 +0800 @@ -14,6 +14,7 @@ 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 @@ 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 @@ # 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 @@ 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 @@ (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 @@ 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 = [] diff -r 549f956ba2a9 -r 530d211ae9a8 tests/test-contrib-relnotes.t --- a/tests/test-contrib-relnotes.t Sat Feb 02 15:26:51 2019 +0900 +++ b/tests/test-contrib-relnotes.t Tue Jan 22 14:22:25 2019 +0800 @@ -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