comparison hgext/releasenotes.py @ 34811:a542ad320adb

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
author Pulkit Goyal <7895pulkit@gmail.com>
date Sun, 15 Oct 2017 20:31:44 +0530
parents 44bd29168d14
children bc2caa4b4480
comparison
equal deleted inserted replaced
34810:44bd29168d14 34811:a542ad320adb
22 from mercurial.i18n import _ 22 from mercurial.i18n import _
23 from mercurial import ( 23 from mercurial import (
24 config, 24 config,
25 error, 25 error,
26 minirst, 26 minirst,
27 node,
27 registrar, 28 registrar,
28 scmutil, 29 scmutil,
29 util, 30 util,
30 ) 31 )
31 32
323 else: 324 else:
324 break 325 break
325 326
326 # TODO consider using title as paragraph for more concise notes. 327 # TODO consider using title as paragraph for more concise notes.
327 if not paragraphs: 328 if not paragraphs:
328 raise error.Abort(_('could not find content for release note ' 329 repo.ui.warn(_("error parsing releasenotes for revision: "
329 '%s') % directive) 330 "'%s'\n") % node.hex(ctx.node()))
330
331 if title: 331 if title:
332 notes.addtitleditem(directive, title, paragraphs) 332 notes.addtitleditem(directive, title, paragraphs)
333 else: 333 else:
334 notes.addnontitleditem(directive, paragraphs) 334 notes.addnontitleditem(directive, paragraphs)
335 335