Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7123255
D7042.id25530.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D7042.id25530.diff
View Options
diff --git a/swh/loader/svn/replay.py b/swh/loader/svn/replay.py
--- a/swh/loader/svn/replay.py
+++ b/swh/loader/svn/replay.py
@@ -735,7 +735,7 @@
peg_rev=self.editor.revnum,
ignore_keywords=True,
)
- if os.path.isfile(dest_path):
+ if os.path.isfile(dest_path) or os.path.islink(dest_path):
self.directory[fullpath] = from_disk.Content.from_file(path=dest_path)
else:
self.directory[fullpath] = from_disk.Directory.from_disk(path=dest_path)
diff --git a/swh/loader/svn/tests/test_loader.py b/swh/loader/svn/tests/test_loader.py
--- a/swh/loader/svn/tests/test_loader.py
+++ b/swh/loader/svn/tests/test_loader.py
@@ -2618,21 +2618,34 @@
# first commit on external
add_commit(
external_repo_url,
- "Create a file in an external repository",
+ "Create files in an external repository",
[
CommitChange(
change_type=CommitChangeType.AddOrUpdate,
path="code/foo.sh",
data=b"#!/bin/bash\necho foo",
),
+ CommitChange(
+ change_type=CommitChangeType.AddOrUpdate,
+ path="code/link",
+ data=b"#!/bin/bash\necho link",
+ ),
],
)
# first commit
add_commit(
repo_url,
- "Add trunk dir",
- [CommitChange(change_type=CommitChangeType.AddOrUpdate, path="trunk/")],
+ "Add trunk dir and a link file",
+ [
+ CommitChange(change_type=CommitChangeType.AddOrUpdate, path="trunk/"),
+ CommitChange(
+ change_type=CommitChangeType.AddOrUpdate,
+ path="trunk/link",
+ data=b"link ../test",
+ properties={"svn:special": "*"},
+ ),
+ ],
)
# second commit
@@ -2645,7 +2658,8 @@
path="", # repo root dir
properties={
"svn:externals": (
- f"{svn_urljoin(external_repo_url, 'code/foo.sh')} trunk/code/foo.sh" # noqa
+ f"{svn_urljoin(external_repo_url, 'code/foo.sh')} trunk/code/foo.sh\n" # noqa
+ f"{svn_urljoin(external_repo_url, 'code/link')} trunk/link"
)
},
),
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 18, 6:24 AM (20 h, 47 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3227905
Attached To
D7042: replay: Fix links restoration in DirEditor.remove_external_path
Event Timeline
Log In to Comment