# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this, # file, You can obtain one at http://mozilla.org/MPL/2.0/.
import subprocess
import mozunit import pytest
from mozversioncontrol import get_repository_object
with pytest.raises(
ValueError, match="Cannot specify ref without specifying remote"
):
vcs.push(ref="some-ref")
def test_jj_push_url_to_name_translation(repo): """Test that jj translates git URLs to remote names""" if repo.vcs != "jj":
pytest.skip("Only relevant for jj repos")
# Get the actual remote URL
result = subprocess.run(
["jj", "git", "remote", "list"],
cwd=str(repo.dir),
capture_output=True,
text=True,
check=True,
)
# Extract the upstream URL from output for line in result.stdout.strip().splitlines(): if line.startswith("upstream "):
upstream_url = line.split(" ", 1)[1] break
# Push using URL should work (it gets translated to "upstream")
vcs.push(remote=upstream_url, ref="test-bookmark")
def test_jj_push_change_id_with_dest_branch(repo): """Simulate push_to_try: a change ID as ref is resolved to a commit SHA
when dest_branch is set, allowing git to push it to a named remote branch. """ if repo.vcs != "jj":
pytest.skip("Only relevant for jj repos")
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.