diff --git a/hgext/releasenotes.py b/hgext/releasenotes.py --- a/hgext/releasenotes.py +++ b/hgext/releasenotes.py @@ -576,6 +576,9 @@ incoming = parsenotesfromrevisions(repo, sections.names(), revs) + if file_ is None: + return ui.write(serializenotes(sections, incoming)) + try: with open(file_, 'rb') as fh: notes = parsereleasenotesfile(sections, fh.read()) diff --git a/tests/test-releasenotes-formatting.t b/tests/test-releasenotes-formatting.t --- a/tests/test-releasenotes-formatting.t +++ b/tests/test-releasenotes-formatting.t @@ -434,3 +434,26 @@ $ hg releasenotes -l -c abort: cannot use both '--list' and '--check' [255] + +Display release notes for specified revs if no file is mentioned + + $ hg init relnotes-nofile + $ cd relnotes-nofile + + $ touch fix1 + $ hg -q commit -A -l - << EOF + > commit 1 + > + > .. fix:: Title of First Fix + > + > First paragraph of fix 1. + > EOF + + $ hg releasenote -r . + Bug Fixes + ========= + + Title of First Fix + ------------------ + + First paragraph of fix 1.