Rev 5596: Found another tuned_gzip use in weaverepo in http://bazaar.launchpad.net/~jameinel/bzr/2.3-gzip-py2.7

John Arbash Meinel john at arbash-meinel.com
Tue Jan 11 20:45:51 UTC 2011


At http://bazaar.launchpad.net/~jameinel/bzr/2.3-gzip-py2.7

------------------------------------------------------------
revno: 5596
revision-id: john at arbash-meinel.com-20110111204544-xz2j3vw9520nor7l
parent: john at arbash-meinel.com-20110111204236-mthyd83cgt2j4c6o
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.3-gzip-py2.7
timestamp: Tue 2011-01-11 14:45:44 -0600
message:
  Found another tuned_gzip use in weaverepo
-------------- next part --------------
=== modified file 'bzrlib/repofmt/weaverepo.py'
--- a/bzrlib/repofmt/weaverepo.py	2010-11-20 21:41:05 +0000
+++ b/bzrlib/repofmt/weaverepo.py	2011-01-11 20:45:44 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2010 Canonical Ltd
+# Copyright (C) 2007-2011 Canonical Ltd
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -20,6 +20,7 @@
 ghosts.
 """
 
+import gzip
 import os
 from cStringIO import StringIO
 import urllib
@@ -40,6 +41,7 @@
     lockdir,
     osutils,
     trace,
+    tuned_gzip,
     urlutils,
     versionedfile,
     weave,
@@ -56,7 +58,6 @@
     RepositoryFormat,
     )
 from bzrlib.store.text import TextStore
-from bzrlib.tuned_gzip import GzipFile, bytes_to_gzip
 from bzrlib.versionedfile import (
     AbsentContentFactory,
     FulltextContentFactory,
@@ -589,7 +590,7 @@
             raise ValueError('bad idea to put / in %r' % (key,))
         text = ''.join(lines)
         if self._compressed:
-            text = bytes_to_gzip(text)
+            text = tuned_gzip.bytes_to_gzip(text)
         path = self._map(key)
         self._transport.put_bytes_non_atomic(path, text, create_parent_dir=True)
 
@@ -637,7 +638,7 @@
             else:
                 return None
         if compressed:
-            text = GzipFile(mode='rb', fileobj=StringIO(text)).read()
+            text = gzip.GzipFile(mode='rb', fileobj=StringIO(text)).read()
         return text
 
     def _map(self, key):



More information about the bazaar-commits mailing list