Rev 4304: Review feedback. in http://people.ubuntu.com/~robertc/baz2.0/pending/push.roundtrips

Robert Collins robertc at robertcollins.net
Mon Apr 27 04:34:15 BST 2009


At http://people.ubuntu.com/~robertc/baz2.0/pending/push.roundtrips

------------------------------------------------------------
revno: 4304
revision-id: robertc at robertcollins.net-20090427033412-3jnnui7ntwib09wa
parent: robertc at robertcollins.net-20090427032746-vqmcsfbsbvbm04sk
committer: Robert Collins <robertc at robertcollins.net>
branch nick: push.roundtrips
timestamp: Mon 2009-04-27 13:34:12 +1000
message:
  Review feedback.
=== modified file 'bzrlib/bzrdir.py'
--- a/bzrlib/bzrdir.py	2009-04-27 03:27:46 +0000
+++ b/bzrlib/bzrdir.py	2009-04-27 03:34:12 +0000
@@ -2177,7 +2177,7 @@
         shared_repo=False):
         """See BzrDirFormat.initialize_on_transport_ex."""
         require_stacking = (stacked_on is not None)
-        # Format 5 cannot stack, but we've been asked do - actually init
+        # Format 5 cannot stack, but we've been asked to - actually init
         # a Meta1Dir
         if require_stacking:
             format = BzrDirMetaFormat1()

=== modified file 'bzrlib/tests/bzrdir_implementations/test_bzrdir.py'
--- a/bzrlib/tests/bzrdir_implementations/test_bzrdir.py	2009-04-24 05:08:51 +0000
+++ b/bzrlib/tests/bzrdir_implementations/test_bzrdir.py	2009-04-27 03:34:12 +0000
@@ -1178,7 +1178,8 @@
             return
         t = self.get_transport('dir')
         t.ensure_base()
-        self.assertRaises(errors.FileExists, self.assertInitializeEx, t,
+        self.assertRaises(errors.FileExists,
+            self.bzrdir_format.initialize_on_transport_ex, t,
             use_existing_dir=False)
 
     def test_format_initialize_on_transport_ex_create_prefix_True(self):
@@ -1246,7 +1247,7 @@
 
     def test_format_initialize_on_transport_ex_repo_fmt_name_followed(self):
         t = self.get_transport('dir')
-        # 1.6 is likely to neve be default
+        # 1.6 is likely to never be default
         fmt = bzrdir.format_registry.make_bzrdir('1.6')
         repo_name = fmt.repository_format.network_name()
         repo, control = self.assertInitializeEx(t, repo_format_name=repo_name)
@@ -1262,6 +1263,9 @@
     def assertInitializeEx(self, t, need_meta=False, **kwargs):
         """Execute initialize_on_transport_ex and check it succeeded correctly.
 
+        This involves checking that the disk objects were created, open with
+        the same format returned, and had the expected disk format.
+
         :param t: The transport to initialize on.
         :param **kwargs: Additional arguments to pass to
             initialize_on_transport_ex.
@@ -1276,6 +1280,8 @@
         opened = bzrdir.BzrDir.open(t.base)
         expected_format = self.bzrdir_format
         if isinstance(expected_format, bzrdir.RemoteBzrDirFormat):
+            # Current RemoteBzrDirFormat's do not reliably get network_name
+            # set, so we skip a number of tests for RemoteBzrDirFormat's.
             self.assertIsInstance(control, RemoteBzrDir)
         else:
             if need_meta and isinstance(expected_format, (bzrdir.BzrDirFormat5,
@@ -1285,8 +1291,6 @@
                 expected_format = bzrdir.BzrDirMetaFormat1()
             self.assertEqual(control._format.network_name(),
                 expected_format.network_name())
-            # Current RemoteBzrDirFormat's do not reliably get network_name
-            # set, so only check in the off-case.
             self.assertEqual(control._format.network_name(),
                 opened._format.network_name())
         self.assertEqual(control.__class__, opened.__class__)

=== modified file 'bzrlib/tests/test_smart.py'
--- a/bzrlib/tests/test_smart.py	2009-04-24 05:08:51 +0000
+++ b/bzrlib/tests/test_smart.py	2009-04-27 03:34:12 +0000
@@ -353,7 +353,7 @@
 class TestSmartServerRequestBzrDirInitializeEx(tests.TestCaseWithMemoryTransport):
     """Basic tests for BzrDir.initialize_ex in the smart server.
 
-    The main unit tests in test_bzrdir exercise the API coprehensively.
+    The main unit tests in test_bzrdir exercise the API comprehensively.
     """
 
     def test_empty_dir(self):
@@ -367,7 +367,7 @@
             'False'))
         made_dir = bzrdir.BzrDir.open_from_transport(backing)
         # no branch, tree or repository is expected with the current
-        # default formart.
+        # default format.
         self.assertRaises(errors.NoWorkingTree, made_dir.open_workingtree)
         self.assertRaises(errors.NotBranchError, made_dir.open_branch)
         self.assertRaises(errors.NoRepositoryPresent, made_dir.open_repository)

=== modified file 'bzrlib/tests/test_smart_request.py'
--- a/bzrlib/tests/test_smart_request.py	2009-03-26 06:59:15 +0000
+++ b/bzrlib/tests/test_smart_request.py	2009-04-27 03:34:12 +0000
@@ -199,10 +199,10 @@
         # A child of a transport in jail_info is allowed
         _pre_open_hook(t.clone('child'))
         # A parent is not allowed
-        self.assertRaises(errors.BzrError, _pre_open_hook, t.clone('..'))
+        self.assertRaises(errors.JailBreak, _pre_open_hook, t.clone('..'))
         # A completely unrelated transport is not allowed
         self.assertRaises(
-            errors.BzrError, _pre_open_hook, get_transport('http://host/'))
+            errors.JailBreak, _pre_open_hook, get_transport('http://host/'))
 
     def test_open_bzrdir_in_non_main_thread(self):
         """Opening a bzrdir in a non-main thread should work ok.

=== modified file 'bzrlib/transport/__init__.py'
--- a/bzrlib/transport/__init__.py	2009-04-23 23:35:44 +0000
+++ b/bzrlib/transport/__init__.py	2009-04-27 03:34:12 +0000
@@ -329,7 +329,7 @@
         raise NotImplementedError(self.clone)
 
     def create_prefix(self):
-        """Create all the directorie sleading down to self.base."""
+        """Create all the directories leading down to self.base."""
         cur_transport = self
         needed = [cur_transport]
         # Recurse upwards until we can create a directory successfully




More information about the bazaar-commits mailing list