Rev 2977: (robertc) Minor fixes for foreign format friendliness. (Robert Collins) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Nov 9 15:41:47 GMT 2007


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

------------------------------------------------------------
revno: 2977
revision-id: pqm at pqm.ubuntu.com-20071109154145-1yq4oi390uk3z90o
parent: pqm at pqm.ubuntu.com-20071109031316-n814a39wmtxvybyw
parent: robertc at robertcollins.net-20071108233639-dizjxzhvxa1utsb0
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2007-11-09 15:41:45 +0000
message:
  (robertc) Minor fixes for foreign format friendliness. (Robert Collins)
modified:
  bzrlib/tests/branch_implementations/test_create_checkout.py test_create_checkout-20070322193723-n2wkp1g03r0404di-1
  bzrlib/tests/branch_implementations/test_pull.py test_pull.py-20060410103942-83c35b26657414fc
    ------------------------------------------------------------
    revno: 2975.1.1
    merged: robertc at robertcollins.net-20071108233639-dizjxzhvxa1utsb0
    parent: pqm at pqm.ubuntu.com-20071107140948-l3p8njdhgwstdkri
    committer: Robert Collins <robertc at robertcollins.net>
    branch nick: foreign-format
    timestamp: Fri 2007-11-09 10:36:39 +1100
    message:
      Minor fixes for foreign format friendliness.
=== modified file 'bzrlib/tests/branch_implementations/test_create_checkout.py'
--- a/bzrlib/tests/branch_implementations/test_create_checkout.py	2007-03-29 04:08:16 +0000
+++ b/bzrlib/tests/branch_implementations/test_create_checkout.py	2007-11-08 23:36:39 +0000
@@ -26,23 +26,12 @@
 class TestCreateCheckout(TestCaseWithBranch):
 
     def test_checkout_format(self):
-        """Make sure the new checkout uses the same branch format."""
+        """Make sure the new checkout uses the desired branch format."""
         a_branch = self.make_branch('branch')
-        if isinstance(a_branch, RemoteBranch):
-            # RemoteBranch formats are not the same as local ones, and dont
-            # duplicate the format string (because there is no format string as
-            # such - it might be e.g. totally virtual on the server end).
-            # This test can only assess the checkout format correctness *in
-            # general* when there is a real object locally present for both the
-            # source and target.
-            return
         tree = a_branch.create_checkout('checkout')
-        if self.branch_format in branch._legacy_formats:
-            # Legacy formats create checkouts with the default format.
-            # Only newer formats create identical checkouts.
-            expected_format = branch.BranchFormat.get_default_format()
-        else:
-            expected_format = a_branch._format
+        # All branches can define the format they want checkouts made in.
+        # This checks it is honoured.
+        expected_format = a_branch._get_checkout_format().get_branch_format()
         self.assertEqual(expected_format.__class__,
                          tree.branch._format.__class__)
 

=== modified file 'bzrlib/tests/branch_implementations/test_pull.py'
--- a/bzrlib/tests/branch_implementations/test_pull.py	2007-11-01 09:52:45 +0000
+++ b/bzrlib/tests/branch_implementations/test_pull.py	2007-11-08 23:36:39 +0000
@@ -88,7 +88,7 @@
         tree_a.commit('message 2', rev_id='rev2a')
         tree_b.commit('message 2', rev_id='rev2b')
         self.assertRaises(errors.DivergedBranches, tree_a.pull, tree_b.branch)
-        tree_a.branch.pull(tree_a.branch, overwrite=True,
+        tree_a.branch.pull(tree_b.branch, overwrite=True,
                            stop_revision='rev2b')
         self.assertEqual('rev2b', tree_a.branch.last_revision())
         self.assertEqual(tree_b.branch.revision_history(),




More information about the bazaar-commits mailing list