Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9348362
D8003.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D8003.diff
View Options
diff --git a/swh/loader/svn/tests/test_utils.py b/swh/loader/svn/tests/test_utils.py
--- a/swh/loader/svn/tests/test_utils.py
+++ b/swh/loader/svn/tests/test_utils.py
@@ -408,6 +408,18 @@
False,
),
),
+ (
+ "-r 123 http://svn.example.com/repos/sounds@100 third-party/sounds",
+ "trunk/externals",
+ "http://svn.example.org/repos/test",
+ ("third-party/sounds", "http://svn.example.com/repos/sounds", 123, False),
+ ),
+ (
+ "-r 123 http://svn.example.com/repos/sounds@150 third-party/sounds",
+ "trunk/externals",
+ "http://svn.example.org/repos/test",
+ ("third-party/sounds", "http://svn.example.com/repos/sounds", 123, False),
+ ),
],
)
def test_parse_external_definition(external, dir_path, repo_url, expected_result):
diff --git a/swh/loader/svn/utils.py b/swh/loader/svn/utils.py
--- a/swh/loader/svn/utils.py
+++ b/swh/loader/svn/utils.py
@@ -288,7 +288,10 @@
# http://svn.example.org/repos/test/path@XXX
url, revision_s = external_url.rsplit("@", maxsplit=1)
try:
- revision = int(revision_s)
+ # ensure revision_s can be parsed to int
+ rev = int(revision_s)
+ # -r XXX takes priority over <svn_url>@XXX
+ revision = revision or rev
external_url = url
except ValueError:
# handle URL like http://user@svn.example.org/
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Jul 3 2025, 6:26 PM (5 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3220047
Attached To
D8003: utils: Ensure to return correct revision in parse_external_definition
Event Timeline
Log In to Comment