Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-storage
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-storage
Commits
f711c20e
Commit
f711c20e
authored
8 years ago
by
Antoine Pietri
Browse files
Options
Downloads
Patches
Plain Diff
vault: more explicit DirectoryBuilder variable names
parent
7e15b4b9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!50
vault: more explicit DirectoryBuilder variable names
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
swh/storage/vault/cookers/directory.py
+2
-2
2 additions, 2 deletions
swh/storage/vault/cookers/directory.py
swh/storage/vault/cookers/revision_flat.py
+3
-3
3 additions, 3 deletions
swh/storage/vault/cookers/revision_flat.py
with
5 additions
and
5 deletions
swh/storage/vault/cookers/directory.py
+
2
−
2
View file @
f711c20e
...
...
@@ -23,8 +23,8 @@ class DirectoryCooker(BaseVaultCooker):
"""
# Create the bytes that corresponds to the compressed
# directory.
directory_
cook
er
=
DirectoryBuilder
(
self
.
storage
)
bundle_content
=
directory_
cook
er
.
get_directory_bytes
(
obj_id
)
directory_
build
er
=
DirectoryBuilder
(
self
.
storage
)
bundle_content
=
directory_
build
er
.
get_directory_bytes
(
obj_id
)
# Cache the bundle
self
.
update_cache
(
obj_id
,
bundle_content
)
# Make a notification that the bundle have been cooked
...
...
This diff is collapsed.
Click to expand it.
swh/storage/vault/cookers/revision_flat.py
+
3
−
3
View file @
f711c20e
...
...
@@ -25,14 +25,14 @@ class RevisionFlatCooker(BaseVaultCooker):
bytes that correspond to the bundle
"""
directory_
cook
er
=
DirectoryBuilder
(
self
.
storage
)
directory_
build
er
=
DirectoryBuilder
(
self
.
storage
)
with
tempfile
.
TemporaryDirectory
(
suffix
=
'
.cook
'
)
as
root_tmp
:
root
=
Path
(
root_tmp
)
for
revision
in
self
.
storage
.
revision_log
([
obj_id
]):
revdir
=
root
/
hashutil
.
hash_to_hex
(
revision
[
'
id
'
])
revdir
.
mkdir
()
directory_
cook
er
.
build_directory
(
revision
[
'
directory
'
],
str
(
revdir
).
encode
())
directory_
build
er
.
build_directory
(
revision
[
'
directory
'
],
str
(
revdir
).
encode
())
bundle_content
=
get_tar_bytes
(
root_tmp
,
hashutil
.
hash_to_hex
(
obj_id
))
# Cache the bundle
...
...
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