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 @@ -435,42 +435,25 @@ abort: cannot use both '--list' and '--check' [255] -Raise error when no filename is specified with --rev +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 . - ** unknown exception encountered, please report by visiting - ** https://mercurial-scm.org/wiki/BugTracker - ** Python 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609] - ** Mercurial Distributed SCM (version 4.3.3+701-c4594d38b2da+20171001) - ** Extensions loaded: releasenotes - Traceback (most recent call last): - File "/tmp/hgtests.5N93rp/install/bin/hg", line 47, in - dispatch.run() - File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 81, in run - status = (dispatch(req) or 0) & 255 - File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 163, in dispatch - ret = _runcatch(req) - File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 303, in _runcatch - return _callcatch(ui, _runcatchfunc) - File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 311, in _callcatch - return scmutil.callcatch(ui, func) - File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/scmutil.py", line 151, in callcatch - return func() - File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 293, in _runcatchfunc - return _dispatch(req) - File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 929, in _dispatch - cmdpats, cmdoptions) - File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 691, in runcommand - ret = _runcommand(ui, options, cmd, d) - File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 937, in _runcommand - return cmdfunc() - File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 926, in - d = lambda: util.checksignature(func)(ui, *args, **strcmdopt) - File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/util.py", line 1180, in check - return func(*args, **kwargs) - File "/tmp/hgtests.5N93rp/install/lib/python/hgext/releasenotes.py", line 580, in releasenotes - with open(file_, 'rb') as fh: - TypeError: coercing to Unicode: need string or buffer, NoneType found - [1] + Bug Fixes + ========= + + Title of First Fix + ------------------ + + First paragraph of fix 1.