From a5c6d6014a9a27595860b103dddb88495b9c3090 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sun, 20 Aug 2023 06:47:45 -0500 Subject: [PATCH 1/6] tests(remotes): Reproduce git scheme issue --- tests/test_sync.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_sync.py b/tests/test_sync.py index 8a1b1998..1d41ae33 100644 --- a/tests/test_sync.py +++ b/tests/test_sync.py @@ -97,6 +97,17 @@ 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"], + ), ] From e20e66e167e0b9d03b540c12f51b8863901cc6ce Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sun, 22 Oct 2023 06:01:55 -0500 Subject: [PATCH 2/6] tests: Add nother example of remote failure --- tests/test_sync.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_sync.py b/tests/test_sync.py index 1d41ae33..523a89e8 100644 --- a/tests/test_sync.py +++ b/tests/test_sync.py @@ -108,6 +108,17 @@ class ConfigVariationTest(t.NamedTuple): """, 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+git@github.com:tony/vcspull.git + """, + remote_list=["git_scheme_repo"], + ), ] From 574934b040f3fd494ac0bb7a7920a6e741604ae5 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sun, 22 Oct 2023 07:29:40 -0500 Subject: [PATCH 3/6] tests(config variations): Improve remote test --- tests/test_sync.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/test_sync.py b/tests/test_sync.py index 523a89e8..059c684a 100644 --- a/tests/test_sync.py +++ b/tests/test_sync.py @@ -164,7 +164,16 @@ 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"] + ): + assert current_remote.fetch_url == repo_dict["remotes"][ + remote_name + ].fetch_url.replace("git+", "") class UpdatingRemoteFixture(t.NamedTuple): From a89e75ad6d41dc7074403ddb8ff3d1f4d98bf955 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sun, 22 Oct 2023 07:46:01 -0500 Subject: [PATCH 4/6] tests(config variations): Improve assertions of URLs beginning with git+file:// --- tests/test_sync.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/tests/test_sync.py b/tests/test_sync.py index 059c684a..619cd867 100644 --- a/tests/test_sync.py +++ b/tests/test_sync.py @@ -115,7 +115,7 @@ class ConfigVariationTest(t.NamedTuple): {CLONE_NAME}: repo: git+file://{dir} remotes: - git_scheme_repo: git+git@github.com:tony/vcspull.git + git_scheme_repo: git@github.com:tony/vcspull.git """, remote_list=["git_scheme_repo"], ), @@ -153,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()) @@ -171,9 +170,19 @@ def test_config_variations( and isinstance(repo_dict["remotes"], dict) and remote_name in repo_dict["remotes"] ): - assert current_remote.fetch_url == repo_dict["remotes"][ - remote_name - ].fetch_url.replace("git+", "") + 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): From 3729b125b150540c37a6cdaa4100134236200c1b Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sun, 22 Oct 2023 08:05:23 -0500 Subject: [PATCH 5/6] libvcs: 0.22.2 -> 0.24.0 v0.24.0 includes fix for git remotes --- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) 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" From 88128973db8674ede01ac0337b9501e2d71a84fd Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sun, 22 Oct 2023 07:50:37 -0500 Subject: [PATCH 6/6] docs(CHANGES): Note fix for chomped Git Remote URLs --- CHANGES | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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_