Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7123073
D6816.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
D6816.diff
View Options
diff --git a/swh/loader/package/loader.py b/swh/loader/package/loader.py
--- a/swh/loader/package/loader.py
+++ b/swh/loader/package/loader.py
@@ -332,14 +332,19 @@
# If there is no release extid (ie. if the package was only loaded with
# older versions of this loader, which produced revision objects instead
- # of releases), return a revision extid.
- assert len(extid_targets) == 1, extid_targets
- extid_target = list(extid_targets)[0]
- assert extid_target.object_type == ObjectType.REVISION, extid_targets
- return extid_target
- else:
- # No target found (this is probably a new package version)
- return None
+ # of releases), return a revision extid when possible.
+ revision_extid_targets = {
+ extid_target
+ for extid_target in extid_targets
+ if extid_target.object_type == ObjectType.REVISION
+ }
+ if revision_extid_targets:
+ assert len(extid_targets) == 1, extid_targets
+ extid_target = list(extid_targets)[0]
+ return extid_target
+
+ # No target found (this is probably a new package version)
+ return None
def select_extid_target(
self, p_info: TPackageInfo, extid_targets: Set[CoreSWHID]
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 17, 7:43 PM (2 d, 16 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3222685
Attached To
D6816: nixguix: Fix crash when filtering extids on archives that were already loaded, but only from different URLs
Event Timeline
Log In to Comment