Bläddra i källkod

Skip temporary metadata dependency resolution if there are no dependencies

tags/v1.1
JustAnotherArchivist 1 år sedan
förälder
incheckning
c02859987f
1 ändrade filer med 13 tillägg och 11 borttagningar
  1. +13
    -11
      codearchiver/modules/git.py

+ 13
- 11
codearchiver/modules/git.py Visa fil

@@ -271,18 +271,20 @@ class Git(codearchiver.core.Module):


# Bundling completed without issues; wait for depended-on bundles, add them to the metadata, then replace own temporary metadata # Bundling completed without issues; wait for depended-on bundles, add them to the metadata, then replace own temporary metadata
if self._storage: if self._storage:
self._storage.wait_temporary_metadata(tmpMetadataDependencies)
if tmpMetadataDependencies:
self._storage.wait_temporary_metadata(tmpMetadataDependencies)
with self._storage.lock(): with self._storage.lock():
criteria = [('Module', type(self).name), ('Root commit', tuple(rootCommits)), ('Object', tuple(baseInProgressObjects))]
missingObjects = baseInProgressObjects.copy()
for oldBundleName, oldObjects, oldOids in self._find_storage_bundles(criteria, {value.split(' ', 1)[0] for value in baseInProgressObjects}):
metadata.append('Based on bundle', oldBundleName)
baseOids |= oldOids
missingObjects -= oldObjects

# Verification: all commit/tag objects collected from temporary metadata must be covered
if missingObjects:
raise RuntimeError('Resolved temporary metadata bundles do not cover all expected objects')
if tmpMetadataDependencies:
criteria = [('Module', type(self).name), ('Root commit', tuple(rootCommits)), ('Object', tuple(baseInProgressObjects))]
missingObjects = baseInProgressObjects.copy()
for oldBundleName, oldObjects, oldOids in self._find_storage_bundles(criteria, {value.split(' ', 1)[0] for value in baseInProgressObjects}):
metadata.append('Based on bundle', oldBundleName)
baseOids |= oldOids
missingObjects -= oldObjects

# Verification: all commit/tag objects collected from temporary metadata must be covered
if missingObjects:
raise RuntimeError('Resolved temporary metadata bundles do not cover all expected objects')


# Verification: all objects in the clone are either in a base bundle or in the index # Verification: all objects in the clone are either in a base bundle or in the index
# This can only be done here because all oids are needed, not just the commit/tag objects # This can only be done here because all oids are needed, not just the commit/tag objects


Laddar…
Avbryt
Spara