Rev 6248: (jelmer) Always show the bound branch, if there is any, in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/

Patch Queue Manager pqm at pqm.ubuntu.com
Tue Nov 8 18:18:25 UTC 2011


At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 6248 [merge]
revision-id: pqm at pqm.ubuntu.com-20111108181825-lle320gxuedqw4o5
parent: pqm at pqm.ubuntu.com-20111108173529-v2vebrv4xiw7euqk
parent: jelmer at samba.org-20111108003633-0ex5km72i9zwvjdu
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2011-11-08 18:18:25 +0000
message:
  (jelmer) Always show the bound branch, if there is any,
   in 'bzr info' output. (Jelmer Vernooij)
modified:
  bzrlib/info.py                 info.py-20050323235939-6bbfe7d9700b0b9b
  bzrlib/tests/test_info.py      test_info.py-20070320150933-m0xxm1g7xi9v6noe-1
  doc/en/release-notes/bzr-2.5.txt bzr2.5.txt-20110708125756-587p0hpw7oke4h05-1
=== modified file 'bzrlib/info.py'
--- a/bzrlib/info.py	2011-11-07 10:42:00 +0000
+++ b/bzrlib/info.py	2011-11-08 18:18:25 +0000
@@ -113,10 +113,10 @@
         elif branch_path is not None:
             # standalone
             locs['branch root'] = branch_path
-            if master_path != branch_path:
-                locs['bound to branch'] = master_path
         else:
             locs['repository'] = repository_path
+        if master_path != branch_path:
+            locs['bound to branch'] = master_path
     if repository.is_shared():
         # lightweight checkout of branch in shared repository
         locs['shared repository'] = repository_path

=== modified file 'bzrlib/tests/test_info.py'
--- a/bzrlib/tests/test_info.py	2011-03-11 21:06:09 +0000
+++ b/bzrlib/tests/test_info.py	2011-11-08 00:36:33 +0000
@@ -18,7 +18,7 @@
 
 from bzrlib import (
     branch as _mod_branch,
-    bzrdir,
+    controldir,
     info,
     tests,
     workingtree,
@@ -54,7 +54,7 @@
 
     def test_describe_repository_layout(self):
         repository = self.make_repository('.', shared=True)
-        tree = bzrdir.BzrDir.create_branch_convenience('tree',
+        tree = controldir.ControlDir.create_branch_convenience('tree',
             force_new_tree=True).bzrdir.open_workingtree()
         self.assertEqual('Shared repository with trees',
             info.describe_layout(tree.branch.repository))
@@ -90,11 +90,11 @@
         # this ought to be easier...
         branch.create_checkout('%s_co' % format,
             lightweight=True).bzrdir.destroy_workingtree()
-        control = bzrdir.BzrDir.open('%s_co' % format)
+        control = controldir.ControlDir.open('%s_co' % format)
         old_format = control._format.workingtree_format
         try:
             control._format.workingtree_format = \
-                bzrdir.format_registry.make_bzrdir(format).workingtree_format
+                controldir.format_registry.make_bzrdir(format).workingtree_format
             control.create_workingtree()
             tree = workingtree.WorkingTree.open('%s_co' % format)
             format_description = info.describe_format(tree.bzrdir,
@@ -124,31 +124,31 @@
             repo, None, None))
 
     def test_describe_tree_format(self):
-        for key in bzrdir.format_registry.keys():
-            if key in bzrdir.format_registry.aliases():
+        for key in controldir.format_registry.keys():
+            if key in controldir.format_registry.aliases():
                 continue
             self.assertTreeDescription(key)
 
     def test_describe_checkout_format(self):
-        for key in bzrdir.format_registry.keys():
-            if key in bzrdir.format_registry.aliases():
+        for key in controldir.format_registry.keys():
+            if key in controldir.format_registry.aliases():
                 # Aliases will not describe correctly in the UI because the
                 # real format is found.
                 continue
             # legacy: weave does not support checkouts
             if key == 'weave':
                 continue
-            if bzrdir.format_registry.get_info(key).experimental:
+            if controldir.format_registry.get_info(key).experimental:
                 # We don't require that experimental formats support checkouts
                 # or describe correctly in the UI.
                 continue
-            if bzrdir.format_registry.get_info(key).hidden:
+            if controldir.format_registry.get_info(key).hidden:
                 continue
             expected = None
             if key in ('pack-0.92',):
                 expected = 'pack-0.92'
             elif key in ('knit', 'metaweave'):
-                if 'metaweave' in bzrdir.format_registry:
+                if 'metaweave' in controldir.format_registry:
                     expected = 'knit or metaweave'
                 else:
                     expected = 'knit'
@@ -157,10 +157,10 @@
             self.assertCheckoutDescription(key, expected)
 
     def test_describe_branch_format(self):
-        for key in bzrdir.format_registry.keys():
-            if key in bzrdir.format_registry.aliases():
+        for key in controldir.format_registry.keys():
+            if key in controldir.format_registry.aliases():
                 continue
-            if bzrdir.format_registry.get_info(key).hidden:
+            if controldir.format_registry.get_info(key).hidden:
                 continue
             expected = None
             if key in ('dirstate', 'knit'):
@@ -172,10 +172,10 @@
             self.assertBranchDescription(key, expected)
 
     def test_describe_repo_format(self):
-        for key in bzrdir.format_registry.keys():
-            if key in bzrdir.format_registry.aliases():
+        for key in controldir.format_registry.keys():
+            if key in controldir.format_registry.aliases():
                 continue
-            if bzrdir.format_registry.get_info(key).hidden:
+            if controldir.format_registry.get_info(key).hidden:
                 continue
             expected = None
             if key in ('dirstate', 'knit', 'dirstate-tags'):
@@ -186,7 +186,7 @@
                 expected = '1.14-rich-root'
             self.assertRepoDescription(key, expected)
 
-        format = bzrdir.format_registry.make_bzrdir('knit')
+        format = controldir.format_registry.make_bzrdir('knit')
         format.set_branch_format(_mod_branch.BzrBranchFormat6())
         tree = self.make_branch_and_tree('unknown', format=format)
         self.assertEqual('unnamed', info.describe_format(tree.bzrdir,
@@ -272,6 +272,20 @@
             info.gather_location_info(bound_branch.repository, bound_branch)
         )
 
+    def test_gather_location_bound_in_repository(self):
+        repo = self.make_repository('repo', shared=True)
+        repo.set_make_working_trees(False)
+        branch = self.make_branch('branch')
+        bound_branch = controldir.ControlDir.create_branch_convenience(
+            'repo/bound_branch')
+        bound_branch.bind(branch)
+        self.assertEqual(
+            [('shared repository', bound_branch.repository.bzrdir.user_url),
+             ('repository branch', bound_branch.bzrdir.user_url),
+             ('bound to branch', branch.bzrdir.user_url)],
+            info.gather_location_info(bound_branch.repository, bound_branch)
+        )
+
     def test_location_list(self):
         if sys.platform == 'win32':
             raise tests.TestSkipped('Windows-unfriendly test')

=== modified file 'doc/en/release-notes/bzr-2.5.txt'
--- a/doc/en/release-notes/bzr-2.5.txt	2011-11-08 16:29:31 +0000
+++ b/doc/en/release-notes/bzr-2.5.txt	2011-11-08 18:18:25 +0000
@@ -56,6 +56,9 @@
 .. Fixes for situations where bzr would previously crash or give incorrect
    or undesirable results.
 
+* ``bzr info`` now shows the master branch location too for
+  treeless local branches. (Jelmer Vernooij, #258355)
+
 * ``bzr mkdir --quiet`` now does not print a line for every created
   directory. (Martin von Gagern, #869915)
 




More information about the bazaar-commits mailing list