Rev 3738: Merge in full btree change. in http://people.ubuntu.com/~robertc/baz2.0/repository

Robert Collins robertc at robertcollins.net
Fri Sep 26 00:15:54 BST 2008


At http://people.ubuntu.com/~robertc/baz2.0/repository

------------------------------------------------------------
revno: 3738
revision-id: robertc at robertcollins.net-20080925231543-gt77jso27e4cjvls
parent: robertc at robertcollins.net-20080925064142-prla9jiwsdkfypwp
parent: robertc at robertcollins.net-20080925222509-1cpsw55esrjycw9e
committer: Robert Collins <robertc at robertcollins.net>
branch nick: repository
timestamp: Fri 2008-09-26 09:15:43 +1000
message:
  Merge in full btree change.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
  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/blackbox/test_push.py test_push.py-20060329002750-929af230d5d22663
  bzrlib/tests/test_bzrdir.py    test_bzrdir.py-20060131065654-deba40eef51cf220
  bzrlib/tests/test_pack_repository.py test_pack_repository-20080801043947-eaw0e6h2gu75kwmy-1
  doc/developers/development-repo.txt developmentrepo.txt-20080102200205-raj42k61dch8pjmj-1
    ------------------------------------------------------------
    revno: 3736.1.1
    revision-id: robertc at robertcollins.net-20080925222509-1cpsw55esrjycw9e
    parent: robertc at robertcollins.net-20080925055104-wgdloa74hy8c2l3j
    committer: Robert Collins <robertc at robertcollins.net>
    branch nick: btree-repo
    timestamp: Fri 2008-09-26 08:25:09 +1000
    message:
      Remove 1.5 series dev formats and document development2 a little better.
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
      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/blackbox/test_push.py test_push.py-20060329002750-929af230d5d22663
      bzrlib/tests/test_bzrdir.py    test_bzrdir.py-20060131065654-deba40eef51cf220
      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-09-25 06:41:42 +0000
+++ b/NEWS	2008-09-25 23:15:43 +0000
@@ -84,6 +84,11 @@
 
   API CHANGES:
 
+    * The PackRepository, RepositoryPackCollection, NewPack classes have a
+      slightly changed interface to support different index types; as a
+      result other users of these classes need to supply the index types
+      they want. (Robert Collins)
+
   TESTING:
 
     * ``bzrlib.tests.repository_implementations`` has been renamed to

=== modified file 'bzrlib/branch.py'
--- a/bzrlib/branch.py	2008-09-23 02:16:55 +0000
+++ b/bzrlib/branch.py	2008-09-25 22:25:09 +0000
@@ -36,7 +36,7 @@
         urlutils,
         )
 from bzrlib.config import BranchConfig
-from bzrlib.repofmt.pack_repo import RepositoryFormatPackDevelopment1Subtree
+from bzrlib.repofmt.pack_repo import RepositoryFormatKnitPack5RichRoot
 from bzrlib.tag import (
     BasicTags,
     DisabledTags,
@@ -1346,7 +1346,7 @@
     def __init__(self):
         super(BzrBranchFormat7, self).__init__()
         self._matchingbzrdir.repository_format = \
-            RepositoryFormatPackDevelopment1Subtree()
+            RepositoryFormatKnitPack5RichRoot()
 
     def supports_stacking(self):
         return True

=== modified file 'bzrlib/bzrdir.py'
--- a/bzrlib/bzrdir.py	2008-09-25 05:51:04 +0000
+++ b/bzrlib/bzrdir.py	2008-09-25 22:25:09 +0000
@@ -3077,31 +3077,9 @@
     alias=True,
     )
 # And the development formats above will have aliased one of the following:
-format_registry.register_metadir('development1',
-    'bzrlib.repofmt.pack_repo.RepositoryFormatPackDevelopment1',
-    help='A branch and pack based repository that supports stacking. '
-        '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=True,
-    experimental=True,
-    )
-format_registry.register_metadir('development1-subtree',
-    'bzrlib.repofmt.pack_repo.RepositoryFormatPackDevelopment1Subtree',
-    help='A branch and pack based repository that supports stacking. '
-        '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=True,
-    experimental=True,
-    )
 format_registry.register_metadir('development2',
     'bzrlib.repofmt.pack_repo.RepositoryFormatPackDevelopment2',
-    help='pack-1.6.1 with B+Tree based index. '
+    help='1.6.1 with B+Tree based index. '
         'Please read '
         'http://doc.bazaar-vcs.org/latest/developers/development-repo.html '
         'before use.',
@@ -3112,7 +3090,7 @@
     )
 format_registry.register_metadir('development2-subtree',
     'bzrlib.repofmt.pack_repo.RepositoryFormatPackDevelopment2Subtree',
-    help='pack-1.6.1-subtree with B+Tree based index. '
+    help='1.6.1-subtree with B+Tree based index. '
         'Please read '
         'http://doc.bazaar-vcs.org/latest/developers/development-repo.html '
         'before use.',

=== modified file 'bzrlib/repofmt/pack_repo.py'
--- a/bzrlib/repofmt/pack_repo.py	2008-09-25 06:41:42 +0000
+++ b/bzrlib/repofmt/pack_repo.py	2008-09-25 23:15:43 +0000
@@ -2113,7 +2113,7 @@
     index_class = GraphIndex
 
     def _get_matching_bzrdir(self):
-        return bzrdir.format_registry.make_bzrdir('development1')
+        return bzrdir.format_registry.make_bzrdir('1.6')
 
     def _ignore_setting_bzrdir(self, format):
         pass
@@ -2199,7 +2199,7 @@
 
     def _get_matching_bzrdir(self):
         return bzrdir.format_registry.make_bzrdir(
-            'development1-subtree')
+            '1.6.1-rich-root')
 
     def _ignore_setting_bzrdir(self, format):
         pass
@@ -2220,91 +2220,6 @@
                 " (deprecated)")
 
 
-class RepositoryFormatPackDevelopment1(RepositoryFormatPack):
-    """A no-subtrees development repository.
-
-    This format should be retained until the second release after bzr 1.5.
-
-    Supports external lookups, which results in non-truncated ghosts after
-    reconcile compared to pack-0.92 formats.
-    """
-
-    repository_class = KnitPackRepository
-    _commit_builder_class = PackCommitBuilder
-    _serializer = xml5.serializer_v5
-    supports_external_lookups = True
-    # What index classes to use
-    index_builder_class = InMemoryGraphIndex
-    index_class = GraphIndex
-
-    def _get_matching_bzrdir(self):
-        return bzrdir.format_registry.make_bzrdir('development1')
-
-    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 development format 1 (needs bzr.dev from before 1.6)\n"
-
-    def get_format_description(self):
-        """See RepositoryFormat.get_format_description()."""
-        return ("Development repository format, currently the same as "
-            "pack-0.92 with external reference support.\n")
-
-    def check_conversion_target(self, target_format):
-        pass
-
-
-class RepositoryFormatPackDevelopment1Subtree(RepositoryFormatPack):
-    """A subtrees development repository.
-
-    This format should be retained until the second release after bzr 1.5.
-
-    Supports external lookups, which results in non-truncated ghosts after
-    reconcile compared to pack-0.92 formats.
-    """
-
-    repository_class = KnitPackRepository
-    _commit_builder_class = PackRootCommitBuilder
-    rich_root_data = True
-    supports_tree_reference = True
-    _serializer = xml7.serializer_v7
-    supports_external_lookups = True
-    # What index classes to use
-    index_builder_class = InMemoryGraphIndex
-    index_class = GraphIndex
-
-    def _get_matching_bzrdir(self):
-        return bzrdir.format_registry.make_bzrdir(
-            'development1-subtree')
-
-    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)
-        if not getattr(target_format, 'supports_tree_reference', False):
-            raise errors.BadConversionTarget(
-                'Does not support nested trees', target_format)
-            
-    def get_format_string(self):
-        """See RepositoryFormat.get_format_string()."""
-        return ("Bazaar development format 1 with subtree support "
-            "(needs bzr.dev from before 1.6)\n")
-
-    def get_format_description(self):
-        """See RepositoryFormat.get_format_description()."""
-        return ("Development repository format, currently the same as "
-            "pack-0.92-subtree with external reference support.\n")
-
-
 class RepositoryFormatPackDevelopment2(RepositoryFormatPack):
     """A no-subtrees development repository.
 
@@ -2336,7 +2251,7 @@
     def get_format_description(self):
         """See RepositoryFormat.get_format_description()."""
         return ("Development repository format, currently the same as "
-            "pack-1.6.1 with B+Trees.\n")
+            "1.6.1 with B+Trees.\n")
 
     def check_conversion_target(self, target_format):
         pass
@@ -2347,7 +2262,7 @@
 
     This format should be retained until the second release after bzr 1.7.
 
-    pack-1.6.1-subtree with B+Tree indices.
+    1.6.1-subtree[as it might have been] with B+Tree indices.
     """
 
     repository_class = KnitPackRepository
@@ -2385,4 +2300,4 @@
     def get_format_description(self):
         """See RepositoryFormat.get_format_description()."""
         return ("Development repository format, currently the same as "
-            "pack-1.6.1-subtree with B+Tree indices.\n")
+            "1.6.1-subtree with B+Tree indices.\n")

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2008-09-25 06:41:42 +0000
+++ b/bzrlib/repository.py	2008-09-25 23:15:43 +0000
@@ -2329,18 +2329,6 @@
     )
 
 # Development formats. 
-# 1.5->1.6
-format_registry.register_lazy(
-    "Bazaar development format 1 (needs bzr.dev from before 1.6)\n",
-    'bzrlib.repofmt.pack_repo',
-    'RepositoryFormatPackDevelopment1',
-    )
-format_registry.register_lazy(
-    ("Bazaar development format 1 with subtree support "
-        "(needs bzr.dev from before 1.6)\n"),
-    'bzrlib.repofmt.pack_repo',
-    'RepositoryFormatPackDevelopment1Subtree',
-    )
 # 1.7->1.8 go below here
 format_registry.register_lazy(
     "Bazaar development format 2 (needs bzr.dev from before 1.8)\n",
@@ -2936,13 +2924,13 @@
                 RepositoryFormatKnitPack4,
                 RepositoryFormatKnitPack5,
                 RepositoryFormatKnitPack5RichRoot,
-                RepositoryFormatPackDevelopment1,
-                RepositoryFormatPackDevelopment1Subtree,
+                RepositoryFormatPackDevelopment2,
+                RepositoryFormatPackDevelopment2Subtree,
                 )
             norichroot = (
                 RepositoryFormatKnit1,            # no rr, no subtree
                 RepositoryFormatKnitPack1,        # no rr, no subtree
-                RepositoryFormatPackDevelopment1, # no rr, no subtree
+                RepositoryFormatPackDevelopment2, # no rr, no subtree
                 RepositoryFormatKnitPack5,        # no rr, no subtree
                 )
             richroot = (
@@ -2950,7 +2938,7 @@
                 RepositoryFormatKnitPack3,        # rr, subtree
                 RepositoryFormatKnitPack4,        # rr, no subtree
                 RepositoryFormatKnitPack5RichRoot,# rr, no subtree
-                RepositoryFormatPackDevelopment1Subtree, # rr, subtree
+                RepositoryFormatPackDevelopment2Subtree, # rr, subtree
                 )
             for format in norichroot:
                 if format.rich_root_data:

=== modified file 'bzrlib/tests/blackbox/test_info.py'
--- a/bzrlib/tests/blackbox/test_info.py	2008-08-29 05:18:56 +0000
+++ b/bzrlib/tests/blackbox/test_info.py	2008-09-25 22:25:09 +0000
@@ -1376,13 +1376,13 @@
     def test_info_stacked(self):
         # We have a mainline
         trunk_tree = self.make_branch_and_tree('mainline',
-            format='development1')
+            format='1.6')
         trunk_tree.commit('mainline')
         # and a branch from it which is stacked
         new_dir = trunk_tree.bzrdir.sprout('newbranch', stacked=True)
         out, err = self.run_bzr('info newbranch')
         self.assertEqual(
-"""Standalone tree (format: development1)
+"""Standalone tree (format: 1.6)
 Location:
   branch root: newbranch
 

=== modified file 'bzrlib/tests/blackbox/test_push.py'
--- a/bzrlib/tests/blackbox/test_push.py	2008-08-23 17:57:41 +0000
+++ b/bzrlib/tests/blackbox/test_push.py	2008-09-25 22:25:09 +0000
@@ -343,9 +343,9 @@
         self.assertFalse(self.get_transport('published').has('.'))
 
     def test_push_notifies_default_stacking(self):
-        self.make_branch('stack_on', format='development1')
+        self.make_branch('stack_on', format='1.6')
         self.make_bzrdir('.').get_config().set_default_stack_on('stack_on')
-        self.make_branch('from', format='development1')
+        self.make_branch('from', format='1.6')
         out, err = self.run_bzr('push -d from to')
         self.assertContainsRe(err,
                               'Using default stacking branch stack_on at .*')

=== modified file 'bzrlib/tests/test_bzrdir.py'
--- a/bzrlib/tests/test_bzrdir.py	2008-09-02 15:28:44 +0000
+++ b/bzrlib/tests/test_bzrdir.py	2008-09-25 22:25:09 +0000
@@ -442,7 +442,7 @@
         self.assertEqual(parent_bzrdir.root_transport.base,
                          repo_policy._stack_on_pwd)
 
-    def prepare_default_stacking(self, child_format='development1'):
+    def prepare_default_stacking(self, child_format='1.6'):
         parent_bzrdir = self.make_bzrdir('.')
         child_branch = self.make_branch('child', format=child_format)
         parent_bzrdir.get_config().set_default_stack_on(child_branch.base)
@@ -507,28 +507,28 @@
         self.assertTrue(repo.supports_rich_root())
 
     def test_add_fallback_repo_handles_absolute_urls(self):
-        stack_on = self.make_branch('stack_on', format='development1')
-        repo = self.make_repository('repo', format='development1')
+        stack_on = self.make_branch('stack_on', format='1.6')
+        repo = self.make_repository('repo', format='1.6')
         policy = bzrdir.UseExistingRepository(repo, stack_on.base)
         policy._add_fallback(repo)
 
     def test_add_fallback_repo_handles_relative_urls(self):
-        stack_on = self.make_branch('stack_on', format='development1')
-        repo = self.make_repository('repo', format='development1')
+        stack_on = self.make_branch('stack_on', format='1.6')
+        repo = self.make_repository('repo', format='1.6')
         policy = bzrdir.UseExistingRepository(repo, '.', stack_on.base)
         policy._add_fallback(repo)
 
     def test_configure_relative_branch_stacking_url(self):
-        stack_on = self.make_branch('stack_on', format='development1')
-        stacked = self.make_branch('stack_on/stacked', format='development1')
+        stack_on = self.make_branch('stack_on', format='1.6')
+        stacked = self.make_branch('stack_on/stacked', format='1.6')
         policy = bzrdir.UseExistingRepository(stacked.repository,
             '.', stack_on.base)
         policy.configure_branch(stacked)
         self.assertEqual('..', stacked.get_stacked_on_url())
 
     def test_relative_branch_stacking_to_absolute(self):
-        stack_on = self.make_branch('stack_on', format='development1')
-        stacked = self.make_branch('stack_on/stacked', format='development1')
+        stack_on = self.make_branch('stack_on', format='1.6')
+        stacked = self.make_branch('stack_on/stacked', format='1.6')
         policy = bzrdir.UseExistingRepository(stacked.repository,
             '.', self.get_readonly_url('stack_on'))
         policy.configure_branch(stacked)

=== modified file 'bzrlib/tests/test_pack_repository.py'
--- a/bzrlib/tests/test_pack_repository.py	2008-09-25 05:51:04 +0000
+++ b/bzrlib/tests/test_pack_repository.py	2008-09-25 22:25:09 +0000
@@ -630,16 +630,6 @@
                   "(bzr 1.6.1)\n",
               format_supports_external_lookups=True,
               index_class=GraphIndex),
-         dict(format_name='development1',
-              format_string="Bazaar development format 1 "
-                  "(needs bzr.dev from before 1.6)\n",
-              format_supports_external_lookups=True,
-              index_class=GraphIndex),
-         dict(format_name='development1-subtree',
-              format_string="Bazaar development format 1 "
-                  "with subtree support (needs bzr.dev from before 1.6)\n",
-              format_supports_external_lookups=True,
-              index_class=GraphIndex),
          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-08-28 06:26:43 +0000
+++ b/doc/developers/development-repo.txt	2008-09-25 22:25:09 +0000
@@ -226,17 +226,18 @@
 development
 -----------
 
-Currently an alias for Development1
+Currently an alias for Development2
 
 development-subtree
 -------------------
 
-Currently an alias for Development1Subtree
+Currently an alias for Development2Subtree
 
-Development1[Subtree]
+Development2[Subtree]
 ---------------------
 
-These formats were introduced during the development of branch stacking.
+These formats use B+Tree indices which are considerably faster than
+the earlier indices in bzr.
 
 
 ..




More information about the bazaar-commits mailing list