commit - 1abdec0ef115d8c29968fc2eeb22936bff743295
commit + 91b0caf89ffbcd64c670ddc387741fe9e8901b5e
blob - bad93b27fbcbfcfe219bca5547cabae56b6d75e1
blob + ffda1054c499b061edb13fc90d47c3550e64e74b
--- swh/loader/git/loader.py
+++ swh/loader/git/loader.py
from dulwich.object_store import ObjectStoreGraphWalker
from dulwich.objects import Blob, Commit, ShaFile, Tag, Tree
from dulwich.pack import Pack, PackData, PackInflater, load_pack_index
-import urllib3.util
from igraph import Graph
+import urllib3.util
from swh.core.statsd import Statsd
from swh.loader.exception import NotFound
content_hashes = []
missing_subtrees = []
missing_contents = []
- for (name, mode, sha) in tree.iteritems():
+ for name, mode, sha in tree.iteritems():
if mode & stat.S_IFDIR:
subtree_hashes.append(hashutil.bytehex_to_hash(sha))
logging.debug(f"subtree: {name} {sha}")
logger.debug(f" pack is missing: {tree_hex}")
continue
logger.debug(f"Entries of {tree}:")
- for (name, mode, entry_hex) in tree.iteritems():
+ for name, mode, entry_hex in tree.iteritems():
logger.debug(f" {name} {mode} {entry_hex}")
if mode & submodule_mode == submodule_mode:
continue # ignore submodules
for t in tree_vertices:
tree_hash = t["name"]
have_dep = False
- for (dep_hash, dep_type) in get_dependencies(tree_hash):
+ for dep_hash, dep_type in get_dependencies(tree_hash):
have_dep = True
if dep_type == GitObjectType.BLOB and dep_hash in missing_contents:
self.log.debug(
)
for c in commit_vertices:
commit_hash = c["name"]
- for (dep_hash, dep_type) in get_dependencies(commit_hash):
+ for dep_hash, dep_type in get_dependencies(commit_hash):
if dep_hash in missing_contents or dep_hash in missing_directories:
self.log.debug(
f"commit {hashutil.hash_to_bytehex(commit_hash)!r} depends on "
)
for t in tag_vertices:
tag_hash = t["name"]
- for (dep_hash, dep_type) in get_dependencies(tag_hash):
+ for dep_hash, dep_type in get_dependencies(tag_hash):
if (
dep_hash in missing_revisions
or dep_hash in missing_directories
storage_summary.update(self.flush())
self.loaded_snapshot_id = snapshot.id
- for (object_type, total) in self.counts.items():
+ for object_type, total in self.counts.items():
filtered = total - storage_summary[f"{object_type}:add"]
assert 0 <= filtered <= total, (filtered, total)
blob - e660f4d3fa82c59ca165f39717f5812f43e53dba
blob + dd48ccc53f93d5e21a89c73d99bd1ec8caf4810e
--- swh/loader/git/tests/test_loader.py
+++ swh/loader/git/tests/test_loader.py
)
def test_split_lines_and_remainder(input, output):
assert split_lines_and_remainder(input) == output
+
TEST_DATA = os.path.join(os.path.dirname(__file__), "data")
+
def test_loader_load_in_topological_order(
swh_storage, datadir, tmp_path, mocker, sentry_events
):