Rev 4673: Of course, when you change the content, it can effect the stored wire bytes slightly. in http://bazaar.launchpad.net/~jameinel/bzr/2.1b1-pack-on-the-fly

John Arbash Meinel john at arbash-meinel.com
Wed Sep 2 21:00:15 BST 2009


At http://bazaar.launchpad.net/~jameinel/bzr/2.1b1-pack-on-the-fly

------------------------------------------------------------
revno: 4673
revision-id: john at arbash-meinel.com-20090902200007-vhiub5qwc1gafxt9
parent: john at arbash-meinel.com-20090902195448-1xueel7882fbuvx3
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.1b1-pack-on-the-fly
timestamp: Wed 2009-09-02 15:00:07 -0500
message:
  Of course, when you change the content, it can effect the stored wire bytes slightly.
-------------- next part --------------
=== modified file 'bzrlib/groupcompress.py'
--- a/bzrlib/groupcompress.py	2009-09-02 19:54:48 +0000
+++ b/bzrlib/groupcompress.py	2009-09-02 20:00:07 +0000
@@ -1657,7 +1657,8 @@
                 if record.storage_kind == 'groupcompress-block':
                     # Check to see if we really want to re-use this block
                     insert_manager = record._manager
-                    insert_manager._check_rebuild_block()
+                    # if not insert_manager.check_is_well_utilized():
+                    #     reuse_this_block = False
                     if len(insert_manager._factories) == 1:
                         # This block only has a single record in it
                         # Mark this block to be rebuilt
@@ -1667,6 +1668,7 @@
                 if record.storage_kind == 'groupcompress-block':
                     # Insert the raw block into the target repo
                     insert_manager = record._manager
+                    insert_manager._check_rebuild_block()
                     bytes = record._manager._block.to_bytes()
                     _, start, length = self._access.add_raw_records(
                         [(None, len(bytes))], bytes)[0]

=== modified file 'bzrlib/tests/test_groupcompress.py'
--- a/bzrlib/tests/test_groupcompress.py	2009-09-02 19:54:48 +0000
+++ b/bzrlib/tests/test_groupcompress.py	2009-09-02 20:00:07 +0000
@@ -904,8 +904,8 @@
         header_len = int(header_len)
         block_len = int(block_len)
         self.assertEqual('groupcompress-block', storage_kind)
-        self.assertEqual(33, z_header_len)
-        self.assertEqual(25, header_len)
+        self.assertEqual(34, z_header_len)
+        self.assertEqual(26, header_len)
         self.assertEqual(len(block_bytes), block_len)
         z_header = rest[:z_header_len]
         header = zlib.decompress(z_header)



More information about the bazaar-commits mailing list