Patchwork D1097: releasenotes: don't abort is there is a bad formatted entry for releasenotes

login
register
mail settings
Submitter phabricator
Date Oct. 15, 2017, 3:15 p.m.
Message ID <differential-rev-PHID-DREV-notb4adxl2sy26cnh6hl-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/24954/
State Superseded
Headers show

Comments

phabricator - Oct. 15, 2017, 3:15 p.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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 status message which will help us in skipping them and telling user
  about it.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1097

AFFECTED FILES
  hgext/releasenotes.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel
phabricator - Oct. 16, 2017, 1:07 p.m.
yuja requested changes to this revision.
yuja added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> releasenotes.py:327
>              if not paragraphs:
> -                raise error.Abort(_('could not find content for release note '
> -                                    '%s') % directive)
> -
> +                repo.ui.status(_("error parsing releasenotes for revision: "
> +                                 "'%s'\n") % node.hex(ctx.node()))

warn() seems better.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1097

To: pulkit, #hg-reviewers, yuja
Cc: yuja, mercurial-devel

Patch

diff --git a/hgext/releasenotes.py b/hgext/releasenotes.py
--- a/hgext/releasenotes.py
+++ b/hgext/releasenotes.py
@@ -24,6 +24,7 @@ 
     config,
     error,
     minirst,
+    node,
     registrar,
     scmutil,
     util,
@@ -323,9 +324,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.status(_("error parsing releasenotes for revision: "
+                                 "'%s'\n") % node.hex(ctx.node()))
             if title:
                 notes.addtitleditem(directive, title, paragraphs)
             else: