Rev 6459: (jelmer) Fix the default target name in 'bzr branch' when there is no in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/2.5/

Patch Queue Manager pqm at pqm.ubuntu.com
Fri Jan 27 13:06:35 UTC 2012


At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/2.5/

------------------------------------------------------------
revno: 6459 [merge]
revision-id: pqm at pqm.ubuntu.com-20120127130635-ouv0mnnesy5b2elj
parent: pqm at pqm.ubuntu.com-20120124102258-dz7syv2g62srmnpr
parent: jelmer at samba.org-20120125174105-rjfx2d0xs4xnt09i
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: 2.5
timestamp: Fri 2012-01-27 13:06:35 +0000
message:
  (jelmer) Fix the default target name in 'bzr branch' when there is no
   selected colocated branch. (Jelmer Vernooij)
modified:
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
  bzrlib/tests/blackbox/test_branch.py test_branch.py-20060524161337-noms9gmcwqqrfi8y-1
  doc/en/release-notes/bzr-2.5.txt bzr2.5.txt-20110708125756-587p0hpw7oke4h05-1
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2012-01-20 15:56:56 +0000
+++ b/bzrlib/builtins.py	2012-01-25 17:41:05 +0000
@@ -1416,7 +1416,7 @@
             revision_id = br_from.last_revision()
         if to_location is None:
             to_location = getattr(br_from, "name", None)
-            if to_location is None:
+            if not to_location:
                 to_location = urlutils.derive_to_location(from_location)
         to_transport = transport.get_transport(to_location)
         try:

=== modified file 'bzrlib/tests/blackbox/test_branch.py'
--- a/bzrlib/tests/blackbox/test_branch.py	2012-01-19 12:01:12 +0000
+++ b/bzrlib/tests/blackbox/test_branch.py	2012-01-25 17:41:05 +0000
@@ -65,6 +65,14 @@
         self.assertFalse(b._transport.has('branch-name'))
         b.bzrdir.open_workingtree().commit(message='foo', allow_pointless=True)
 
+    def test_branch_no_to_location(self):
+        """The to_location is derived from the source branch name."""
+        os.mkdir("something")
+        a = self.example_branch('something/a').branch
+        self.run_bzr('branch something/a')
+        b = branch.Branch.open('a')
+        self.assertEquals(b.last_revision_info(), a.last_revision_info())
+
     def test_into_colocated(self):
         """Branch from a branch into a colocated branch."""
         self.example_branch('a')

=== modified file 'doc/en/release-notes/bzr-2.5.txt'
--- a/doc/en/release-notes/bzr-2.5.txt	2012-01-20 16:42:27 +0000
+++ b/doc/en/release-notes/bzr-2.5.txt	2012-01-25 17:41:05 +0000
@@ -26,7 +26,7 @@
 .. Improvements to existing commands, especially improved performance 
    or memory usage, or better results.
 
-* "bzr switch -b" in a standalone tree will now create a colocated branch.
+* ``bzr switch -b`` in a standalone tree will now create a colocated branch.
   (Jelmer Vernooij, #918197)
 
 * ``bzr info`` now reports when there are present (but unused) colocated
@@ -47,6 +47,9 @@
 * ``bzr branch`` now fetches revisions when branching into an empty
   control directory. (Jelmer Vernooij, #905594)
 
+* ``bzr branch`` generates correct target branch locations again if not
+  specified. (Jelmer Vernooij, #919218)
+
 * Support scripts that don't call bzrlib.initialize() but still call run_bzr().
   (Vincent Ladeuil, #917733)
 




More information about the bazaar-commits mailing list