Skip to content

Add --splice support to merge command#1794

Closed
bysiber wants to merge 1 commit intosqlalchemy:mainfrom
bysiber:add-splice-to-merge-command
Closed

Add --splice support to merge command#1794
bysiber wants to merge 1 commit intosqlalchemy:mainfrom
bysiber:add-splice-to-merge-command

Conversation

@bysiber
Copy link
Contributor

@bysiber bysiber commented Feb 21, 2026

Fixes #1712

Adds a splice parameter to the merge() command function, matching the existing support in revision(). This is wired through to generate_revision() and since splice is already registered in _KWARGS_OPTS, the --splice CLI flag is automatically available for alembic merge.

Without this, trying to merge non-head revisions raises an error that suggests using --splice, but the merge command didn't actually accept that flag.

The patch is exactly what @zzzeek proposed in the linked discussion. Test included that verifies both the error without splice and success with splice=True.

The merge command now accepts a --splice flag, matching the
existing behavior in the revision command. This allows merging
revisions that are not current heads, which is useful when
creating merge points from non-head branches.

Fixes sqlalchemy#1712
@zzzeek zzzeek requested a review from sqla-tester February 22, 2026 15:26
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 zzzeek to try to get revision a0f9b6d 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 a0f9b6d: https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/6606

@sqla-tester
Copy link
Collaborator

Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/6606 has been merged. Congratulations! :)

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

2 participants