Rev 3816: (mbp) add 1.9 format in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Oct 31 08:28:00 GMT 2008


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 3816
revision-id: pqm at pqm.ubuntu.com-20081031082755-98a92xsyhx8m7r80
parent: pqm at pqm.ubuntu.com-20081031043904-52fnbfrloojemvcc
parent: mbp at sourcefrog.net-20081031074509-gd3xilkr2gf0g7hk
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2008-10-31 08:27:55 +0000
message:
  (mbp) add 1.9 format
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/blackbox/test_info.py test_info.py-20060215045507-bbdd2d34efab9e0a
  bzrlib/tests/test_info.py      test_info.py-20070320150933-m0xxm1g7xi9v6noe-1
  bzrlib/tests/test_pack_repository.py test_pack_repository-20080801043947-eaw0e6h2gu75kwmy-1
  doc/developers/development-repo.txt developmentrepo.txt-20080102200205-raj42k61dch8pjmj-1
    ------------------------------------------------------------
    revno: 3805.3.3
    revision-id: mbp at sourcefrog.net-20081031074509-gd3xilkr2gf0g7hk
    parent: mbp at sourcefrog.net-20081031042622-6vyns85ahos19ofm
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: format-1.9
    timestamp: Fri 2008-10-31 18:45:09 +1100
    message:
      Update info tests for new 1.9 format combo
    modified:
      bzrlib/tests/blackbox/test_info.py test_info.py-20060215045507-bbdd2d34efab9e0a
      bzrlib/tests/test_info.py      test_info.py-20070320150933-m0xxm1g7xi9v6noe-1
    ------------------------------------------------------------
    revno: 3805.3.2
    revision-id: mbp at sourcefrog.net-20081031042622-6vyns85ahos19ofm
    parent: john at arbash-meinel.com-20081028221931-uk9oan2xkocd0gis
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: integration
    timestamp: Fri 2008-10-31 15:26:22 +1100
    message:
      Update news about new format
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
    ------------------------------------------------------------
    revno: 3805.3.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
=== modified file 'NEWS'
--- a/NEWS	2008-10-31 04:39:04 +0000
+++ b/NEWS	2008-10-31 08:27:55 +0000
@@ -14,6 +14,11 @@
     * 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.
+      These indexes are both smaller and faster for access to historical
+      information.  (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-31 01:59:31 +0000
+++ b/bzrlib/repofmt/pack_repo.py	2008-10-31 08:27:55 +0000
@@ -2316,6 +2316,87 @@
                 " (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.
+
+    This format should be retained until the second release after bzr 1.7.
+
+    1.6.1-subtree[as it might have been] 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-31 01:14:22 +0000
+++ b/bzrlib/repository.py	2008-10-31 08:27:55 +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
@@ -2965,6 +2975,8 @@
                 RepositoryFormatKnitPack4,
                 RepositoryFormatKnitPack5,
                 RepositoryFormatKnitPack5RichRoot,
+                RepositoryFormatKnitPack6,
+                RepositoryFormatKnitPack6RichRoot,
                 RepositoryFormatPackDevelopment2,
                 RepositoryFormatPackDevelopment2Subtree,
                 )
@@ -2973,12 +2985,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/blackbox/test_info.py'
--- a/bzrlib/tests/blackbox/test_info.py	2008-09-25 22:25:09 +0000
+++ b/bzrlib/tests/blackbox/test_info.py	2008-10-31 07:45:09 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2006, 2007 Canonical Ltd
+# Copyright (C) 2006, 2007, 2008 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
@@ -248,6 +248,7 @@
         out, err = self.run_bzr('info -v lightcheckout')
         self.assertEqualDiff(
 """Lightweight checkout (format: 1.6 or 1.6.1-rich-root \
+or 1.9 or 1.9-rich-root \
 or dirstate or dirstate-tags or \
 pack-0.92 or rich-root or rich-root-pack)
 Location:
@@ -416,6 +417,7 @@
         out, err = self.run_bzr('info lightcheckout --verbose')
         self.assertEqualDiff(
 """Lightweight checkout (format: 1.6 or 1.6.1-rich-root or \
+1.9 or 1.9-rich-root or \
 dirstate or dirstate-tags or \
 pack-0.92 or rich-root or rich-root-pack)
 Location:
@@ -553,6 +555,7 @@
         out, err = self.run_bzr('info tree/lightcheckout --verbose')
         self.assertEqualDiff(
 """Lightweight checkout (format: 1.6 or 1.6.1-rich-root or \
+1.9 or 1.9-rich-root or \
 dirstate or dirstate-tags or \
 pack-0.92 or rich-root or rich-root-pack)
 Location:
@@ -677,6 +680,7 @@
         out, err = self.run_bzr('info tree/lightcheckout --verbose')
         self.assertEqualDiff(
 """Lightweight checkout (format: 1.6 or 1.6.1-rich-root or \
+1.9 or 1.9-rich-root or \
 dirstate or dirstate-tags or \
 pack-0.92 or rich-root or rich-root-pack)
 Location:
@@ -1093,6 +1097,7 @@
             (False, False): 'Checkout',
             }[(shared_repo is not None, light_checkout)]
         format = {True: '1.6 or 1.6.1-rich-root'
+                        ' or 1.9 or 1.9-rich-root'
                         ' or dirstate or dirstate-tags or pack-0.92'
                         ' or rich-root or rich-root-pack',
                   False: 'dirstate'}[light_checkout]

=== modified file 'bzrlib/tests/test_info.py'
--- a/bzrlib/tests/test_info.py	2008-08-29 05:18:56 +0000
+++ b/bzrlib/tests/test_info.py	2008-10-31 07:45:09 +0000
@@ -146,8 +146,10 @@
             expected = None
             if key in ('dirstate', 'dirstate-tags', 'dirstate-with-subtree',
                 'pack-0.92', 'pack-0.92-subtree', 'rich-root',
-                'rich-root-pack', '1.6', '1.6.1-rich-root'):
+                'rich-root-pack', '1.6', '1.6.1-rich-root',
+                '1.9', '1.9-rich-root'):
                 expected = '1.6 or 1.6.1-rich-root or ' \
+                    '1.9 or 1.9-rich-root or ' \
                     'dirstate or dirstate-tags or pack-0.92 or'\
                     ' rich-root or rich-root-pack'
             if key in ('knit', 'metaweave'):

=== modified file 'bzrlib/tests/test_pack_repository.py'
--- a/bzrlib/tests/test_pack_repository.py	2008-10-31 01:37:43 +0000
+++ b/bzrlib/tests/test_pack_repository.py	2008-10-31 08:27:55 +0000
@@ -691,6 +691,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