Skip to content

feat(sync): add --branch/-B to sync specific mapped branches#40

Merged
aclark4life merged 1 commit into
mainfrom
feat/sync-branch-filter
Jul 13, 2026
Merged

feat(sync): add --branch/-B to sync specific mapped branches#40
aclark4life merged 1 commit into
mainfrom
feat/sync-branch-filter

Conversation

@aclark4life

Copy link
Copy Markdown
Collaborator

Summary

Adds a --branch/-B option to dbx sync that syncs a specific subset of branches from a repo's upstream_branch mapping — filling the gap between "current branch only" (no arg) and --all-branches (everything).

Changes

  • sync.py: New repeatable --branch/-B option. Routes to _sync_all_branches with a branch_filter that validates each name exists in the mapping (errors listing available branches otherwise), de-dupes preserving order, and reuses the same rebase/force-push/restore/dry-run/CI-rerun flow.
  • Docs: docs/features/django-fork.rst documents -B with examples.
  • Tests: filtered-sync happy path + unknown-branch error.

Usage

dbx sync django -B mongodb-6.0.x                    # one branch
dbx sync django -B mongodb-6.0.x -B mongodb-6.1.x   # a few, in order
dbx sync django -B mongodb-6.0.x --dry-run          # preview

All 40 sync tests pass; ruff clean.

Fills the gap between syncing only the current branch (no arg) and
--all-branches (every branch in the upstream_branch mapping). The new
repeatable --branch/-B option restricts an all-branches-style sync to
the named branch(es), reusing the same rebase/force-push/restore/dry-run
and downstream CI re-run flow. Names must exist in the mapping.
@aclark4life
aclark4life merged commit bcada46 into main Jul 13, 2026
8 of 12 checks passed
@aclark4life
aclark4life deleted the feat/sync-branch-filter branch July 13, 2026 18:52
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.

1 participant