diff --git a/CHANGES b/CHANGES index 1fb41858..4059e848 100644 --- a/CHANGES +++ b/CHANGES @@ -21,6 +21,16 @@ $ pipx install --suffix=@next 'vcspull' --pip-args '\--pre' --force +### Breaking changes + +- Python 3.7 Dropped (#421) +- libvcs: Bumped from 0.22.2 -> 0.24.0 (#419) + +### Bug fixes + +- Git Remote URLs: Fix bug that would cause git remotes with `@` to be chopped off after the + protocol (#419, fixes #425) + ### Development - Refactor of two testsuites to used `NamedTuple` parametrization (#423): @@ -28,10 +38,6 @@ $ pipx install --suffix=@next 'vcspull' --pip-args '\--pre' --force - test_config_variations - test_updating_remote -### Breaking changes - -- Python 3.7 Dropped (#421) - ## vcspull v1.22.0 (2023-09-02) _Maintenance only, no bug fixes, or new features_ diff --git a/poetry.lock b/poetry.lock index 7596e90b..43da22e8 100644 --- a/poetry.lock +++ b/poetry.lock @@ -430,13 +430,13 @@ i18n = ["Babel (>=2.7)"] [[package]] name = "libvcs" -version = "0.22.2" +version = "0.24.0" description = "Lite, typed, python utilities for Git, SVN, Mercurial, etc." optional = false python-versions = ">=3.9,<4.0" files = [ - {file = "libvcs-0.22.2-py3-none-any.whl", hash = "sha256:e7a78ea11eedfd6f6d1e5f289e415e7dc919a15458804cc57f760c4a37081e22"}, - {file = "libvcs-0.22.2.tar.gz", hash = "sha256:3348f9807e8f6682168e6664464c6f29d4574bc645782a168a7058704d03636b"}, + {file = "libvcs-0.24.0-py3-none-any.whl", hash = "sha256:f9f91b10b0f9f5fedac9374bc41a3f21d8c5091872e44472dee014efca05e59c"}, + {file = "libvcs-0.24.0.tar.gz", hash = "sha256:6ec9a8c02e3b9ab8c8a59f73e04cf76e070c1b1fc678318f54266c790af8f947"}, ] [package.dependencies] @@ -1371,4 +1371,4 @@ test = [] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "38a0589892534ad0fdd3483be0682e17aa991ae15e9d3649f3b3e8b5e2f268a0" +content-hash = "aa3932878cba219ac28fd424f0fbc0e0eab714033486e5637a1247356f888902" diff --git a/pyproject.toml b/pyproject.toml index ca352ba6..253ce5ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,7 +60,7 @@ vcspull = 'vcspull:cli.cli' [tool.poetry.dependencies] python = "^3.9" -libvcs = "~0.22.1" +libvcs = "~0.24.0" colorama = ">=0.3.9" PyYAML = "^6.0" diff --git a/tests/test_sync.py b/tests/test_sync.py index 8a1b1998..619cd867 100644 --- a/tests/test_sync.py +++ b/tests/test_sync.py @@ -97,6 +97,28 @@ class ConfigVariationTest(t.NamedTuple): """, remote_list=["secondremote"], ), + ConfigVariationTest( + test_id="expanded_repo_style_with_unprefixed_remote", + config_tpl=""" + {tmp_path}/study/myrepo: + {CLONE_NAME}: + repo: git+file://{dir} + remotes: + git_scheme_repo: git@codeberg.org:tmux-python/tmuxp.git + """, + remote_list=["git_scheme_repo"], + ), + ConfigVariationTest( + test_id="expanded_repo_style_with_unprefixed_remote_2", + config_tpl=""" + {tmp_path}/study/myrepo: + {CLONE_NAME}: + repo: git+file://{dir} + remotes: + git_scheme_repo: git@github.com:tony/vcspull.git + """, + remote_list=["git_scheme_repo"], + ), ] @@ -131,7 +153,6 @@ def test_config_variations( assert len(repos) == 1 for repo_dict in repos: - repo_url = repo_dict["url"].replace("git+", "") repo: GitSync = update_repo(repo_dict) remotes = repo.remotes() or {} remote_names = set(remotes.keys()) @@ -142,7 +163,26 @@ def test_config_variations( for remote_name in remotes: current_remote = repo.remote(remote_name) assert current_remote is not None - assert current_remote.fetch_url == repo_url + assert repo_dict is not None + assert isinstance(remote_name, str) + if ( + "remotes" in repo_dict + and isinstance(repo_dict["remotes"], dict) + and remote_name in repo_dict["remotes"] + ): + if repo_dict["remotes"][remote_name].fetch_url.startswith( + "git+file://" + ): + assert current_remote.fetch_url == repo_dict["remotes"][ + remote_name + ].fetch_url.replace( + "git+", "" + ), "Final git remote should chop git+ prefix" + else: + assert ( + current_remote.fetch_url + == repo_dict["remotes"][remote_name].fetch_url + ) class UpdatingRemoteFixture(t.NamedTuple):