Rev 2151: Merge in supports-rich-root, another test passing. in sftp://bazaar.launchpad.net/%7Ebzr/bzr/hpss/

Andrew Bennetts andrew.bennetts at canonical.com
Mon Mar 5 05:21:57 GMT 2007


At sftp://bazaar.launchpad.net/%7Ebzr/bzr/hpss/

------------------------------------------------------------
revno: 2151
revision-id: andrew.bennetts at canonical.com-20070305051557-1ky8luc1kt0c39x0
parent: andrew.bennetts at canonical.com-20070305050314-tskdcd65ok6jyj9o
parent: andrew.bennetts at canonical.com-20070301035839-mgsenxqgx4oveeob
committer: Andrew Bennetts <andrew.bennetts at canonical.com>
branch nick: hpss
timestamp: Mon 2007-03-05 16:15:57 +1100
message:
  Merge in supports-rich-root, another test passing.
modified:
  bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
  bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
  bzrlib/tests/repository_implementations/test_commit_builder.py test_commit_builder.py-20060606110838-76e3ra5slucqus81-1
  bzrlib/tests/repository_implementations/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
    ------------------------------------------------------------
    revno: 2018.1.2.1.50.2.80.1.99.1.9.1.21.1.27
    merged: andrew.bennetts at canonical.com-20070301035839-mgsenxqgx4oveeob
    parent: pqm at pqm.ubuntu.com-20070228211048-30e18ddd8dd9c205
    committer: Andrew Bennetts <andrew.bennetts at canonical.com>
    branch nick: supports-rich-root
    timestamp: Thu 2007-03-01 14:58:39 +1100
    message:
      Use repo.supports_rich_root() everywhere rather than
      repo._format.rich_root_data.
      
      This is needed for the smart server work, because a RemoteRepository's _format
      doesn't know whether or not the actual repository supports rich root data or
      not.  But the RemoteRepository does (by asking the underlying repository it is
      connected to).
      
      This also removes some unnecessary isinstance(..., Repository), which also
      hinders smart server work, because RemoteRepository doesn't inherit from
      Repository, even though it implements the same interface.
=== modified file 'bzrlib/remote.py'
--- a/bzrlib/remote.py	2007-03-05 05:03:14 +0000
+++ b/bzrlib/remote.py	2007-03-05 05:15:57 +0000
@@ -530,10 +530,8 @@
         return self._real_repository.get_revisions(revision_ids)
 
     def supports_rich_root(self):
-        # Perhaps this should return True depending on the real repository, but
-        # for now we just take the easy option and assume we can't handle rich
-        # root data.
-        return False
+        self._ensure_real()
+        return self._real_repository.supports_rich_root()
 
     def iter_reverse_revision_history(self, revision_id):
         self._ensure_real()

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2007-03-01 05:08:32 +0000
+++ b/bzrlib/repository.py	2007-03-05 05:15:57 +0000
@@ -1360,7 +1360,7 @@
 
     @staticmethod
     def is_compatible(source, target):
-        if source._format.rich_root_data == target._format.rich_root_data:
+        if source.supports_rich_root() == target.supports_rich_root():
             return True
         else:
             return False
@@ -1613,11 +1613,7 @@
 
     @staticmethod
     def is_compatible(source, target):
-        if not isinstance(source, Repository):
-            return False
-        if not isinstance(target, Repository):
-            return False
-        if not source._format.rich_root_data and target._format.rich_root_data:
+        if not source.supports_rich_root() and target.supports_rich_root():
             return True
         else:
             return False

=== modified file 'bzrlib/tests/repository_implementations/test_commit_builder.py'
--- a/bzrlib/tests/repository_implementations/test_commit_builder.py	2007-02-10 02:48:43 +0000
+++ b/bzrlib/tests/repository_implementations/test_commit_builder.py	2007-03-01 03:58:39 +0000
@@ -82,7 +82,7 @@
     def test_commit_without_root(self):
         """This should cause a deprecation warning, not an assertion failure"""
         tree = self.make_branch_and_tree(".")
-        if tree.branch.repository._format.rich_root_data:
+        if tree.branch.repository.supports_rich_root():
             raise tests.TestSkipped('Format requires root')
         self.build_tree(['foo'])
         tree.add('foo', 'foo-id')

=== modified file 'bzrlib/tests/repository_implementations/test_repository.py'
--- a/bzrlib/tests/repository_implementations/test_repository.py	2007-03-05 05:03:14 +0000
+++ b/bzrlib/tests/repository_implementations/test_repository.py	2007-03-05 05:15:57 +0000
@@ -205,8 +205,8 @@
         tree_a.commit('rev1', rev_id='rev1')
         # fetch with a default limit (grab everything)
         repo = bzrdir.BzrDir.create_repository(self.get_url('b'))
-        if (tree_a.branch.repository._format.rich_root_data and not
-            repo._format.rich_root_data):
+        if (tree_a.branch.repository.supports_rich_root() and not
+            repo.supports_rich_root()):
             raise TestSkipped('Cannot fetch from model2 to model1')
         repo.fetch(tree_a.branch.repository,
                    revision_id=None,




More information about the bazaar-commits mailing list