Rev 49: Start a quick experimentation with a different 'diff' algorithm. in http://bzr.arbash-meinel.com/plugins/groupcompress_rabin

John Arbash Meinel john at arbash-meinel.com
Thu Feb 26 04:17:26 GMT 2009


At http://bzr.arbash-meinel.com/plugins/groupcompress_rabin

------------------------------------------------------------
revno: 49
revision-id: john at arbash-meinel.com-20090226041719-oi3d5putp8s2r233
parent: john at arbash-meinel.com-20090225230422-4oigw03k7fq62eyb
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: groupcompress_rabin
timestamp: Wed 2009-02-25 22:17:19 -0600
message:
  Start a quick experimentation with a different 'diff' algorithm.
-------------- next part --------------
=== modified file '__init__.py'
--- a/__init__.py	2009-02-17 19:35:38 +0000
+++ b/__init__.py	2009-02-26 04:17:19 +0000
@@ -35,38 +35,14 @@
 
 from bzrlib.bzrdir import format_registry
 from bzrlib.repository import format_registry as repo_registry
-format_registry.register_metadir('gc-plain',
-    'bzrlib.plugins.groupcompress.repofmt.RepositoryFormatPackGCPlain',
+format_registry.register_metadir('gcr',
+    'bzrlib.plugins.groupcompress_rabin.repofmt.RepositoryFormatPackGCRabin',
     help='pack-0.92 with btree index and group compress. '
         'Please read '
         'http://doc.bazaar-vcs.org/latest/developers/development-repo.html '
         'before use.',
     branch_format='bzrlib.branch.BzrBranchFormat7',
-    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
-    hidden=False,
-    experimental=True,
-    )
-
-format_registry.register_metadir('gc-rich-root',
-    'bzrlib.plugins.groupcompress.repofmt.RepositoryFormatPackGCRichRoot',
-    help='rich-root-pack with btree index and group compress. '
-        'Please read '
-        'http://doc.bazaar-vcs.org/latest/developers/development-repo.html '
-        'before use.',
-    branch_format='bzrlib.branch.BzrBranchFormat7',
-    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
-    hidden=False,
-    experimental=True,
-    )
-
-format_registry.register_metadir('gc-subtrees',
-    'bzrlib.plugins.groupcompress.repofmt.RepositoryFormatPackGCSubtrees',
-    help='pack-0.92-subtress with btree index and group compress. '
-        'Please read '
-        'http://doc.bazaar-vcs.org/latest/developers/development-repo.html '
-        'before use.',
-    branch_format='bzrlib.branch.BzrBranchFormat7',
-    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
+    tree_format='bzrlib.workingtree.WorkingTreeFormat5',
     hidden=False,
     experimental=True,
     )
@@ -77,25 +53,10 @@
     from bzrlib.repofmt.pack_repo import (
     RepositoryFormatPackDevelopment5,
     RepositoryFormatPackDevelopment5Hash16,
+    RepositoryFormatPackDevelopment5Hash255,
     )
-    format_registry.register_metadir('gc-plain-chk',
-        'bzrlib.plugins.groupcompress.repofmt.RepositoryFormatPackGCPlainCHK',
-        help='pack-1.9 with CHK inv and group compress. '
-            'Please read '
-            'http://doc.bazaar-vcs.org/latest/developers/development-repo.html '
-            'before use.',
-        branch_format='bzrlib.branch.BzrBranchFormat7',
-        tree_format='bzrlib.workingtree.WorkingTreeFormat5',
-        hidden=False,
-        experimental=True,
-        )
-    repo_registry.register_lazy(
-        'Bazaar development format - chk+gc (needs bzr.dev from 1.13)\n',
-        'bzrlib.plugins.groupcompress.repofmt',
-        'RepositoryFormatPackGCPlainCHK',
-        )
-    format_registry.register_metadir('gc-plain-chk16',
-        'bzrlib.plugins.groupcompress.repofmt.RepositoryFormatPackGCPlainCHK16',
+    format_registry.register_metadir('gcr-chk16',
+        'bzrlib.plugins.groupcompress.repofmt.RepositoryFormatPackGCRabinCHK16',
         help='pack-1.9 with 16-way hashed CHK inv and group compress. '
             'Please read '
             'http://doc.bazaar-vcs.org/latest/developers/development-repo.html '
@@ -106,12 +67,12 @@
         experimental=True,
         )
     repo_registry.register_lazy(
-        'Bazaar development format - hash16chk+gc (needs bzr.dev from 1.13)\n',
+        'Bazaar development format - hash16chk+gcr (needs bzr.dev from 1.13)\n',
         'bzrlib.plugins.groupcompress.repofmt',
-        'RepositoryFormatPackGCPlainCHK16',
+        'RepositoryFormatPackGCRabinCHK16',
         )
-    format_registry.register_metadir('gc-plain-chk255',
-        'bzrlib.plugins.groupcompress.repofmt.RepositoryFormatPackGCPlainCHK255',
+    format_registry.register_metadir('gcr-chk255',
+        'bzrlib.plugins.groupcompress.repofmt.RepositoryFormatPackGCRabinCHK255',
         help='pack-1.9 with 255-way hashed CHK inv and group compress. '
             'Please read '
             'http://doc.bazaar-vcs.org/latest/developers/development-repo.html '
@@ -122,39 +83,21 @@
         experimental=True,
         )
     repo_registry.register_lazy(
-        'Bazaar development format - hash255chk+gc (needs bzr.dev from 1.13)\n',
+        'Bazaar development format - hash255chk+gcr (needs bzr.dev from 1.13)\n',
         'bzrlib.plugins.groupcompress.repofmt',
-        'RepositoryFormatPackGCPlainCHK255',
+        'RepositoryFormatPackGCRabinCHK255',
         )
 except ImportError:
     pass
 
 repo_registry.register_lazy(
-    'Bazaar development format - btree+gc (needs bzr.dev from 1.6)\n',
-    'bzrlib.plugins.groupcompress.repofmt',
-    'RepositoryFormatPackGCPlain',
-    )
-repo_registry.register_lazy(
-    'Bazaar development format - btree+gc-rich-root (needs bzr.dev from 1.6)\n',
-    'bzrlib.plugins.groupcompress.repofmt',
-    'RepositoryFormatPackGCRichRoot',
-    )
-repo_registry.register_lazy(
-    'Bazaar development format - btree+gc-subtrees (needs bzr.dev from 1.6)\n',
-    'bzrlib.plugins.groupcompress.repofmt',
-    'RepositoryFormatPackGCSubtrees',
-    )
-
-
-
-def test_suite():
-    # Thunk across to load_tests for niceness with older bzr versions
-    from bzrlib.tests import TestLoader
-    loader = TestLoader()
-    return loader.loadTestsFromModuleNames(['bzrlib.plugins.groupcompress'])
+    'Bazaar development format - btree+gcr (needs bzr.dev from 1.13)\n',
+    'bzrlib.plugins.groupcompress.repofmt',
+    'RepositoryFormatPackGCRabin',
+    )
 
 
 def load_tests(standard_tests, module, loader):
     standard_tests.addTests(loader.loadTestsFromModuleNames(
-        ['bzrlib.plugins.groupcompress.tests']))
+        ['bzrlib.plugins.groupcompress_rabin.tests']))
     return standard_tests

=== modified file 'repofmt.py'
--- a/repofmt.py	2009-02-25 23:04:22 +0000
+++ b/repofmt.py	2009-02-26 04:17:19 +0000
@@ -34,7 +34,7 @@
     )
 from bzrlib.index import GraphIndex, GraphIndexBuilder
 from bzrlib.repository import InterPackRepo
-from bzrlib.plugins.groupcompress.groupcompress import (
+from bzrlib.plugins.groupcompress_rabin.groupcompress import (
     _GCGraphIndex,
     GroupCompressVersionedFiles,
     )
@@ -329,7 +329,7 @@
 
 
 
-class GCPackRepository(KnitPackRepository):
+class GCRPackRepository(KnitPackRepository):
     """GC customisation of KnitPackRepository."""
 
     def __init__(self, _format, a_bzrdir, control_files, _commit_builder_class,
@@ -411,7 +411,7 @@
 
 
 if chk_support:
-    class GCCHKPackRepository(CHKInventoryRepository):
+    class GCRCHKPackRepository(CHKInventoryRepository):
         """GC customisation of CHKInventoryRepository."""
 
         def __init__(self, _format, a_bzrdir, control_files, _commit_builder_class,
@@ -474,15 +474,15 @@
             self._fetch_uses_deltas = False
 
 
-class RepositoryFormatPackGCPlain(RepositoryFormatPackDevelopment2):
+class RepositoryFormatPackGCRabin(RepositoryFormatPackDevelopment2):
     """A B+Tree index using pack repository."""
 
-    repository_class = GCPackRepository
+    repository_class = GCRPackRepository
 
     def get_format_string(self):
         """See RepositoryFormat.get_format_string()."""
-        return ("Bazaar development format - btree+gc "
-            "(needs bzr.dev from 1.6)\n")
+        return ("Bazaar development format - btree+gcr "
+            "(needs bzr.dev from 1.13)\n")
 
     def get_format_description(self):
         """See RepositoryFormat.get_format_description()."""
@@ -490,61 +490,15 @@
             ", interoperates with pack-0.92\n")
 
 
-class RepositoryFormatPackGCRichRoot(RepositoryFormatKnitPack4):
-    """A B+Tree index using pack repository."""
-
-    repository_class = GCPackRepository
-
-    def get_format_string(self):
-        """See RepositoryFormat.get_format_string()."""
-        return ("Bazaar development format - btree+gc-rich-root "
-            "(needs bzr.dev from 1.6)\n")
-
-    def get_format_description(self):
-        """See RepositoryFormat.get_format_description()."""
-        return ("Development repository format - btree+groupcompress "
-            ", interoperates with rich-root-pack\n")
-
-
-class RepositoryFormatPackGCSubtrees(RepositoryFormatPackDevelopment2Subtree):
-    """A B+Tree index using pack repository."""
-
-    repository_class = GCPackRepository
-
-    def get_format_string(self):
-        """See RepositoryFormat.get_format_string()."""
-        return ("Bazaar development format - btree+gc-subtrees "
-            "(needs bzr.dev from 1.6)\n")
-
-    def get_format_description(self):
-        """See RepositoryFormat.get_format_description()."""
-        return ("Development repository format - btree+groupcompress "
-            ", interoperates with pack-0.92-subtrees\n")
-
 if chk_support:
-    class RepositoryFormatPackGCPlainCHK(RepositoryFormatPackDevelopment5):
-        """A CHK+group compress pack repository."""
-
-        repository_class = GCCHKPackRepository
-
-        def get_format_string(self):
-            """See RepositoryFormat.get_format_string()."""
-            return ('Bazaar development format - chk+gc'
-                    ' (needs bzr.dev from 1.13)\n')
-
-        def get_format_description(self):
-            """See RepositoryFormat.get_format_description()."""
-            return ("Development repository format - chk+groupcompress")
-
-
-    class RepositoryFormatPackGCPlainCHK16(RepositoryFormatPackDevelopment5Hash16):
+    class RepositoryFormatPackGCRabinCHK16(RepositoryFormatPackDevelopment5Hash16):
         """A hashed CHK+group compress pack repository."""
 
-        repository_class = GCCHKPackRepository
+        repository_class = GCRCHKPackRepository
 
         def get_format_string(self):
             """See RepositoryFormat.get_format_string()."""
-            return ('Bazaar development format - hash16chk+gc'
+            return ('Bazaar development format - hash16chk+gcr'
                     ' (needs bzr.dev from 1.13)\n')
 
         def get_format_description(self):
@@ -552,14 +506,14 @@
             return ("Development repository format - hash16chk+groupcompress")
 
 
-    class RepositoryFormatPackGCPlainCHK255(RepositoryFormatPackDevelopment5Hash255):
+    class RepositoryFormatPackGCRabinCHK255(RepositoryFormatPackDevelopment5Hash255):
         """A hashed CHK+group compress pack repository."""
 
-        repository_class = GCCHKPackRepository
+        repository_class = GCRCHKPackRepository
 
         def get_format_string(self):
             """See RepositoryFormat.get_format_string()."""
-            return ('Bazaar development format - hash255chk+gc'
+            return ('Bazaar development format - hash255chk+gcr'
                     ' (needs bzr.dev from 1.13)\n')
 
         def get_format_description(self):
@@ -569,12 +523,10 @@
 
 def pack_incompatible(source, target, orig_method=InterPackRepo.is_compatible):
     """Be incompatible with the regular fetch code."""
-    formats = (RepositoryFormatPackGCPlain, RepositoryFormatPackGCRichRoot,
-        RepositoryFormatPackGCSubtrees)
+    formats = (RepositoryFormatPackGCRabin,)
     if chk_support:
-        formats = formats + (RepositoryFormatPackGCPlainCHK,
-                             RepositoryFormatPackGCPlainCHK16,
-                             RepositoryFormatPackGCPlainCHK255)
+        formats = formats + (RepositoryFormatPackGCRabinCHK16,
+                             RepositoryFormatPackGCRabinCHK255)
     if isinstance(source._format, formats) or isinstance(target._format, formats):
         return False
     else:



More information about the bazaar-commits mailing list