# HG changeset patch # User Roy Marples # Date 1611330783 0 # Node ID cde0e1d24e5840f568011d3e0c5e6357430f2d49 # Parent 7eb15a5c4cad19073add62305ae43560f2be804d We always compress/decompress blob data So remove the test if we have a compressor or decompressor. While here, fix a line limit. diff -r 7eb15a5c4cad -r cde0e1d24e58 hgext3rd/fastimport/__init__.py --- a/hgext3rd/fastimport/__init__.py Fri Jan 22 00:03:52 2021 +0000 +++ b/hgext3rd/fastimport/__init__.py Fri Jan 22 15:53:03 2021 +0000 @@ -65,7 +65,8 @@ # sink is the current repo, src is the list of fastimport streams destc = hg.mercurial_sink(ui, b"hg", repo.root) - srcc = fastimport_source(ui, b"fastimport", repo, sources, opts[b"blobpath"]) + srcc = fastimport_source(ui, b"fastimport", repo, sources, + opts[b"blobpath"]) defaultsort = b"branchsort" # for efficiency and consistency sortmodes = (b"branchsort", b"datesort", b"sourcesort") diff -r 7eb15a5c4cad -r cde0e1d24e58 hgext3rd/fastimport/hgimport.py --- 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