Rev 33: Bring in the trunk simplifications. in http://bazaar.launchpad.net/%7Ejameinel/bzr-groupcompress/dev5

John Arbash Meinel john at arbash-meinel.com
Fri Feb 13 22:07:08 GMT 2009


At http://bazaar.launchpad.net/%7Ejameinel/bzr-groupcompress/dev5

------------------------------------------------------------
revno: 33
revision-id: john at arbash-meinel.com-20090213220603-5d2k6544y55dd6bi
parent: john at arbash-meinel.com-20090213215721-w7zpcnqe0zoj6fiz
parent: john at arbash-meinel.com-20090213220413-4tc60ow7v7wnh3r1
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: dev5
timestamp: Fri 2009-02-13 16:06:03 -0600
message:
  Bring in the trunk simplifications.
modified:
  repofmt.py                     repofmt.py-20080715094215-wp1qfvoo7093c8qr-1
    ------------------------------------------------------------
    revno: 31.1.1
    revision-id: john at arbash-meinel.com-20090213220413-4tc60ow7v7wnh3r1
    parent: john at arbash-meinel.com-20090213215548-ht1f0gulkobqw1g9
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: trunk
    timestamp: Fri 2009-02-13 16:04:13 -0600
    message:
      Simplify the internals. We've already checked 'chk_support' so we don't need to check again.
    modified:
      repofmt.py                     repofmt.py-20080715094215-wp1qfvoo7093c8qr-1
-------------- next part --------------
=== modified file 'repofmt.py'
--- a/repofmt.py	2009-02-13 21:57:21 +0000
+++ b/repofmt.py	2009-02-13 22:06:03 +0000
@@ -313,22 +313,14 @@
                 _commit_builder_class, _serializer)
             # and now replace everything it did :)
             index_transport = self._transport.clone('indices')
-            if chk_support:
-                self._pack_collection = GCRepositoryPackCollection(self,
-                    self._transport, index_transport,
-                    self._transport.clone('upload'),
-                    self._transport.clone('packs'),
-                    _format.index_builder_class,
-                    _format.index_class,
-                    use_chk_index=self._format.supports_chks,
-                    )
-            else:
-                self._pack_collection = GCRepositoryPackCollection(self,
-                    self._transport, index_transport,
-                    self._transport.clone('upload'),
-                    self._transport.clone('packs'),
-                    _format.index_builder_class,
-                    _format.index_class)
+            self._pack_collection = GCRepositoryPackCollection(self,
+                self._transport, index_transport,
+                self._transport.clone('upload'),
+                self._transport.clone('packs'),
+                _format.index_builder_class,
+                _format.index_class,
+                use_chk_index=self._format.supports_chks,
+                )
             self.inventories = GroupCompressVersionedFiles(
                 _GCGraphIndex(self._pack_collection.inventory_index.combined_index,
                     add_callback=self._pack_collection.inventory_index.add_callback,
@@ -351,19 +343,15 @@
                     add_callback=self._pack_collection.text_index.add_callback,
                     parents=True, is_locked=self.is_locked),
                 access=self._pack_collection.text_index.data_access)
-            if chk_support and _format.supports_chks:
-                # No graph, no compression:- references from chks are between
-                # different objects not temporal versions of the same; and without
-                # some sort of temporal structure knit compression will just fail.
-                self.chk_bytes = GroupCompressVersionedFiles(
-                    _GCGraphIndex(self._pack_collection.chk_index.combined_index,
-                        add_callback=self._pack_collection.chk_index.add_callback,
-                        parents=False, is_locked=self.is_locked),
-                    access=self._pack_collection.chk_index.data_access)
-            else:
-                self.chk_bytes = None
+            assert _format.supports_chks
+            # No parents, individual CHK pages don't have specific ancestry
+            self.chk_bytes = GroupCompressVersionedFiles(
+                _GCGraphIndex(self._pack_collection.chk_index.combined_index,
+                    add_callback=self._pack_collection.chk_index.add_callback,
+                    parents=False, is_locked=self.is_locked),
+                access=self._pack_collection.chk_index.data_access)
             # True when the repository object is 'write locked' (as opposed to the
-            # physical lock only taken out around changes to the pack-names list.) 
+            # physical lock only taken out around changes to the pack-names list.)
             # Another way to represent this would be a decorator around the control
             # files object that presents logical locks as physical ones - if this
             # gets ugly consider that alternative design. RBC 20071011
@@ -437,6 +425,7 @@
             """See RepositoryFormat.get_format_description()."""
             return ("Development repository format - chk+groupcompress")
 
+
     class RepositoryFormatPackGCPlainCHK16(RepositoryFormatPackDevelopment5Hash16):
         """A hashed CHK+group compress pack repository."""
 
@@ -452,9 +441,6 @@
             return ("Development repository format - hash16chk+groupcompress")
 
 
-
-
-
 def pack_incompatible(source, target, orig_method=InterPackRepo.is_compatible):
     """Be incompatible with the regular fetch code."""
     formats = (RepositoryFormatPackGCPlain, RepositoryFormatPackGCRichRoot,



More information about the bazaar-commits mailing list