# HG changeset patch # User Rishabh Madan # Date 1506865070 -3600 # Node ID 159a6f7e09a94b62f3ca018e944458e3442470a3 # Parent 407ebe7a9b934204408adcfe3aa338bcfd4d03e9 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 diff -r 407ebe7a9b93 -r 159a6f7e09a9 hgext/releasenotes.py --- a/hgext/releasenotes.py Sun Oct 01 12:29:33 2017 +0100 +++ b/hgext/releasenotes.py Sun Oct 01 14:37:50 2017 +0100 @@ -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 -r 407ebe7a9b93 -r 159a6f7e09a9 tests/test-releasenotes-formatting.t --- a/tests/test-releasenotes-formatting.t Sun Oct 01 12:29:33 2017 +0100 +++ b/tests/test-releasenotes-formatting.t Sun Oct 01 14:37:50 2017 +0100 @@ -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.