Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9696412
D3208.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
D3208.diff
View Options
diff --git a/swh/loader/svn/loader.py b/swh/loader/svn/loader.py
--- a/swh/loader/svn/loader.py
+++ b/swh/loader/svn/loader.py
@@ -15,7 +15,7 @@
from mmap import mmap, ACCESS_WRITE
from subprocess import Popen
-from typing import Iterator, List, Tuple
+from typing import Iterator, List, Optional, Tuple
from swh.model import hashutil
from swh.model.model import (
@@ -556,7 +556,9 @@
# reset internal state for next iteration
self._revisions = []
- def generate_and_load_snapshot(self, revision=None, snapshot=None):
+ def generate_and_load_snapshot(
+ self, revision: Optional[Revision] = None, snapshot: Optional[Snapshot] = None
+ ) -> Snapshot:
"""Create the snapshot either from existing revision or snapshot.
Revision (supposedly new) has priority over the snapshot
@@ -575,7 +577,9 @@
elif snapshot: # Fallback to prior snapshot
snap = snapshot
else:
- return None
+ raise ValueError(
+ "generate_and_load_snapshot called with null revision and snapshot!"
+ )
self.log.debug("snapshot: %s" % snap)
self.storage.snapshot_add([snap])
return snap
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Aug 17, 8:01 PM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3220904
Attached To
D3208: Force either revision or snapshot in generate_and_load_snapshot
Event Timeline
Log In to Comment