Esempio n. 1
0
def fixup_section(repo, use_git_author, options, dch_options):
    """
    Fixup the changelog header and trailer's committer and email address

    It might otherwise point to the last git committer instead of the person
    creating the changelog

    This also applies --distribution and --urgency options passed to gbp dch
    """
    author, email = get_author_email(repo, use_git_author)
    used_options = ['distribution', 'urgency']
    opts = []
    mainttrailer_opts = ['--nomainttrailer', '--mainttrailer', '-t']

    # This must not be done for snapshots or snapshots changelog entries
    # will not be concatenated
    if not options.snapshot:
        for opt in used_options:
            val = getattr(options, opt)
            if val:
                gbp.log.debug("Set header option '%s' to '%s'" % (opt, val))
                opts.append("--%s=%s" % (opt, val))
    else:
        gbp.log.debug("Snapshot enabled: do not fixup options in header")

    if use_git_author:
        for opt in mainttrailer_opts:
            if opt in dch_options:
                break
        else:
            opts.append(mainttrailer_opts[0])
    ChangeLog.spawn_dch(msg='',
                        author=author,
                        email=email,
                        dch_options=dch_options + opts)
Esempio n. 2
0
def fixup_section(repo, use_git_author, options, dch_options):
    """
    Fixup the changelog header and trailer's committer and email address

    It might otherwise point to the last git committer instead of the person
    creating the changelog

    This also applies --distribution and --urgency options passed to gbp dch
    """
    author, email = get_author_email(repo, use_git_author)
    used_options = ['distribution', 'urgency']
    opts = []
    mainttrailer_opts = [ '--nomainttrailer', '--mainttrailer', '-t' ]

    # This must not be done for snapshots or snapshots changelog entries
    # will not be concatenated
    if not options.snapshot:
        for opt in used_options:
            val = getattr(options, opt)
            if val:
                gbp.log.debug("Set header option '%s' to '%s'" % (opt, val))
                opts.append("--%s=%s" % (opt, val))
    else:
        gbp.log.debug("Snapshot enabled: do not fixup options in header")

    if use_git_author:
        for opt in mainttrailer_opts:
            if opt in dch_options:
                break
        else:
            opts.append(mainttrailer_opts[0])
    ChangeLog.spawn_dch(msg='', author=author, email=email, dch_options=dch_options+opts)
Esempio n. 3
0
def fixup_section(repo, git_author, options, dch_options):
    """
    Fixup the changelog header and trailer's comitter and email address

    It might otherwise point to the last git committer instead of the person
    creating the changelog
    This apply --distribution and --urgency options passed to git-dch
    """
    author, email = get_author_email(repo, git_author)
    used_options = ["distribution", "urgency"]
    header_opts = []

    # This must not be done for snapshots or snapshots changelog entries
    # will not be concatenated
    if not options.snapshot:
        for opt in used_options:
            val = getattr(options, opt)
            if val:
                gbp.log.debug("Set header option '%s' to '%s'" % (opt, val))
                header_opts.append("--%s=%s" % (opt, val))
    else:
        gbp.log.debug("Snapshot enabled: do not fixup options in header")

    ChangeLog.spawn_dch(msg="", author=author, email=email, dch_options=dch_options + header_opts)