code: def _iter_changelog(changelog):
      
      first_line = True
      current_release = None
      prev_msg = None
  
      yield current_release, 'Changelog\n=========\n\n'
      for hash, tags, msg in changelog:
  
          if prev_msg is None:
              prev_msg = msg
          else:
              if prev_msg.lower() == msg.lower():
                  continue
              else:
                  prev_msg = msg
  
          if tags:
              current_release = max(tags, key=pkg_resources.parse_version)
              underline = len(current_release) * '-'
              if not first_line:
                  yield current_release, '\n'
              yield current_release, (
                  '%(tag)s\n%(underline)s\n\n' %
                  dict(tag=current_release, underline=underline))
  
          if not msg.startswith('Merge '):
              if msg.endswith('.'):
                  msg = msg[:-1]
              yield current_release, '* %(msg)s\n' % dict(msg=msg)
          first_line = False
docs: Convert a oneline log iterator to formatted strings.
  
      :param changelog: An iterator of one line log entries like
          that given by _iter_log_oneline.
      :return: An iterator over (release, formatted changelog) tuples.