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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Platform
Development
swh-vault
Commits
36a5252a
Commit
36a5252a
authored
Jun 23, 2017
by
Antoine Pietri
Browse files
Options
Downloads
Patches
Plain Diff
cookers: gzip-compress gitfast exports
parent
13e3f5c3
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
swh/vault/cookers/revision_gitfast.py
+4
-1
4 additions, 1 deletion
swh/vault/cookers/revision_gitfast.py
with
4 additions
and
1 deletion
swh/vault/cookers/revision_gitfast.py
+
4
−
1
View file @
36a5252a
...
@@ -8,6 +8,7 @@ import fastimport.commands
...
@@ -8,6 +8,7 @@ import fastimport.commands
import
functools
import
functools
import
os
import
os
import
time
import
time
import
zlib
from
.base
import
BaseVaultCooker
from
.base
import
BaseVaultCooker
...
@@ -20,8 +21,10 @@ class RevisionGitfastCooker(BaseVaultCooker):
...
@@ -20,8 +21,10 @@ class RevisionGitfastCooker(BaseVaultCooker):
log
=
self
.
storage
.
revision_log
([
self
.
obj_id
])
log
=
self
.
storage
.
revision_log
([
self
.
obj_id
])
commands
=
self
.
fastexport
(
log
)
commands
=
self
.
fastexport
(
log
)
compressobj
=
zlib
.
compressobj
(
9
,
zlib
.
DEFLATED
,
zlib
.
MAX_WBITS
|
16
)
for
command
in
commands
:
for
command
in
commands
:
yield
bytes
(
command
)
yield
compressobj
.
compress
(
bytes
(
command
)
+
b
'
\n
'
)
yield
compressobj
.
flush
()
def
fastexport
(
self
,
log
):
def
fastexport
(
self
,
log
):
"""
Generate all the git fast-import commands from a given log.
"""
Generate all the git fast-import commands from a given log.
...
...
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