Commit Graph

17 Commits

Author SHA1 Message Date
Pulkit Goyal
e280703a0a py3: handle keyword arguments in hgext/releasenotes.py
Differential Revision: https://phab.mercurial-scm.org/D1322
2017-10-23 00:05:04 +05:30
Pulkit Goyal
1bfd3143f8 releasenotes: show a warning if fuzzywuzzy is not present
Differential Revision: https://phab.mercurial-scm.org/D1121
2017-10-16 22:46:37 +05:30
Pulkit Goyal
d81e686da1 releasenotes: move import of fuzzywuzzy to import level
This will help us in determining easily that whether fuzzywuzzy is loaded or not
loaded in any of the function.

Differential Revision: https://phab.mercurial-scm.org/D1120
2017-10-16 22:46:11 +05:30
Pulkit Goyal
3a436dc987 releasenotes: don't abort is there is a bad formatted entry for releasenotes
While producing releasenotes for (4.3::), releasenotes aborts with error because
of some bad formatting of releasenotes in some commits. Instead of aborting,
this adds warning message which will help us in skipping them and telling user
about it.

Differential Revision: https://phab.mercurial-scm.org/D1097
2017-10-15 20:31:44 +05:30
Pulkit Goyal
4e63354533 releasenotes: make the import of fuzzywuzzy optional
If fuzzywuzzy is note present, we will not be having the capability to merge
existing releasenotes with the new releasenotes on the similarity basis.
The merging will still work good for exact same releasenotes entries.

Differential Revision: https://phab.mercurial-scm.org/D1096
2017-10-15 20:29:16 +05:30
Pulkit Goyal
5cbb2943df releasenotes: fix documentation of similaritycheck()
The function document says that it returns true when the fragment can be merged,
but if you see the function just above it which is similar(), it writes already
exists thing if return value from similaritycheck() is False which is just
opposite of the doc. This patch fixes that.

Differential Revision: https://phab.mercurial-scm.org/D1119
2017-10-16 22:19:02 +05:30
Pulkit Goyal
6845c752e9 releasenotes: add pager support when printing to the ui
Differential Revision: https://phab.mercurial-scm.org/D1098
2017-10-15 20:32:10 +05:30
Rishabh Madan
1fad4ceba7 releasenotes: display release notes when no filename is specified
If the filename is not specified while using --rev, the notes for the specified
revs will just be displayed on screen.

Differential Revision: https://phab.mercurial-scm.org/D877
2017-10-01 14:37:50 +01:00
Rishabh Madan
96bdfe0f46 releasenotes: update docstrings with information on additional flags
This patch adds documentation related to the two new flags --check and
--list for releasenotes extension.

Differential Revision: https://phab.mercurial-scm.org/D544
2017-08-29 00:21:25 +05:30
Rishabh Madan
91787f1c2b releasenotes: raise error on simultaneous usage of flags
The releasenotes command is supposed to raise an error when --list and
--rev/--check flags are used together. This patch adds the above functionality.

Differential Revision: https://phab.mercurial-scm.org/D831
2017-09-28 13:22:58 +05:30
Rishabh Madan
f35bfd559f releasenotes: view admonition titles using -l flag
Since this extension is fairly new for almost all the contributors, remembering
the admonition (with titles) is difficult. The list (-l) flag provides
a list of all the active admonitions along with titles.

For usage, hg releasenotes -l returns the list.

Differential Revision: https://phab.mercurial-scm.org/D454
2017-08-28 04:11:58 +05:30
Rishabh Madan
973eda14de releasenotes: add check flag for use of admonitions and its validity
While using releasenotes extension, we will be using admonitions in commit messages.
The check (-c) flag will look for an admonition within the message. If it exists, it will
verify if it is stated under default or custom admonition. The check fails if the
admonition is not present in any of them. It also suggests similar admonitions
in case the admonition is invalid.

Differential Revision: https://phab.mercurial-scm.org/D368
2017-08-13 19:58:45 +05:30
Rishabh Madan
4829d3de30 releasenotes: minor bug fix for index error while serializing
Differential Revision: https://phab.mercurial-scm.org/D356
2017-08-12 09:21:42 +05:30
Rishabh Madan
0c4fe49845 releasenotes: add similarity check function to compare incoming notes
It is possible that the incoming note fragments have some similar content as the
existing release notes. In case of a bug fix, we match for issueNNNN in the
existing notes. For other general cases, it makes use of fuzzywuzzy library to get
a similarity score. If the score is above a certain threshold, we ignore the
fragment, otherwise add it. But the score might be misleading for small commit
messages. So, it uses similarity function only if the length of string (in words)
is above a certain value. The patch adds tests related to its usage. But it needs
improvement in the sense of combining incoming notes. We can use interactive mode
for adding notes. Maybe we can do this if similarity is under a certain range.
2017-08-05 05:25:36 +05:30
Rishabh Madan
923d0c8971 releasenotes: add custom admonitions support for release notes
By default, the extension has default sections like fix, feature, perf etc.. This
patch allow user to add support for custom admonition. In order to add a custom
admonition, one needs to have a .hgreleasenotes file inside the repository. All the
custom directive with name specified under the tag [sections] will be
usable by the extension. One important thing to keep in mind is if there exists any
custom admonitions with same key as default then they will override the default ones.
2017-07-18 23:04:08 +05:30
Rishabh Madan
f74a00edef releasenotes: improve parsing around bullet points
Earlier, on parsing the bullet points from existing release notes the bullet
points after the first one weren't written correctly to the notes file. This
patch makes changes to parsereleasenotesfromfile() function that introduces a new
bullet_points data structure that tracks the bullets and associated subparagraph.
It also makes necessary changes to the tests related to merging of bullets.
2017-06-23 17:15:53 +02:00
Gregory Szorc
f086e3d59e releasenotes: command to manage release notes files
Per discussion on the mailing list, we want better release notes
for Mercurial.

This patch introduces an extension that provides a command for
producing release notes files. Functionality is implemented
as an extension because it could be useful outside of the
Mercurial project and because there is some code (like rst
parsing) that already exists in Mercurial and it doesn't make
sense to reinvent the wheel.

The general idea with the extension is that changeset authors
declare release notes in commit messages using rst directives.
Periodically (such as at publishing or release time), a project
maintainer runs `hg releasenotes` to extract release notes
fragments from commit messages and format them to an auto-generated
release notes file. More details are explained inline in docstrings.

There are several things that need addressed before this is ready
for prime time:

* Moar tests
* Interactive merge mode
* Implement similarity detection for individual notes items
* Support customizing section names/titles
* Parsing improvements for bullet lists and paragraphs
* Document which rst primitives can be parsed
* Retain arbitrary content (e.g. header section/paragraphs)
  from existing release notes file
* Better error messages (line numbers, hints, etc)
2017-06-02 23:33:30 +02:00