Rev 3814: Merge in the repo format 1.9 code. in http://bzr.arbash-meinel.com/branches/bzr/1.9-dev/remote_readv_sections

John Arbash Meinel john at arbash-meinel.com
Wed Oct 29 19:54:31 GMT 2008


At http://bzr.arbash-meinel.com/branches/bzr/1.9-dev/remote_readv_sections

------------------------------------------------------------
revno: 3814
revision-id: john at arbash-meinel.com-20081029195414-4amy3g350618q1iy
parent: john at arbash-meinel.com-20081029193544-6vhuhlahdor8ebr3
parent: john at arbash-meinel.com-20081029175839-9tifdbpcurai4fuk
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: remote_readv_sections
timestamp: Wed 2008-10-29 14:54:14 -0500
message:
  Merge in the repo format 1.9 code.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
  bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
  bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
  bzrlib/tests/test_pack_repository.py test_pack_repository-20080801043947-eaw0e6h2gu75kwmy-1
  doc/developers/development-repo.txt developmentrepo.txt-20080102200205-raj42k61dch8pjmj-1
    ------------------------------------------------------------
    revno: 3805.1.2
    revision-id: john at arbash-meinel.com-20081029175839-9tifdbpcurai4fuk
    parent: john at arbash-meinel.com-20081028221931-uk9oan2xkocd0gis
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: repo_format_1.9
    timestamp: Wed 2008-10-29 12:58:39 -0500
    message:
      Fix a docstring.
    modified:
      bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
    ------------------------------------------------------------
    revno: 3805.1.1
    revision-id: john at arbash-meinel.com-20081028221931-uk9oan2xkocd0gis
    parent: pqm at pqm.ubuntu.com-20081028202057-u3csau9zvf0hapya
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: repo_format_1.9
    timestamp: Tue 2008-10-28 17:19:31 -0500
    message:
      Add repository 1.9 format, and update the documentation.
      
      Help people generating new repository formats find all the locations
      they need to update.
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
      bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
      bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
      bzrlib/tests/test_pack_repository.py test_pack_repository-20080801043947-eaw0e6h2gu75kwmy-1
      doc/developers/development-repo.txt developmentrepo.txt-20080102200205-raj42k61dch8pjmj-1
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2008-10-28 19:43:42 +0000
+++ b/NEWS	2008-10-28 22:19:31 +0000
@@ -14,6 +14,10 @@
     * New Branch hook ``transform_fallback_location`` allows a function to
       be called when looking up the stacked source. (Michael Hudson)
 
+    * New repository formats ``1.9`` and ``1.9-rich-root``. These have all
+      the functionality of ``1.6``, but use the new btree indexes.
+      (John Arbash Meinel)
+
   IMPROVEMENTS:
 
     * ``BTreeIndex`` code now is able to prefetch extra pages to help tune

=== modified file 'bzrlib/bzrdir.py'
--- a/bzrlib/bzrdir.py	2008-10-01 05:40:45 +0000
+++ b/bzrlib/bzrdir.py	2008-10-28 22:19:31 +0000
@@ -3047,6 +3047,19 @@
     branch_format='bzrlib.branch.BzrBranchFormat7',
     tree_format='bzrlib.workingtree.WorkingTreeFormat4',
     )
+format_registry.register_metadir('1.9',
+    'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack6',
+    help='A branch and pack based repository that uses btree indexes. ',
+    branch_format='bzrlib.branch.BzrBranchFormat7',
+    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
+    )
+format_registry.register_metadir('1.9-rich-root',
+    'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack6RichRoot',
+    help='A branch and pack based repository that uses btree indexes '
+         'and rich root data (needed for bzr-svn). ',
+    branch_format='bzrlib.branch.BzrBranchFormat7',
+    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
+    )
 # The following two formats should always just be aliases.
 format_registry.register_metadir('development',
     'bzrlib.repofmt.pack_repo.RepositoryFormatPackDevelopment2',

=== modified file 'bzrlib/repofmt/pack_repo.py'
--- a/bzrlib/repofmt/pack_repo.py	2008-10-28 17:41:35 +0000
+++ b/bzrlib/repofmt/pack_repo.py	2008-10-29 17:58:39 +0000
@@ -2316,6 +2316,85 @@
                 " (deprecated)")
 
 
+class RepositoryFormatKnitPack6(RepositoryFormatPack):
+    """A repository with stacking and btree indexes,
+    without rich roots or subtrees.
+
+    This is equivalent to pack-1.6 with B+Tree indices.
+    """
+
+    repository_class = KnitPackRepository
+    _commit_builder_class = PackCommitBuilder
+    supports_external_lookups = True
+    # What index classes to use
+    index_builder_class = BTreeBuilder
+    index_class = BTreeGraphIndex
+
+    @property
+    def _serializer(self):
+        return xml5.serializer_v5
+
+    def _get_matching_bzrdir(self):
+        return bzrdir.format_registry.make_bzrdir('1.9')
+
+    def _ignore_setting_bzrdir(self, format):
+        pass
+
+    _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
+
+    def get_format_string(self):
+        """See RepositoryFormat.get_format_string()."""
+        return "Bazaar RepositoryFormatKnitPack6 (bzr 1.9)\n"
+
+    def get_format_description(self):
+        """See RepositoryFormat.get_format_description()."""
+        return "Packs 6 (uses btree indexes, requires bzr 1.9)"
+
+    def check_conversion_target(self, target_format):
+        pass
+
+
+class RepositoryFormatKnitPack6RichRoot(RepositoryFormatPack):
+    """A repository with rich roots, no subtrees, stacking and btree indexes.
+
+    1.6-rich-root with B+Tree indices.
+    """
+
+    repository_class = KnitPackRepository
+    _commit_builder_class = PackRootCommitBuilder
+    rich_root_data = True
+    supports_tree_reference = False # no subtrees
+    supports_external_lookups = True
+    # What index classes to use
+    index_builder_class = BTreeBuilder
+    index_class = BTreeGraphIndex
+
+    @property
+    def _serializer(self):
+        return xml6.serializer_v6
+
+    def _get_matching_bzrdir(self):
+        return bzrdir.format_registry.make_bzrdir(
+            '1.9-rich-root')
+
+    def _ignore_setting_bzrdir(self, format):
+        pass
+
+    _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
+
+    def check_conversion_target(self, target_format):
+        if not target_format.rich_root_data:
+            raise errors.BadConversionTarget(
+                'Does not support rich root data.', target_format)
+
+    def get_format_string(self):
+        """See RepositoryFormat.get_format_string()."""
+        return "Bazaar RepositoryFormatKnitPack6RichRoot (bzr 1.9)\n"
+
+    def get_format_description(self):
+        return "Packs 6 rich-root (uses btree indexes, requires bzr 1.9)"
+
+
 class RepositoryFormatPackDevelopment2(RepositoryFormatPack):
     """A no-subtrees development repository.
 

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2008-10-27 06:15:46 +0000
+++ b/bzrlib/repository.py	2008-10-28 22:19:31 +0000
@@ -2325,6 +2325,16 @@
     'bzrlib.repofmt.pack_repo',
     'RepositoryFormatKnitPack5RichRootBroken',
     )
+format_registry.register_lazy(
+    'Bazaar RepositoryFormatKnitPack6 (bzr 1.9)\n',
+    'bzrlib.repofmt.pack_repo',
+    'RepositoryFormatKnitPack6',
+    )
+format_registry.register_lazy(
+    'Bazaar RepositoryFormatKnitPack6RichRoot (bzr 1.9)\n',
+    'bzrlib.repofmt.pack_repo',
+    'RepositoryFormatKnitPack6RichRoot',
+    )
 
 # Development formats. 
 # 1.7->1.8 go below here
@@ -2950,6 +2960,8 @@
                 RepositoryFormatKnitPack4,
                 RepositoryFormatKnitPack5,
                 RepositoryFormatKnitPack5RichRoot,
+                RepositoryFormatKnitPack6,
+                RepositoryFormatKnitPack6RichRoot,
                 RepositoryFormatPackDevelopment2,
                 RepositoryFormatPackDevelopment2Subtree,
                 )
@@ -2958,12 +2970,14 @@
                 RepositoryFormatKnitPack1,        # no rr, no subtree
                 RepositoryFormatPackDevelopment2, # no rr, no subtree
                 RepositoryFormatKnitPack5,        # no rr, no subtree
+                RepositoryFormatKnitPack6,        # no rr, no subtree
                 )
             richroot = (
                 RepositoryFormatKnit3,            # rr, subtree
                 RepositoryFormatKnitPack3,        # rr, subtree
                 RepositoryFormatKnitPack4,        # rr, no subtree
                 RepositoryFormatKnitPack5RichRoot,# rr, no subtree
+                RepositoryFormatKnitPack6RichRoot,# rr, no subtree
                 RepositoryFormatPackDevelopment2Subtree, # rr, subtree
                 )
             for format in norichroot:

=== modified file 'bzrlib/tests/test_pack_repository.py'
--- a/bzrlib/tests/test_pack_repository.py	2008-10-23 19:39:59 +0000
+++ b/bzrlib/tests/test_pack_repository.py	2008-10-28 22:19:31 +0000
@@ -649,6 +649,15 @@
                   "(bzr 1.6.1)\n",
               format_supports_external_lookups=True,
               index_class=GraphIndex),
+         dict(format_name='1.9',
+              format_string="Bazaar RepositoryFormatKnitPack6 (bzr 1.9)\n",
+              format_supports_external_lookups=True,
+              index_class=BTreeGraphIndex),
+         dict(format_name='1.9-rich-root',
+              format_string="Bazaar RepositoryFormatKnitPack6RichRoot "
+                  "(bzr 1.9)\n",
+              format_supports_external_lookups=True,
+              index_class=BTreeGraphIndex),
          dict(format_name='development2',
               format_string="Bazaar development format 2 "
                   "(needs bzr.dev from before 1.8)\n",

=== modified file 'doc/developers/development-repo.txt'
--- a/doc/developers/development-repo.txt	2008-09-25 22:25:09 +0000
+++ b/doc/developers/development-repo.txt	2008-10-28 22:19:31 +0000
@@ -203,18 +203,36 @@
    ``bzrlib.repofmt``. You probably want to reproduce the current
    development format from ``bzrlib.repofmt.pack_repo`` with just new
    disk format strings, ``_get_matching_bzrdir`` and help.
-4. Alter any other things that do class based tests. The easiest way
+4. Register your development format with the various registries. At the
+   moment you need to update:
+
+    1. ``bzrlib/bzrdir.py`` to register the WT/Branch/Repository
+       collection.
+
+    2. ``bzrlib/workingtree.py``, ``bzrlib/branch.py``,
+       ``bzrlib/repository.py``, each one maintains a direct list of
+       their respective formats.
+
+    3. For repositories, you also need to update the InterKnit1and2
+       class. This is responsible for converting between rich-root and
+       non-rich-root repositories.
+
+    4. For repositories based on KnitPackRepository, you need to update
+       ``bzrlib/tests/test_pack_repository.py`` to add the class to the
+       tested permutations.
+
+5. Alter any other things that do class based tests. The easiest way
    to find these is a grep for Development in bzrlib - and please
    refactor as you find these to reduce the relevance this step has,
    as it should not need to exist.
-5. Now subclass/create from scratch/whatever the live object code you
+6. Now subclass/create from scratch/whatever the live object code you
    need to change to introduce your new format. Keep in mind that
    eventually it will become the default format, so please don't keep
    subclassing the last releases code, rather consider making the last
    releases code a subclass of your new code (if there is a lot in
    common) so that we can eventually remove that format once it becomes
    ancient (or relegate it to a plugin).
-6. Once you have made the changes that required a new disk format, you
+7. Once you have made the changes that required a new disk format, you
    should submit the resulting branch to be merged. Other changes - to
    take advantage of whatever new feature you have added - should be
    sent in separately, because the disk level changes are a contention



More information about the bazaar-commits mailing list