Skip to content
Snippets Groups Projects
Commit 36a5252a authored by Antoine Pietri's avatar Antoine Pietri
Browse files

cookers: gzip-compress gitfast exports

parent 13e3f5c3
Branches
Tags
No related merge requests found
...@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment