Merge one or more revisions.

    Takes one or more revisions or "heads" for all heads and merges them into
    a single revision.

def merge(config, revisions, **kwargs):
    """
    Merge one or more revisions.

    Takes one or more revisions or "heads" for all heads and merges them into
    a single revision.
    """
    with alembic_lock(
        config.registry["sqlalchemy.engine"], config.alembic_config()
    ) as alembic_config:
        alembic.command.merge(alembic_config, revisions, **kwargs)