Allow aliases in the 'packit propose-update'
@@ -32,6 +32,7 @@ import click
from packit.cli.types import LocalProjectParameter
from packit.cli.utils import cover_packit_exception, get_packit_api
from packit.config import pass_config, get_context_settings
+from packit.config.aliases import get_branches
logger = logging.getLogger(__file__)
@@ -39,7 +40,8 @@ logger = logging.getLogger(__file__)
@click.command("propose-update", context_settings=get_context_settings())
@click.option(
"--dist-git-branch",
- help="Target branch in dist-git to release into.",
+ help="Comma separated list of target branches in dist-git to release into. "
+ "(defaults to 'master')",
default="master",
)
@click.option(
@@ -120,8 +122,12 @@ def update(
api = get_packit_api(
config=config, dist_git_path=dist_git_path, local_project=path_or_url
)
+ branches_to_update = get_branches(*dist_git_branch.split(","), default="master")
+ click.echo(f"Syncing from the following branches: {', '.join(branches_to_update)}")
+
+ for branch in branches_to_update:
api.sync_release(
- dist_git_branch,
+ dist_git_branch=branch,
use_local_content=local_content,
version=version,
force_new_sources=force_new_sources,
