Rev 6032: Merge bzr/2.4 into bzr.dev. Resolve a release-notes (NEWS) conflict, in favor of putting in http://bazaar.launchpad.net/~jameinel/bzr/integration

John Arbash Meinel john at arbash-meinel.com
Mon Jul 18 15:10:20 UTC 2011


At http://bazaar.launchpad.net/~jameinel/bzr/integration

------------------------------------------------------------
revno: 6032 [merge]
revision-id: john at arbash-meinel.com-20110718150920-19l4k8i6djiiv0j3
parent: pqm at pqm.ubuntu.com-20110718130303-4djmfqi2rh6k05aw
parent: pqm at pqm.ubuntu.com-20110718144335-8v4u0gbnwzm0vzmt
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: integration
timestamp: Mon 2011-07-18 17:09:20 +0200
message:
  Merge bzr/2.4 into bzr.dev. Resolve a release-notes (NEWS) conflict, in favor of putting
  the 2.4 entry into 2.5 where it belonged.
modified:
  bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
  bzrlib/tests/blackbox/test_switch.py test_switch.py-20071122111948-0c5en6uz92bwl76h-1
  doc/en/release-notes/bzr-2.4.txt bzr2.4.txt-20110114053217-k7ym9jfz243fddjm-1
  doc/en/release-notes/bzr-2.5.txt bzr2.5.txt-20110708125756-587p0hpw7oke4h05-1
-------------- next part --------------
=== modified file 'bzrlib/branch.py'
--- a/bzrlib/branch.py	2011-07-15 08:25:00 +0000
+++ b/bzrlib/branch.py	2011-07-18 14:43:35 +0000
@@ -1293,11 +1293,11 @@
             if repository_policy is not None:
                 repository_policy.configure_branch(result)
             self.copy_content_into(result, revision_id=revision_id)
-            master_branch = self.get_master_branch()
-            if master_branch is None:
+            master_url = self.get_bound_location()
+            if master_url is None:
                 result.set_parent(self.bzrdir.root_transport.base)
             else:
-                result.set_parent(master_branch.bzrdir.root_transport.base)
+                result.set_parent(master_url)
         finally:
             result.unlock()
         return result

=== modified file 'bzrlib/tests/blackbox/test_switch.py'
--- a/bzrlib/tests/blackbox/test_switch.py	2011-05-13 12:51:05 +0000
+++ b/bzrlib/tests/blackbox/test_switch.py	2011-07-18 13:58:52 +0000
@@ -278,6 +278,7 @@
         self.run_bzr('switch --directory checkout b')
         self.assertFileEqual('initial\nmore\n', 'checkout/a')
 
+
 class TestSwitchParentLocationBase(TestCaseWithTransport):
 
     def setUp(self):
@@ -328,3 +329,26 @@
         self.assertParent('repo/trunk', bb)
         self.assertParent('repo/trunk', mb)
 
+
+class TestSwitchDoesntOpenMasterBranch(TestCaseWithTransport):
+    # See https://bugs.launchpad.net/bzr/+bug/812285
+    # "bzr switch --create-branch" can point the new branch's parent to the
+    # master branch, but it doesn't have to open it to do so.
+
+    def test_switch_create_doesnt_open_master_branch(self):
+        master = self.make_branch_and_tree('master')
+        master.commit('one')
+        # Note: not a lightweight checkout
+        checkout = master.branch.create_checkout('checkout')
+        opened = []
+        def open_hook(branch):
+            # Just append the final directory of the branch
+            name = branch.base.rstrip('/').rsplit('/', 1)[1]
+            opened.append(name)
+        branch.Branch.hooks.install_named_hook('open', open_hook,
+                                               'open_hook_logger')
+        self.run_bzr('switch --create-branch -d checkout feature')
+        # We only open the master branch 1 time.
+        # This test should be cleaner to write, but see bug:
+        #  https://bugs.launchpad.net/bzr/+bug/812295
+        self.assertEqual(1, opened.count('master'))

=== modified file 'doc/en/release-notes/bzr-2.4.txt'
--- a/doc/en/release-notes/bzr-2.4.txt	2011-07-15 09:22:16 +0000
+++ b/doc/en/release-notes/bzr-2.4.txt	2011-07-18 15:09:20 +0000
@@ -32,7 +32,11 @@
 .. Fixes for situations where bzr would previously crash or give incorrect
    or undesirable results.
 
-* Fix i18n use when no environment variables are set. (Jelmer Vernooij, #810701)
+* The fix for bug #513709 caused us to open a new connection when
+  switching a lightweight checkout that was pointing at a bound branch.
+  This isn't necessary because we know the master URL without opening it,
+  avoiding an extra SSH connection, etc.
+  (John Arbash Meinel, #812285)
 
 Documentation
 *************

=== modified file 'doc/en/release-notes/bzr-2.5.txt'
--- a/doc/en/release-notes/bzr-2.5.txt	2011-07-18 12:21:34 +0000
+++ b/doc/en/release-notes/bzr-2.5.txt	2011-07-18 15:09:20 +0000
@@ -46,6 +46,8 @@
   that subfolder.
   (Bastian Bowe, #809901)
 
+* Fix i18n use when no environment variables are set. (Jelmer Vernooij, #810701)
+
 * TreeTransformBase.fixup_new_roots no longer forces trees to have a root, so
   operations that use it, like merge, can now create trees without a root.
   (Aaron Bentley)



More information about the bazaar-commits mailing list