D877: releasenotes: display release notes when no filename is specified
rishabhmadan96 (Rishabh Madan)
phabricator at mercurial-scm.org
Sun Oct 1 13:48:13 UTC 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG159a6f7e09a9: releasenotes: display release notes when no filename is specified (authored by rishabhmadan96, committed by ).
CHANGED PRIOR TO COMMIT
https://phab.mercurial-scm.org/D877?vs=2263&id=2289#toc
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D877?vs=2263&id=2289
REVISION DETAIL
https://phab.mercurial-scm.org/D877
AFFECTED FILES
hgext/releasenotes.py
tests/test-releasenotes-formatting.t
CHANGE DETAILS
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.
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())
To: rishabhmadan96, #hg-reviewers, pulkit, yuja
Cc: pulkit, mercurial-devel
More information about the Mercurial-devel
mailing list