Rev 3570: (mbp) add stable stacked and stacked-rich-root formats in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue Jul 22 10:54:16 BST 2008


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

------------------------------------------------------------
revno: 3570
revision-id:pqm at pqm.ubuntu.com-20080722095403-sdixt0nfim5q3eps
parent: pqm at pqm.ubuntu.com-20080722022519-tu60do9k4tkjmtl4
parent: mbp at sourcefrog.net-20080722090552-02kmodiejqw2zism
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2008-07-22 10:54:03 +0100
message:
  (mbp) add stable stacked and stacked-rich-root formats
modified:
  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
    ------------------------------------------------------------
    revno: 3549.1.6
    revision-id:mbp at sourcefrog.net-20080722090552-02kmodiejqw2zism
    parent: mbp at sourcefrog.net-20080721092225-lnm32309nas4cp91
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: stacking
    timestamp: Tue 2008-07-22 19:05:52 +1000
    message:
      Change stacked-subtree to stacked-rich-root
    modified:
      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
    ------------------------------------------------------------
    revno: 3549.1.5
    revision-id:mbp at sourcefrog.net-20080721092225-lnm32309nas4cp91
    parent: mbp at sourcefrog.net-20080717080025-bd9k6gpkkkntipwr
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: stacking
    timestamp: Mon 2008-07-21 19:22:25 +1000
    message:
      Add stable format names for stacked branches
    modified:
      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
=== modified file 'bzrlib/bzrdir.py'
--- a/bzrlib/bzrdir.py	2008-07-17 08:00:25 +0000
+++ b/bzrlib/bzrdir.py	2008-07-22 09:05:52 +0000
@@ -2973,6 +2973,19 @@
     branch_format='bzrlib.branch.BzrBranchFormat6',
     tree_format='bzrlib.workingtree.WorkingTreeFormat4',
     )
+format_registry.register_metadir('stacked',
+    'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack5',
+    help='A branch and pack based repository that supports stacking. ',
+    branch_format='bzrlib.branch.BzrBranchFormat7',
+    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
+    )
+format_registry.register_metadir('stacked-rich-root',
+    'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack5RichRoot',
+    help='A branch and pack based repository that supports stacking '
+         '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.RepositoryFormatPackDevelopment1',

=== modified file 'bzrlib/repofmt/pack_repo.py'
--- a/bzrlib/repofmt/pack_repo.py	2008-07-16 00:45:57 +0000
+++ b/bzrlib/repofmt/pack_repo.py	2008-07-22 09:05:52 +0000
@@ -2153,6 +2153,80 @@
         return "Packs containing knits with rich root support\n"
 
 
+class RepositoryFormatKnitPack5(RepositoryFormatPack):
+    """Repository that supports external references to allow stacking.
+
+    New in release 1.6.
+
+    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
+
+    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 RepositoryFormatKnitPack5 (bzr 1.6)\n"
+
+    def get_format_description(self):
+        """See RepositoryFormat.get_format_description()."""
+        return self.__doc__
+
+    def check_conversion_target(self, target_format):
+        pass
+
+
+class RepositoryFormatKnitPack5RichRoot(RepositoryFormatPack):
+    """A repository with subtrees and external references.
+
+    New in release 1.6.
+
+    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 = False # no subtrees
+    _serializer = xml7.serializer_v7
+
+    supports_external_lookups = True
+
+    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)
+            
+    def get_format_string(self):
+        """See RepositoryFormat.get_format_string()."""
+        return "Bazaar RepositoryFormatKnitPack5RichRoot (bzr 1.6)\n"
+
+    def get_format_description(self):
+        """See RepositoryFormat.get_format_description()."""
+        return self.__doc__
+
+
 class RepositoryFormatPackDevelopment0(RepositoryFormatPack):
     """A no-subtrees development repository.
 

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2008-07-22 02:25:19 +0000
+++ b/bzrlib/repository.py	2008-07-22 09:54:03 +0000
@@ -2283,6 +2283,17 @@
     'bzrlib.repofmt.pack_repo',
     'RepositoryFormatKnitPack4',
     )
+format_registry.register_lazy(
+    'Bazaar RepositoryFormatKnitPack5 (bzr 1.6)\n',
+    'bzrlib.repofmt.pack_repo',
+    'RepositoryFormatKnitPack5',
+    )
+format_registry.register_lazy(
+    'Bazaar RepositoryFormatKnitPack5RichRoot (bzr 1.6)\n',
+    'bzrlib.repofmt.pack_repo',
+    'RepositoryFormatKnitPack5RichRoot',
+    )
+
 # Development formats. 
 # 1.2->1.3
 # development 0 - stub to introduce development versioning scheme.

=== modified file 'bzrlib/tests/blackbox/test_info.py'
--- a/bzrlib/tests/blackbox/test_info.py	2008-06-26 01:07:58 +0000
+++ b/bzrlib/tests/blackbox/test_info.py	2008-07-22 09:05:52 +0000
@@ -249,7 +249,7 @@
         out, err = self.run_bzr('info -v lightcheckout')
         self.assertEqualDiff(
 """Lightweight checkout (format: dirstate or dirstate-tags or \
-pack-0.92 or rich-root or rich-root-pack)
+pack-0.92 or rich-root or rich-root-pack or stacked or stacked-rich-root)
 Location:
   light checkout root: lightcheckout
    checkout of branch: standalone
@@ -416,7 +416,7 @@
         out, err = self.run_bzr('info lightcheckout --verbose')
         self.assertEqualDiff(
 """Lightweight checkout (format: dirstate or dirstate-tags or \
-pack-0.92 or rich-root or rich-root-pack)
+pack-0.92 or rich-root or rich-root-pack or stacked or stacked-rich-root)
 Location:
   light checkout root: lightcheckout
    checkout of branch: standalone
@@ -552,7 +552,7 @@
         out, err = self.run_bzr('info tree/lightcheckout --verbose')
         self.assertEqualDiff(
 """Lightweight checkout (format: dirstate or dirstate-tags or \
-pack-0.92 or rich-root or rich-root-pack)
+pack-0.92 or rich-root or rich-root-pack or stacked or stacked-rich-root)
 Location:
   light checkout root: tree/lightcheckout
    checkout of branch: repo/branch
@@ -675,7 +675,7 @@
         out, err = self.run_bzr('info tree/lightcheckout --verbose')
         self.assertEqualDiff(
 """Lightweight checkout (format: dirstate or dirstate-tags or \
-pack-0.92 or rich-root or rich-root-pack)
+pack-0.92 or rich-root or rich-root-pack or stacked or stacked-rich-root)
 Location:
   light checkout root: tree/lightcheckout
    checkout of branch: repo/branch
@@ -1090,7 +1090,8 @@
             (False, False): 'Checkout',
             }[(shared_repo is not None, light_checkout)]
         format = {True: 'dirstate or dirstate-tags or pack-0.92'
-                        ' or rich-root or rich-root-pack',
+                        ' or rich-root or rich-root-pack'
+                        ' or stacked or stacked-rich-root',
                   False: 'dirstate'}[light_checkout]
         if repo_locked:
             repo_locked = lco_tree.branch.repository.get_physical_lock_status()

=== modified file 'bzrlib/tests/test_info.py'
--- a/bzrlib/tests/test_info.py	2008-01-06 20:04:22 +0000
+++ b/bzrlib/tests/test_info.py	2008-07-22 09:05:52 +0000
@@ -146,9 +146,9 @@
             expected = None
             if key in ('dirstate', 'dirstate-tags', 'dirstate-with-subtree',
                 'pack-0.92', 'pack-0.92-subtree', 'rich-root',
-                'rich-root-pack'):
+                'rich-root-pack', 'stacked', 'stacked-rich-root'):
                 expected = 'dirstate or dirstate-tags or pack-0.92 or'\
-                    ' rich-root or rich-root-pack'
+                    ' rich-root or rich-root-pack or stacked or stacked-rich-root'
             if key in ('knit', 'metaweave'):
                 expected = 'knit or metaweave'
             self.assertCheckoutDescription(key, expected)




More information about the bazaar-commits mailing list