Rev 6452: (jelmer) Mention unused colocated branches in 'bzr info' output. (Jelmer in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/2.5/
Patch Queue Manager
pqm at pqm.ubuntu.com
Thu Jan 19 16:51:40 UTC 2012
At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/2.5/
------------------------------------------------------------
revno: 6452 [merge]
revision-id: pqm at pqm.ubuntu.com-20120119165139-rbj2syrqv2x4rwvq
parent: pqm at pqm.ubuntu.com-20120119155710-h465ytc8xq03ccn9
parent: jelmer at samba.org-20120119162353-c35bpl893up8k434
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: 2.5
timestamp: Thu 2012-01-19 16:51:39 +0000
message:
(jelmer) Mention unused colocated branches in 'bzr info' output. (Jelmer
Vernooij)
modified:
bzrlib/info.py info.py-20050323235939-6bbfe7d9700b0b9b
bzrlib/tests/blackbox/test_info.py test_info.py-20060215045507-bbdd2d34efab9e0a
bzrlib/tests/blackbox/test_shared_repository.py test_shared_repository.py-20060317053531-ed30c0d79325e483
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-12-18 15:28:38 +0000
+++ b/bzrlib/info.py 2012-01-18 20:47:13 +0000
@@ -352,7 +352,7 @@
except (NoWorkingTree, NotLocalUrl, NotBranchError):
tree = None
try:
- branch = a_bzrdir.open_branch()
+ branch = a_bzrdir.open_branch(name="")
except NotBranchError:
branch = None
try:
@@ -442,8 +442,13 @@
phrase = 'Shared repository'
else:
phrase = 'Unshared repository'
+ extra = []
if repository.make_working_trees():
- phrase += ' with trees'
+ extra.append('trees')
+ if len(control.get_branches()) > 0:
+ extra.append('colocated branches')
+ if extra:
+ phrase += ' with ' + " and ".join(extra)
return phrase
else:
if repository.is_shared():
=== modified file 'bzrlib/tests/blackbox/test_info.py'
--- a/bzrlib/tests/blackbox/test_info.py 2012-01-18 17:47:06 +0000
+++ b/bzrlib/tests/blackbox/test_info.py 2012-01-19 16:51:39 +0000
@@ -1097,6 +1097,22 @@
), out)
self.assertEqual('', err)
+ def test_info_unshared_repository_with_colocated_branches(self):
+ format = bzrdir.format_registry.make_bzrdir('development-colo')
+ transport = self.get_transport()
+
+ # Create unshared repository
+ repo = self.make_repository('repo', shared=False, format=format)
+ repo.set_make_working_trees(True)
+ repo.bzrdir.create_branch(name='foo')
+ out, err = self.run_bzr('info repo')
+ self.assertEqualDiff(
+"""Unshared repository with trees and colocated branches (format: development-colo)
+Location:
+ repository: repo
+""", out)
+ self.assertEqual('', err)
+
def assertCheckoutStatusOutput(self,
command_string, lco_tree, shared_repo=None,
repo_branch=None,
=== modified file 'bzrlib/tests/blackbox/test_shared_repository.py'
--- a/bzrlib/tests/blackbox/test_shared_repository.py 2011-12-30 14:36:46 +0000
+++ b/bzrlib/tests/blackbox/test_shared_repository.py 2012-01-19 12:39:30 +0000
@@ -121,7 +121,7 @@
# being too low. If rpc_count increases, more network roundtrips have
# become necessary for this use case. Please do not adjust this number
# upwards without agreement from bzr's network support maintainers.
- self.assertLength(10, self.hpss_calls)
+ self.assertLength(11, self.hpss_calls)
self.assertLength(1, self.hpss_connections)
self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
=== modified file 'bzrlib/tests/test_info.py'
--- a/bzrlib/tests/test_info.py 2011-11-15 17:27:46 +0000
+++ b/bzrlib/tests/test_info.py 2012-01-19 16:23:53 +0000
@@ -31,49 +31,59 @@
def test_describe_standalone_layout(self):
tree = self.make_branch_and_tree('tree')
self.assertEqual('Empty control directory', info.describe_layout())
- self.assertEqual('Unshared repository with trees',
- info.describe_layout(tree.branch.repository))
+ self.assertEqual(
+ 'Unshared repository with trees and colocated branches',
+ info.describe_layout(tree.branch.repository, control=tree.bzrdir))
tree.branch.repository.set_make_working_trees(False)
- self.assertEqual('Unshared repository',
- info.describe_layout(tree.branch.repository))
+ self.assertEqual('Unshared repository with colocated branches',
+ info.describe_layout(tree.branch.repository, control=tree.bzrdir))
self.assertEqual('Standalone branch',
- info.describe_layout(tree.branch.repository, tree.branch))
+ info.describe_layout(tree.branch.repository, tree.branch,
+ control=tree.bzrdir))
self.assertEqual('Standalone branchless tree',
- info.describe_layout(tree.branch.repository, None, tree))
+ info.describe_layout(tree.branch.repository, None, tree,
+ control=tree.bzrdir))
self.assertEqual('Standalone tree',
- info.describe_layout(tree.branch.repository, tree.branch, tree))
+ info.describe_layout(tree.branch.repository, tree.branch, tree,
+ control=tree.bzrdir))
tree.branch.bind(tree.branch)
self.assertEqual('Bound branch',
- info.describe_layout(tree.branch.repository, tree.branch))
+ info.describe_layout(tree.branch.repository, tree.branch,
+ control=tree.bzrdir))
self.assertEqual('Checkout',
- info.describe_layout(tree.branch.repository, tree.branch, tree))
+ info.describe_layout(tree.branch.repository, tree.branch, tree,
+ control=tree.bzrdir))
checkout = tree.branch.create_checkout('checkout', lightweight=True)
self.assertEqual('Lightweight checkout',
info.describe_layout(checkout.branch.repository, checkout.branch,
- checkout))
+ checkout, control=tree.bzrdir))
def test_describe_repository_layout(self):
repository = self.make_repository('.', shared=True)
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))
+ self.assertEqual('Shared repository with trees and colocated branches',
+ info.describe_layout(tree.branch.repository, control=tree.bzrdir))
repository.set_make_working_trees(False)
- self.assertEqual('Shared repository',
- info.describe_layout(tree.branch.repository))
+ self.assertEqual('Shared repository with colocated branches',
+ info.describe_layout(tree.branch.repository, control=tree.bzrdir))
self.assertEqual('Repository branch',
- info.describe_layout(tree.branch.repository, tree.branch))
+ info.describe_layout(tree.branch.repository, tree.branch,
+ control=tree.bzrdir))
self.assertEqual('Repository branchless tree',
- info.describe_layout(tree.branch.repository, None, tree))
+ info.describe_layout(tree.branch.repository, None, tree,
+ control=tree.bzrdir))
self.assertEqual('Repository tree',
- info.describe_layout(tree.branch.repository, tree.branch, tree))
+ info.describe_layout(tree.branch.repository, tree.branch, tree,
+ control=tree.bzrdir))
tree.branch.bind(tree.branch)
self.assertEqual('Repository checkout',
- info.describe_layout(tree.branch.repository, tree.branch, tree))
+ info.describe_layout(tree.branch.repository, tree.branch, tree,
+ control=tree.bzrdir))
checkout = tree.branch.create_checkout('checkout', lightweight=True)
self.assertEqual('Lightweight checkout',
info.describe_layout(checkout.branch.repository, checkout.branch,
- checkout))
+ checkout, control=tree.bzrdir))
def assertTreeDescription(self, format):
"""Assert a tree's format description matches expectations"""
=== modified file 'doc/en/release-notes/bzr-2.5.txt'
--- a/doc/en/release-notes/bzr-2.5.txt 2012-01-19 15:57:10 +0000
+++ b/doc/en/release-notes/bzr-2.5.txt 2012-01-19 16:51:39 +0000
@@ -29,6 +29,9 @@
* "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
+ branches. (Jelmer Vernooij, #891646)
+
* New HPSS call for ``BzrDir.get_branches``. (Jelmer Vernooij, #894460)
Bug Fixes
More information about the bazaar-commits
mailing list