Mercurial > hg > hg-fastimport
diff hgext3rd/fastimport/hgimport.py @ 97:cde0e1d24e58
We always compress/decompress blob data
So remove the test if we have a compressor or decompressor.
While here, fix a line limit.
| author | Roy Marples <roy@marples.name> |
|---|---|
| date | Fri, 22 Jan 2021 15:53:03 +0000 |
| parents | 3b398a887b95 |
| children |
line wrap: on
line diff
--- a/hgext3rd/fastimport/hgimport.py Fri Jan 22 00:03:52 2021 +0000 +++ b/hgext3rd/fastimport/hgimport.py Fri Jan 22 15:53:03 2021 +0000 @@ -208,8 +208,7 @@ return os.path.join(self.blobpath, b"blob-" + blobid) def writeblob(self, blobid, data): - if self.compressor: - data = self.compressor.compress(data) + data = self.compressor.compress(data) if have_sqlite: if self.blobdb is None: @@ -246,9 +245,7 @@ if not data: raise RuntimeError("missing blob %s for fileid %s" % (blobid, fileid)) - if self.decompressor: - data = self.decompressor.decompress(data, 10**8) - return data + return self.decompressor.decompress(data, 10**8) def getmode(self, name, fileid): (commitid, blobid) = fileid
