Merge lp:~jelmer/bzr/info-mentions-unused-colo-branches into lp:bzr/2.5

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Vincent Ladeuil
Approved revision: no longer in the source branch.
Merged at revision: 6452
Proposed branch: lp:~jelmer/bzr/info-mentions-unused-colo-branches
Merge into: lp:bzr/2.5
Diff against target: 171 lines (+59/-22) (has conflicts)
5 files modified
bzrlib/info.py (+7/-2)
bzrlib/tests/blackbox/test_info.py (+16/-0)
bzrlib/tests/blackbox/test_shared_repository.py (+1/-1)
bzrlib/tests/test_info.py (+29/-19)
doc/en/release-notes/bzr-2.5.txt (+6/-0)
Text conflict in doc/en/release-notes/bzr-2.5.txt
To merge this branch: bzr merge lp:~jelmer/bzr/info-mentions-unused-colo-branches
Reviewer Review Type Date Requested Status
Vincent Ladeuil Approve
Review via email: mp+89141@code.launchpad.net

Commit message

Mention unused colocated branches in 'bzr info' output.

Description of the change

In 'bzr info', mention when there are present (but unused) colocated branches.

To post a comment you must log in.
Revision history for this message
Vincent Ladeuil (vila) wrote :

40 + # Create unsahred repository

s/ unsahred/ unshared/

Otherwise: nice !

review: Approve
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

sent to pqm by email

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

sent to pqm by email

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/info.py'
2--- bzrlib/info.py 2011-12-18 15:28:38 +0000
3+++ bzrlib/info.py 2012-01-19 16:27:26 +0000
4@@ -352,7 +352,7 @@
5 except (NoWorkingTree, NotLocalUrl, NotBranchError):
6 tree = None
7 try:
8- branch = a_bzrdir.open_branch()
9+ branch = a_bzrdir.open_branch(name="")
10 except NotBranchError:
11 branch = None
12 try:
13@@ -442,8 +442,13 @@
14 phrase = 'Shared repository'
15 else:
16 phrase = 'Unshared repository'
17+ extra = []
18 if repository.make_working_trees():
19- phrase += ' with trees'
20+ extra.append('trees')
21+ if len(control.get_branches()) > 0:
22+ extra.append('colocated branches')
23+ if extra:
24+ phrase += ' with ' + " and ".join(extra)
25 return phrase
26 else:
27 if repository.is_shared():
28
29=== modified file 'bzrlib/tests/blackbox/test_info.py'
30--- bzrlib/tests/blackbox/test_info.py 2012-01-18 17:47:06 +0000
31+++ bzrlib/tests/blackbox/test_info.py 2012-01-19 16:27:26 +0000
32@@ -1097,6 +1097,22 @@
33 ), out)
34 self.assertEqual('', err)
35
36+ def test_info_unshared_repository_with_colocated_branches(self):
37+ format = bzrdir.format_registry.make_bzrdir('development-colo')
38+ transport = self.get_transport()
39+
40+ # Create unshared repository
41+ repo = self.make_repository('repo', shared=False, format=format)
42+ repo.set_make_working_trees(True)
43+ repo.bzrdir.create_branch(name='foo')
44+ out, err = self.run_bzr('info repo')
45+ self.assertEqualDiff(
46+"""Unshared repository with trees and colocated branches (format: development-colo)
47+Location:
48+ repository: repo
49+""", out)
50+ self.assertEqual('', err)
51+
52 def assertCheckoutStatusOutput(self,
53 command_string, lco_tree, shared_repo=None,
54 repo_branch=None,
55
56=== modified file 'bzrlib/tests/blackbox/test_shared_repository.py'
57--- bzrlib/tests/blackbox/test_shared_repository.py 2011-12-30 14:36:46 +0000
58+++ bzrlib/tests/blackbox/test_shared_repository.py 2012-01-19 16:27:26 +0000
59@@ -121,7 +121,7 @@
60 # being too low. If rpc_count increases, more network roundtrips have
61 # become necessary for this use case. Please do not adjust this number
62 # upwards without agreement from bzr's network support maintainers.
63- self.assertLength(10, self.hpss_calls)
64+ self.assertLength(11, self.hpss_calls)
65 self.assertLength(1, self.hpss_connections)
66 self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
67
68
69=== modified file 'bzrlib/tests/test_info.py'
70--- bzrlib/tests/test_info.py 2011-11-15 17:27:46 +0000
71+++ bzrlib/tests/test_info.py 2012-01-19 16:27:26 +0000
72@@ -31,49 +31,59 @@
73 def test_describe_standalone_layout(self):
74 tree = self.make_branch_and_tree('tree')
75 self.assertEqual('Empty control directory', info.describe_layout())
76- self.assertEqual('Unshared repository with trees',
77- info.describe_layout(tree.branch.repository))
78+ self.assertEqual(
79+ 'Unshared repository with trees and colocated branches',
80+ info.describe_layout(tree.branch.repository, control=tree.bzrdir))
81 tree.branch.repository.set_make_working_trees(False)
82- self.assertEqual('Unshared repository',
83- info.describe_layout(tree.branch.repository))
84+ self.assertEqual('Unshared repository with colocated branches',
85+ info.describe_layout(tree.branch.repository, control=tree.bzrdir))
86 self.assertEqual('Standalone branch',
87- info.describe_layout(tree.branch.repository, tree.branch))
88+ info.describe_layout(tree.branch.repository, tree.branch,
89+ control=tree.bzrdir))
90 self.assertEqual('Standalone branchless tree',
91- info.describe_layout(tree.branch.repository, None, tree))
92+ info.describe_layout(tree.branch.repository, None, tree,
93+ control=tree.bzrdir))
94 self.assertEqual('Standalone tree',
95- info.describe_layout(tree.branch.repository, tree.branch, tree))
96+ info.describe_layout(tree.branch.repository, tree.branch, tree,
97+ control=tree.bzrdir))
98 tree.branch.bind(tree.branch)
99 self.assertEqual('Bound branch',
100- info.describe_layout(tree.branch.repository, tree.branch))
101+ info.describe_layout(tree.branch.repository, tree.branch,
102+ control=tree.bzrdir))
103 self.assertEqual('Checkout',
104- info.describe_layout(tree.branch.repository, tree.branch, tree))
105+ info.describe_layout(tree.branch.repository, tree.branch, tree,
106+ control=tree.bzrdir))
107 checkout = tree.branch.create_checkout('checkout', lightweight=True)
108 self.assertEqual('Lightweight checkout',
109 info.describe_layout(checkout.branch.repository, checkout.branch,
110- checkout))
111+ checkout, control=tree.bzrdir))
112
113 def test_describe_repository_layout(self):
114 repository = self.make_repository('.', shared=True)
115 tree = controldir.ControlDir.create_branch_convenience('tree',
116 force_new_tree=True).bzrdir.open_workingtree()
117- self.assertEqual('Shared repository with trees',
118- info.describe_layout(tree.branch.repository))
119+ self.assertEqual('Shared repository with trees and colocated branches',
120+ info.describe_layout(tree.branch.repository, control=tree.bzrdir))
121 repository.set_make_working_trees(False)
122- self.assertEqual('Shared repository',
123- info.describe_layout(tree.branch.repository))
124+ self.assertEqual('Shared repository with colocated branches',
125+ info.describe_layout(tree.branch.repository, control=tree.bzrdir))
126 self.assertEqual('Repository branch',
127- info.describe_layout(tree.branch.repository, tree.branch))
128+ info.describe_layout(tree.branch.repository, tree.branch,
129+ control=tree.bzrdir))
130 self.assertEqual('Repository branchless tree',
131- info.describe_layout(tree.branch.repository, None, tree))
132+ info.describe_layout(tree.branch.repository, None, tree,
133+ control=tree.bzrdir))
134 self.assertEqual('Repository tree',
135- info.describe_layout(tree.branch.repository, tree.branch, tree))
136+ info.describe_layout(tree.branch.repository, tree.branch, tree,
137+ control=tree.bzrdir))
138 tree.branch.bind(tree.branch)
139 self.assertEqual('Repository checkout',
140- info.describe_layout(tree.branch.repository, tree.branch, tree))
141+ info.describe_layout(tree.branch.repository, tree.branch, tree,
142+ control=tree.bzrdir))
143 checkout = tree.branch.create_checkout('checkout', lightweight=True)
144 self.assertEqual('Lightweight checkout',
145 info.describe_layout(checkout.branch.repository, checkout.branch,
146- checkout))
147+ checkout, control=tree.bzrdir))
148
149 def assertTreeDescription(self, format):
150 """Assert a tree's format description matches expectations"""
151
152=== modified file 'doc/en/release-notes/bzr-2.5.txt'
153--- doc/en/release-notes/bzr-2.5.txt 2012-01-19 15:57:10 +0000
154+++ doc/en/release-notes/bzr-2.5.txt 2012-01-19 16:27:26 +0000
155@@ -26,11 +26,17 @@
156 .. Improvements to existing commands, especially improved performance
157 or memory usage, or better results.
158
159+<<<<<<< TREE
160 * "bzr switch -b" in a standalone tree will now create a colocated branch.
161 (Jelmer Vernooij, #918197)
162
163 * New HPSS call for ``BzrDir.get_branches``. (Jelmer Vernooij, #894460)
164
165+=======
166+* ``bzr info`` now reports when there are present (but unused) colocated
167+ branches. (Jelmer Vernooij, #891646)
168+
169+>>>>>>> MERGE-SOURCE
170 Bug Fixes
171 *********
172

Subscribers

People subscribed via source and target branches