hgext/releasenotes.py
changeset 43117 8ff1ecfadcd1
parent 43105 649d3ac37a12
child 43898 023ad45e2fd2
equal deleted inserted replaced
43116:defabf63e969 43117:8ff1ecfadcd1
   298         if admonition:
   298         if admonition:
   299             if admonition.group(1) in directives:
   299             if admonition.group(1) in directives:
   300                 continue
   300                 continue
   301             else:
   301             else:
   302                 ui.write(
   302                 ui.write(
   303                     _(b"Invalid admonition '%s' present in changeset %s" b"\n")
   303                     _(b"Invalid admonition '%s' present in changeset %s\n")
   304                     % (admonition.group(1), ctx.hex()[:12])
   304                     % (admonition.group(1), ctx.hex()[:12])
   305                 )
   305                 )
   306                 sim = lambda x: difflib.SequenceMatcher(
   306                 sim = lambda x: difflib.SequenceMatcher(
   307                     None, admonition.group(1), x
   307                     None, admonition.group(1), x
   308                 ).ratio()
   308                 ).ratio()
   374                     break
   374                     break
   375 
   375 
   376             # TODO consider using title as paragraph for more concise notes.
   376             # TODO consider using title as paragraph for more concise notes.
   377             if not paragraphs:
   377             if not paragraphs:
   378                 repo.ui.warn(
   378                 repo.ui.warn(
   379                     _(b"error parsing releasenotes for revision: " b"'%s'\n")
   379                     _(b"error parsing releasenotes for revision: '%s'\n")
   380                     % node.hex(ctx.node())
   380                     % node.hex(ctx.node())
   381                 )
   381                 )
   382             if title:
   382             if title:
   383                 notes.addtitleditem(directive, title, paragraphs)
   383                 notes.addtitleditem(directive, title, paragraphs)
   384             else:
   384             else:
   420                             lines.append(block[b'lines'])
   420                             lines.append(block[b'lines'])
   421                     notefragment.append(lines)
   421                     notefragment.append(lines)
   422                     continue
   422                     continue
   423             elif block[b'type'] != b'paragraph':
   423             elif block[b'type'] != b'paragraph':
   424                 raise error.Abort(
   424                 raise error.Abort(
   425                     _(b'unexpected block type in release notes: ' b'%s')
   425                     _(b'unexpected block type in release notes: %s')
   426                     % block[b'type']
   426                     % block[b'type']
   427                 )
   427                 )
   428             if title:
   428             if title:
   429                 notefragment.append(block[b'lines'])
   429                 notefragment.append(block[b'lines'])
   430 
   430