Rev 2233: Small changes in response to Aaron's review. in sftp://bazaar.launchpad.net/%7Ebzr/bzr/hpss/

Andrew Bennetts andrew.bennetts at canonical.com
Wed Apr 18 06:11:45 BST 2007


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

------------------------------------------------------------
revno: 2233
revision-id: andrew.bennetts at canonical.com-20070418051019-tek0rr8alo1z2sop
parent: andrew.bennetts at canonical.com-20070417095011-my9qj2tvugvslhhg
committer: Andrew Bennetts <andrew.bennetts at canonical.com>
branch nick: hpss
timestamp: Wed 2007-04-18 15:10:19 +1000
message:
  Small changes in response to Aaron's review.
modified:
  bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
  bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
  bzrlib/smart/bzrdir.py         bzrdir.py-20061122024551-ol0l0o0oofsu9b3t-1
  bzrlib/tests/branch_implementations/test_locking.py test_locking.py-20060707151933-tav3o2hpibwi53u4-4
  bzrlib/tests/test_remote.py    test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
  bzrlib/tests/test_smart.py     test_smart.py-20061122024551-ol0l0o0oofsu9b3t-2
=== modified file 'bzrlib/branch.py'
--- a/bzrlib/branch.py	2007-04-13 07:39:17 +0000
+++ b/bzrlib/branch.py	2007-04-18 05:10:19 +0000
@@ -710,13 +710,10 @@
         """Return the most suitable metadir for a checkout of this branch.
         Weaves are used if this branch's repository uses weaves.
         """
-        from bzrlib.remote import RemoteBzrDir
         if isinstance(self.bzrdir, bzrdir.BzrDirPreSplitOut):
             from bzrlib.repofmt import weaverepo
             format = bzrdir.BzrDirMetaFormat1()
             format.repository_format = weaverepo.RepositoryFormat7()
-        elif isinstance(self.bzrdir, RemoteBzrDir):
-            format = bzrdir.BzrDirMetaFormat1()
         else:
             format = self.repository.bzrdir.checkout_metadir()
             format.set_branch_format(self._format)

=== modified file 'bzrlib/remote.py'
--- a/bzrlib/remote.py	2007-04-17 09:01:53 +0000
+++ b/bzrlib/remote.py	2007-04-18 05:10:19 +0000
@@ -136,8 +136,8 @@
         assert len(response) == 4, 'incorrect response length %s' % (response,)
         if response[1] == '':
             format = RemoteRepositoryFormat()
-            format.rich_root_data = response[2] == 'True'
-            format.supports_tree_reference = response[3] == 'True'
+            format.rich_root_data = (response[2] == 'yes')
+            format.supports_tree_reference = (response[3] == 'yes')
             return RemoteRepository(self, format)
         else:
             raise errors.NoRepositoryPresent(self)
@@ -736,6 +736,10 @@
             if self._lock_mode == 'r':
                 self._real_branch.lock_read()
 
+    def _get_checkout_format(self):
+        self._ensure_real()
+        return self._real_branch._get_checkout_format()
+
     def get_physical_lock_status(self):
         """See Branch.get_physical_lock_status()."""
         # should be an API call to the server, as branches must be lockable.

=== modified file 'bzrlib/smart/bzrdir.py'
--- a/bzrlib/smart/bzrdir.py	2007-04-17 09:01:53 +0000
+++ b/bzrlib/smart/bzrdir.py	2007-04-18 05:10:19 +0000
@@ -61,13 +61,13 @@
             else:
                 segments = []
             if repository.supports_rich_root():
-                rich_root = 'True'
+                rich_root = 'yes'
             else:
-                rich_root = 'False'
+                rich_root = 'no'
             if repository._format.supports_tree_reference:
-                tree_ref = 'True'
+                tree_ref = 'yes'
             else:
-                tree_ref = 'False'
+                tree_ref = 'no'
             return SmartServerResponse(('ok', '/'.join(segments), rich_root, tree_ref))
         except errors.NoRepositoryPresent:
             return SmartServerResponse(('norepository', ))

=== modified file 'bzrlib/tests/branch_implementations/test_locking.py'
--- a/bzrlib/tests/branch_implementations/test_locking.py	2007-04-17 09:16:29 +0000
+++ b/bzrlib/tests/branch_implementations/test_locking.py	2007-04-18 05:10:19 +0000
@@ -36,14 +36,16 @@
         # 'control_files' member. So we should fail gracefully if
         # not there. But assuming it has them lets us test the exact 
         # lock/unlock order.
-        if isinstance(self.bzrdir_format, RemoteBzrDirFormat):
-            raise TestSkipped(
-                "RemoteRepository objects don't have 'control_files'.")
         self.locks = []
         b = LockWrapper(self.locks, self.get_branch(), 'b')
         b.repository = LockWrapper(self.locks, b.repository, 'r')
         bcf = b.control_files
-        rcf = b.repository.control_files
+        rcf = getattr(b.repository, 'control_files', None)
+        if rcf is None:
+            raise TestSkipped(
+                "This tests depends on being able to instrument "
+                "repository.control_files, but %r doesn't have control_files."
+                % (b.repository,))
 
         # Look out for branch types that reuse their control files
         self.combined_control = bcf is rcf

=== modified file 'bzrlib/tests/test_remote.py'
--- a/bzrlib/tests/test_remote.py	2007-04-17 09:01:53 +0000
+++ b/bzrlib/tests/test_remote.py	2007-04-18 05:10:19 +0000
@@ -147,7 +147,7 @@
 class TestBzrDirOpenBranch(tests.TestCase):
 
     def test_branch_present(self):
-        client = FakeClient([(('ok', ''), ), (('ok', '', 'False', 'False'), )])
+        client = FakeClient([(('ok', ''), ), (('ok', '', 'no', 'no'), )])
         transport = MemoryTransport()
         transport.mkdir('quack')
         transport = transport.clone('quack')
@@ -173,13 +173,13 @@
 
     def check_open_repository(self, rich_root, subtrees):
         if rich_root:
-            rich_response = 'True'
+            rich_response = 'yes'
         else:
-            rich_response = 'False'
+            rich_response = 'no'
         if subtrees:
-            subtree_response = 'True'
+            subtree_response = 'yes'
         else:
-            subtree_response = 'False'
+            subtree_response = 'no'
         client = FakeClient([(('ok', '', rich_response, subtree_response), ),])
         transport = MemoryTransport()
         transport.mkdir('quack')

=== modified file 'bzrlib/tests/test_smart.py'
--- a/bzrlib/tests/test_smart.py	2007-04-16 17:23:40 +0000
+++ b/bzrlib/tests/test_smart.py	2007-04-18 05:10:19 +0000
@@ -83,13 +83,13 @@
         """
         repo = self.make_repository('.', shared=shared, format=format)
         if repo.supports_rich_root():
-            rich_root = 'True'
+            rich_root = 'yes'
         else:
-            rich_root = 'False'
+            rich_root = 'no'
         if repo._format.supports_tree_reference:
-            subtrees = 'True'
+            subtrees = 'yes'
         else:
-            subtrees = 'False'
+            subtrees = 'no'
         return SmartServerResponse(('ok', '', rich_root, subtrees))
 
     def test_shared_repository(self):
@@ -113,8 +113,8 @@
         request = smart.bzrdir.SmartServerRequestFindRepository(backing)
         result = self._make_repository_and_result(format='dirstate-with-subtree')
         # check the test will be valid
-        self.assertEqual('True', result.args[2])
-        self.assertEqual('True', result.args[3])
+        self.assertEqual('yes', result.args[2])
+        self.assertEqual('yes', result.args[3])
         self.assertEqual(result, request.execute(backing.local_abspath('')))
 
 




More information about the bazaar-commits mailing list