Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions lando_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,9 @@ def push_commits(
$ lando push-commits --lando-repo firefox-beta --relbranch FIREFOX_64b_RELBRANCH
"""
repo_info = get_repo_info(config, lando_repo)
click.echo(
f"Working on Lando repo {lando_repo} ({repo_info['repo_url']} at {repo_info['branch_name']})"
)
remote_branch_name = repo_info["branch_name"]

push_branch = branch or get_current_branch(local_repo)
Expand Down Expand Up @@ -654,13 +657,16 @@ def push_tag(

Use `lando push-tag` to push new tags to the specified Lando repository.

If no arguments are passed, `lando push-commits` will find any local tags
If no arguments are passed, `lando push-tags` will find any local tags
which are not present on the remote and prepare them for pushing to the
server.

If `--tag-name` and `--tag-sha` are used, a new tag with the given name
will be created on the specified commit SHA.
"""
repo_info = get_repo_info(config, lando_repo)
click.echo(f"Working on Lando repo {lando_repo} ({repo_info['repo_url']})")

if tag_name and tag_sha:
actions = [{"action": "tag", "name": tag_name, "target": tag_sha}]
else:
Expand Down Expand Up @@ -710,9 +716,12 @@ def push_merge(
$ lando push-merge --lando-repo firefox-main
"""
current_branch = get_current_branch(local_repo)
click.echo(f"Using branch {current_branch}")
click.echo(f"Using local branch {current_branch}")

repo_info = get_repo_info(config, lando_repo)
click.echo(
f"Working on Lando repo {lando_repo} ({repo_info['repo_url']} at {repo_info['branch_name']})"
)
remote_branch_name = repo_info["branch_name"]

if target_commit and commit_message:
Expand Down
6 changes: 5 additions & 1 deletion tests/test_click.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ def mock_config(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> cli.Config:
@pytest.fixture
def mock_get_repo_info(monkeypatch: pytest.MonkeyPatch) -> mock.Mock:
mock_fixture = mock.MagicMock()
mock_fixture.return_value = {"branch_name": "main", "repo_name": "mock-repo"}
mock_fixture.return_value = {
"repo_url": "https://example.net/mock-repo",
"branch_name": "main",
"repo_name": "mock-repo",
}
monkeypatch.setattr(cli, "get_repo_info", mock_fixture)
return mock_fixture

Expand Down