##// END OF EJS Templates
repository: define manifest interfaces...
repository: define manifest interfaces The long march towards declaring interfaces for repository primitives continues. This commit essentially defines interfaces based on the following types: * manifest.manifestdict -> imanifestdict * manifest.manifestlog -> imanifestlog * manifest.memmanifestctx -> imanifestrevisionwritable * manifest.manifestctx -> imanifestrevisionstored * manifest.memtreemanifestctx -> imanifestrevisionwritable * manifest.treemanifestctx -> imanifestrevisionstored * util.dirs -> idirs The interfaces are thoroughly documented. Their documentation is now better than the documentation in manifest.py in many cases. With the exception of util.dirs, classes have been annotated with their interfaces. (I didn't feel like util.dirs needed the proper interface treatment.) Tests have been added demonstrating that all classes and instances conform to their interfaces. This work was much easier than filelogs. That's because Durham did an excellent job formalizing the manifest API a while back. There are still some minor kludges with the interfaces that should probably be addressed. But the primary goal with interface declarations is getting something established. Once we have an interface, we can modify it later easily enough. Differential Revision: https://phab.mercurial-scm.org/D3869

File last commit:

r36787:3fff6f30 default
r38549:c82ea938 default
Show More
test-releasenotes-parsing.t
202 lines | 4.4 KiB | text/troff | Tads3Lexer
/ tests / test-releasenotes-parsing.t
Rishabh Madan
releasenotes: add similarity check function to compare incoming notes...
r33661 #require fuzzywuzzy
Gregory Szorc
releasenotes: command to manage release notes files...
r32778 $ cat >> $HGRCPATH << EOF
> [extensions]
> releasenotes=
> EOF
Bullet point with a single item spanning a single line
$ hg debugparsereleasenotes - << EOF
> New Features
> ============
>
> * Bullet point item with a single line
> EOF
section: feature
bullet point:
paragraph: Bullet point item with a single line
Bullet point that spans multiple lines.
$ hg debugparsereleasenotes - << EOF
> New Features
> ============
>
> * Bullet point with a paragraph
> that spans multiple lines.
> EOF
section: feature
bullet point:
paragraph: Bullet point with a paragraph that spans multiple lines.
$ hg debugparsereleasenotes - << EOF
> New Features
> ============
>
> * Bullet point with a paragraph
> that spans multiple lines.
>
> And has an empty line between lines too.
> With a line cuddling that.
> EOF
section: feature
bullet point:
paragraph: Bullet point with a paragraph that spans multiple lines.
paragraph: And has an empty line between lines too. With a line cuddling that.
Multiple bullet points. With some entries being multiple lines.
$ hg debugparsereleasenotes - << EOF
> New Features
> ============
>
> * First bullet point. It has a single line.
>
> * Second bullet point.
> It consists of multiple lines.
>
> * Third bullet point. It has a single line.
> EOF
section: feature
bullet point:
paragraph: First bullet point. It has a single line.
Rishabh Madan
releasenotes: improve parsing around bullet points...
r33012 bullet point:
Gregory Szorc
releasenotes: command to manage release notes files...
r32778 paragraph: Second bullet point. It consists of multiple lines.
Rishabh Madan
releasenotes: improve parsing around bullet points...
r33012 bullet point:
Gregory Szorc
releasenotes: command to manage release notes files...
r32778 paragraph: Third bullet point. It has a single line.
Bullet point without newline between items
$ hg debugparsereleasenotes - << EOF
> New Features
> ============
>
> * First bullet point
> * Second bullet point
> And it has multiple lines
> * Third bullet point
> * Fourth bullet point
> EOF
section: feature
bullet point:
paragraph: First bullet point
Rishabh Madan
releasenotes: improve parsing around bullet points...
r33012 bullet point:
Gregory Szorc
releasenotes: command to manage release notes files...
r32778 paragraph: Second bullet point And it has multiple lines
Rishabh Madan
releasenotes: improve parsing around bullet points...
r33012 bullet point:
Gregory Szorc
releasenotes: command to manage release notes files...
r32778 paragraph: Third bullet point
Rishabh Madan
releasenotes: improve parsing around bullet points...
r33012 bullet point:
Gregory Szorc
releasenotes: command to manage release notes files...
r32778 paragraph: Fourth bullet point
Sub-section contents are read
$ hg debugparsereleasenotes - << EOF
> New Features
> ============
>
> First Feature
> -------------
>
> This is the first new feature that was implemented.
>
> And a second paragraph about it.
>
> Second Feature
> --------------
>
> This is the second new feature that was implemented.
>
> Paragraph two.
>
> Paragraph three.
> EOF
section: feature
subsection: First Feature
paragraph: This is the first new feature that was implemented.
paragraph: And a second paragraph about it.
subsection: Second Feature
paragraph: This is the second new feature that was implemented.
paragraph: Paragraph two.
paragraph: Paragraph three.
Multiple sections are read
$ hg debugparsereleasenotes - << EOF
> New Features
> ============
>
> * Feature 1
> * Feature 2
>
> Bug Fixes
> =========
>
> * Fix 1
> * Fix 2
> EOF
section: feature
bullet point:
paragraph: Feature 1
Rishabh Madan
releasenotes: improve parsing around bullet points...
r33012 bullet point:
Gregory Szorc
releasenotes: command to manage release notes files...
r32778 paragraph: Feature 2
section: fix
bullet point:
paragraph: Fix 1
Rishabh Madan
releasenotes: improve parsing around bullet points...
r33012 bullet point:
Gregory Szorc
releasenotes: command to manage release notes files...
r32778 paragraph: Fix 2
Mixed sub-sections and bullet list
$ hg debugparsereleasenotes - << EOF
> New Features
> ============
>
> Feature 1
> ---------
>
> Some words about the first feature.
>
> Feature 2
> ---------
>
> Some words about the second feature.
> That span multiple lines.
>
> Other Changes
> -------------
>
> * Bullet item 1
> * Bullet item 2
> EOF
section: feature
subsection: Feature 1
paragraph: Some words about the first feature.
subsection: Feature 2
paragraph: Some words about the second feature. That span multiple lines.
bullet point:
paragraph: Bullet item 1
Rishabh Madan
releasenotes: improve parsing around bullet points...
r33012 bullet point:
Gregory Szorc
releasenotes: command to manage release notes files...
r32778 paragraph: Bullet item 2
Rishabh Madan
releasenotes: replace abort with warning while parsing (issue5775)...
r36786
Warn user in case of unexpected block while parsing
$ hg init relnotes-warn
$ cd relnotes-warn
$ touch feature1
$ hg -q commit -A -l - << EOF
> commit 1
>
> .. feature::
>
> new feature added.
> some words about the feature.
> EOF
$ hg releasenote -r .
Rishabh Madan
releasenotes: mention changeset with warning and abort...
r36787 changeset a4251905c440: unexpected block in release notes directive feature
Rishabh Madan
releasenotes: replace abort with warning while parsing (issue5775)...
r36786 New Features
============
* new feature added. some words about the feature.
$ cd ..