releasenotes: mention changeset with warning and abort
authorRishabh Madan <rishabhmadan96@gmail.com>
Sun, 04 Mar 2018 00:15:35 +0530
changeset 36769 3fff6f30bd7f
parent 36768 658ed9c7442b
child 36770 a5891e94bfe1
releasenotes: mention changeset with warning and abort Output the changeset hash with the warning/abort message just to know where things messed up. Differential Revision: https://phab.mercurial-scm.org/D2253
hgext/releasenotes.py
tests/test-releasenotes-parsing.t
--- a/hgext/releasenotes.py	Sat Mar 03 23:47:22 2018 +0530
+++ b/hgext/releasenotes.py	Sun Mar 04 00:15:35 2018 +0530
@@ -311,8 +311,8 @@
             title = block['lines'][0].strip() if block['lines'] else None
 
             if i + 1 == len(blocks):
-                raise error.Abort(_('release notes directive %s lacks content')
-                                  % directive)
+                raise error.Abort(_('changeset %s: release notes directive %s '
+                        'lacks content') % (ctx, directive))
 
             # Now search ahead and find all paragraphs attached to this
             # admonition.
@@ -325,8 +325,8 @@
                     continue
 
                 if pblock['type'] != 'paragraph':
-                    repo.ui.warn(_('unexpected block in release notes '
-                                        'directive %s\n') % directive)
+                    repo.ui.warn(_('changeset %s: unexpected block in release '
+                        'notes directive %s\n') % (ctx, directive))
 
                 if pblock['indent'] > 0:
                     paragraphs.append(pblock['lines'])
--- a/tests/test-releasenotes-parsing.t	Sat Mar 03 23:47:22 2018 +0530
+++ b/tests/test-releasenotes-parsing.t	Sun Mar 04 00:15:35 2018 +0530
@@ -193,7 +193,7 @@
   > EOF
 
   $ hg releasenote -r .
-  unexpected block in release notes directive feature
+  changeset a4251905c440: unexpected block in release notes directive feature
   New Features
   ============