Skip to content

Conversation

@qu3vipon
Copy link
Contributor

This fixes: #1712

Description

I noticed that no one was actively working on this issue, so I went ahead and implemented support for the --splice option in the merge command.

This change allows merge to operate with non-head revisions by disabling the head-only validation, consistent with the behavior of --splice in revision.

Key points included in this PR:

  • Adds --splice support to alembic merge, allowing non-head revisions to be used as merge bases.
  • Updates the help text to reflect the new behavior.
  • Adds test coverage to validate both the failure case (splice=False) and the successful merge case (splice=True) using non-head revisions.

Let me know if further adjustments or additional tests would be helpful.

Checklist

This pull request is:

  • A documentation / typographical error fix
    • Good to go, no issue or tests are needed
  • A short code fix
    • please include the issue number, and create an issue if none exists, which
      must include a complete example of the issue. one line code fixes without an
      issue and demonstration will not be accepted.
    • Please include: Fixes: #<issue number> in the commit message
    • please include tests. one line code fixes without tests will not be accepted.
  • A new feature implementation
    • please include the issue number, and create an issue if none exists, which must
      include a complete example of how the feature would look.
    • Please include: Fixes: #<issue number> in the commit message
    • please include tests.

Have a nice day!

Copy link
Member

@CaselIT CaselIT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks ok to me

@CaselIT CaselIT requested a review from sqla-tester November 30, 2025 17:50
Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this is sqla-tester setting up my work on behalf of CaselIT to try to get revision 52bf8a6 of this pull request into gerrit so we can run tests and reviews and stuff

@sqla-tester
Copy link
Collaborator

New Gerrit review created for change 52bf8a6: https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/6496

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Merge command hints to do a slice, but there is no option for this

3 participants