Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-vault
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Platform
Development
swh-vault
Commits
c7739890
Commit
c7739890
authored
2 years ago
by
vlorentz
Browse files
Options
Downloads
Patches
Plain Diff
Call storage.content_get_data() with hash dicts instead of only sha1
parent
27d466e5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!181
Fix a whole bunch of warnings
Pipeline
#1238
passed
1 year ago
Stage: external
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
swh/vault/cookers/git_bare.py
+17
-2
17 additions, 2 deletions
swh/vault/cookers/git_bare.py
swh/vault/to_disk.py
+6
-3
6 additions, 3 deletions
swh/vault/to_disk.py
with
23 additions
and
5 deletions
swh/vault/cookers/git_bare.py
+
17
−
2
View file @
c7739890
...
...
@@ -39,7 +39,18 @@ import re
import
subprocess
import
tarfile
import
tempfile
from
typing
import
Any
,
Dict
,
Iterable
,
Iterator
,
List
,
NoReturn
,
Optional
,
Set
,
Tuple
from
typing
import
(
Any
,
Dict
,
Iterable
,
Iterator
,
List
,
NoReturn
,
Optional
,
Set
,
Tuple
,
cast
,
)
import
zlib
import
sentry_sdk
...
...
@@ -63,6 +74,7 @@ from swh.model.model import ObjectType as ModelObjectType
from
swh.model.swhids
import
CoreSWHID
,
ObjectType
from
swh.storage.algos.revisions_walker
import
DFSRevisionsWalker
from
swh.storage.algos.snapshot
import
snapshot_get_all_branches
from
swh.storage.interface
import
HashDict
from
swh.vault.cookers.base
import
BaseVaultCooker
from
swh.vault.to_disk
import
HIDDEN_MESSAGE
,
SKIPPED_MESSAGE
...
...
@@ -690,7 +702,10 @@ class GitBareCooker(BaseVaultCooker):
contents_and_data
:
Iterator
[
Tuple
[
Content
,
Optional
[
bytes
]]]
if
self
.
objstorage
is
None
:
contents_and_data
=
(
(
content
,
self
.
storage
.
content_get_data
(
content
.
sha1
))
(
content
,
self
.
storage
.
content_get_data
(
cast
(
HashDict
,
content
.
hashes
())),
)
for
content
in
visible_contents
)
else
:
...
...
This diff is collapsed.
Click to expand it.
swh/vault/to_disk.py
+
6
−
3
View file @
c7739890
...
...
@@ -11,7 +11,7 @@ from typing import Any, Dict, Iterator, List
from
swh.model
import
hashutil
from
swh.model.from_disk
import
DentryPerms
,
mode_to_perms
from
swh.storage.algos.dir_iterators
import
dir_iterator
from
swh.storage.interface
import
StorageInterface
from
swh.storage.interface
import
HashDict
,
StorageInterface
MISSING_MESSAGE
=
(
b
"
This content is missing from the Software Heritage archive
"
...
...
@@ -48,8 +48,11 @@ def get_filtered_files_content(
for
file_data
in
files_data
:
status
=
file_data
[
"
status
"
]
if
status
==
"
visible
"
:
sha1
=
file_data
[
"
sha1
"
]
data
=
storage
.
content_get_data
(
sha1
)
hashes
:
HashDict
=
{
"
sha1
"
:
file_data
[
"
sha1
"
],
"
sha1_git
"
:
file_data
[
"
sha1_git
"
],
}
data
=
storage
.
content_get_data
(
hashes
)
if
data
is
None
:
content
=
SKIPPED_MESSAGE
else
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment