Page MenuHomeSoftware Heritage

D3208.diff
No OneTemporary

D3208.diff

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

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

Event Timeline