releasenotes: don't abort is there is a bad formatted entry for releasenotes
authorPulkit Goyal <7895pulkit@gmail.com>
Sun, 15 Oct 2017 20:31:44 +0530
changeset 34811 a542ad320adb
parent 34810 44bd29168d14
child 34812 bc2caa4b4480
releasenotes: don't abort is there is a bad formatted entry for releasenotes While producing releasenotes for (4.3::), releasenotes aborts with error because of some bad formatting of releasenotes in some commits. Instead of aborting, this adds warning message which will help us in skipping them and telling user about it. Differential Revision: https://phab.mercurial-scm.org/D1097
hgext/releasenotes.py
--- a/hgext/releasenotes.py	Sun Oct 15 20:29:16 2017 +0530
+++ b/hgext/releasenotes.py	Sun Oct 15 20:31:44 2017 +0530
@@ -24,6 +24,7 @@
     config,
     error,
     minirst,
+    node,
     registrar,
     scmutil,
     util,
@@ -325,9 +326,8 @@
 
             # TODO consider using title as paragraph for more concise notes.
             if not paragraphs:
-                raise error.Abort(_('could not find content for release note '
-                                    '%s') % directive)
-
+                repo.ui.warn(_("error parsing releasenotes for revision: "
+                               "'%s'\n") % node.hex(ctx.node()))
             if title:
                 notes.addtitleditem(directive, title, paragraphs)
             else: