5557.1.15
by John Arbash Meinel
Merge bzr.dev 5597 to resolve NEWS, aka bzr-2.3.txt |
1 |
# Copyright (C) 2007-2011 Canonical Ltd
|
2363.5.11
by Aaron Bentley
All info tests pass |
2 |
#
|
3 |
# This program is free software; you can redistribute it and/or modify
|
|
4 |
# it under the terms of the GNU General Public License as published by
|
|
5 |
# the Free Software Foundation; either version 2 of the License, or
|
|
6 |
# (at your option) any later version.
|
|
7 |
#
|
|
8 |
# This program is distributed in the hope that it will be useful,
|
|
9 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
10 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
11 |
# GNU General Public License for more details.
|
|
12 |
#
|
|
13 |
# You should have received a copy of the GNU General Public License
|
|
14 |
# along with this program; if not, write to the Free Software
|
|
4183.7.1
by Sabin Iacob
update FSF mailing address |
15 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2363.5.11
by Aaron Bentley
All info tests pass |
16 |
|
2804.4.3
by Alexander Belchenko
fix for test_info-tests: using osutils.getcwd instead of os.getcwd (sigh) |
17 |
import sys |
2363.5.11
by Aaron Bentley
All info tests pass |
18 |
|
2363.5.2
by Aaron Bentley
Implement layout description |
19 |
from bzrlib import ( |
2363.5.5
by Aaron Bentley
add info.describe_format |
20 |
branch as _mod_branch, |
6241.2.1
by Jelmer Vernooij
bzr info now shows the bound location too for local branches without tree. |
21 |
controldir, |
2363.5.2
by Aaron Bentley
Implement layout description |
22 |
info, |
23 |
tests, |
|
2363.5.5
by Aaron Bentley
add info.describe_format |
24 |
workingtree, |
25 |
repository as _mod_repository, |
|
2363.5.2
by Aaron Bentley
Implement layout description |
26 |
)
|
27 |
||
28 |
||
29 |
class TestInfo(tests.TestCaseWithTransport): |
|
30 |
||
31 |
def test_describe_standalone_layout(self): |
|
32 |
tree = self.make_branch_and_tree('tree') |
|
33 |
self.assertEqual('Empty control directory', info.describe_layout()) |
|
34 |
self.assertEqual('Unshared repository with trees', |
|
35 |
info.describe_layout(tree.branch.repository)) |
|
36 |
tree.branch.repository.set_make_working_trees(False) |
|
37 |
self.assertEqual('Unshared repository', |
|
38 |
info.describe_layout(tree.branch.repository)) |
|
39 |
self.assertEqual('Standalone branch', |
|
40 |
info.describe_layout(tree.branch.repository, tree.branch)) |
|
41 |
self.assertEqual('Standalone branchless tree', |
|
42 |
info.describe_layout(tree.branch.repository, None, tree)) |
|
43 |
self.assertEqual('Standalone tree', |
|
44 |
info.describe_layout(tree.branch.repository, tree.branch, tree)) |
|
45 |
tree.branch.bind(tree.branch) |
|
46 |
self.assertEqual('Bound branch', |
|
47 |
info.describe_layout(tree.branch.repository, tree.branch)) |
|
48 |
self.assertEqual('Checkout', |
|
49 |
info.describe_layout(tree.branch.repository, tree.branch, tree)) |
|
50 |
checkout = tree.branch.create_checkout('checkout', lightweight=True) |
|
51 |
self.assertEqual('Lightweight checkout', |
|
52 |
info.describe_layout(checkout.branch.repository, checkout.branch, |
|
53 |
checkout)) |
|
54 |
||
55 |
def test_describe_repository_layout(self): |
|
56 |
repository = self.make_repository('.', shared=True) |
|
6241.2.1
by Jelmer Vernooij
bzr info now shows the bound location too for local branches without tree. |
57 |
tree = controldir.ControlDir.create_branch_convenience('tree', |
2363.5.2
by Aaron Bentley
Implement layout description |
58 |
force_new_tree=True).bzrdir.open_workingtree() |
59 |
self.assertEqual('Shared repository with trees', |
|
60 |
info.describe_layout(tree.branch.repository)) |
|
61 |
repository.set_make_working_trees(False) |
|
62 |
self.assertEqual('Shared repository', |
|
63 |
info.describe_layout(tree.branch.repository)) |
|
64 |
self.assertEqual('Repository branch', |
|
65 |
info.describe_layout(tree.branch.repository, tree.branch)) |
|
66 |
self.assertEqual('Repository branchless tree', |
|
67 |
info.describe_layout(tree.branch.repository, None, tree)) |
|
68 |
self.assertEqual('Repository tree', |
|
69 |
info.describe_layout(tree.branch.repository, tree.branch, tree)) |
|
70 |
tree.branch.bind(tree.branch) |
|
71 |
self.assertEqual('Repository checkout', |
|
72 |
info.describe_layout(tree.branch.repository, tree.branch, tree)) |
|
73 |
checkout = tree.branch.create_checkout('checkout', lightweight=True) |
|
2363.5.4
by Aaron Bentley
Eliminate the concept of a 'repository lightweight checkout' |
74 |
self.assertEqual('Lightweight checkout', |
2363.5.2
by Aaron Bentley
Implement layout description |
75 |
info.describe_layout(checkout.branch.repository, checkout.branch, |
76 |
checkout)) |
|
2363.5.5
by Aaron Bentley
add info.describe_format |
77 |
|
78 |
def assertTreeDescription(self, format): |
|
2363.5.22
by Aaron Bentley
Restructure tests |
79 |
"""Assert a tree's format description matches expectations"""
|
2363.5.6
by Aaron Bentley
Add short format description |
80 |
self.make_branch_and_tree('%s_tree' % format, format=format) |
2363.5.5
by Aaron Bentley
add info.describe_format |
81 |
tree = workingtree.WorkingTree.open('%s_tree' % format) |
82 |
self.assertEqual(format, info.describe_format(tree.bzrdir, |
|
83 |
tree.branch.repository, tree.branch, tree)) |
|
84 |
||
2363.5.6
by Aaron Bentley
Add short format description |
85 |
def assertCheckoutDescription(self, format, expected=None): |
2363.5.22
by Aaron Bentley
Restructure tests |
86 |
"""Assert a checkout's format description matches expectations"""
|
2363.5.6
by Aaron Bentley
Add short format description |
87 |
if expected is None: |
88 |
expected = format |
|
89 |
branch = self.make_branch('%s_cobranch' % format, format=format) |
|
90 |
# this ought to be easier...
|
|
91 |
branch.create_checkout('%s_co' % format, |
|
92 |
lightweight=True).bzrdir.destroy_workingtree() |
|
6241.2.1
by Jelmer Vernooij
bzr info now shows the bound location too for local branches without tree. |
93 |
control = controldir.ControlDir.open('%s_co' % format) |
2363.5.13
by Aaron Bentley
Fix environment pollution with assertCheckoutDescription |
94 |
old_format = control._format.workingtree_format |
95 |
try: |
|
96 |
control._format.workingtree_format = \ |
|
6241.2.1
by Jelmer Vernooij
bzr info now shows the bound location too for local branches without tree. |
97 |
controldir.format_registry.make_bzrdir(format).workingtree_format |
2363.5.13
by Aaron Bentley
Fix environment pollution with assertCheckoutDescription |
98 |
control.create_workingtree() |
99 |
tree = workingtree.WorkingTree.open('%s_co' % format) |
|
2592.4.2
by Martin Pool
exempt experimental-* formats from test_describe_checkout_format |
100 |
format_description = info.describe_format(tree.bzrdir, |
101 |
tree.branch.repository, tree.branch, tree) |
|
102 |
self.assertEqual(expected, format_description, |
|
103 |
"checkout of format called %r was described as %r" % |
|
104 |
(expected, format_description)) |
|
2363.5.13
by Aaron Bentley
Fix environment pollution with assertCheckoutDescription |
105 |
finally: |
106 |
control._format.workingtree_format = old_format |
|
2363.5.6
by Aaron Bentley
Add short format description |
107 |
|
2363.5.5
by Aaron Bentley
add info.describe_format |
108 |
def assertBranchDescription(self, format, expected=None): |
2363.5.22
by Aaron Bentley
Restructure tests |
109 |
"""Assert branch's format description matches expectations"""
|
2363.5.5
by Aaron Bentley
add info.describe_format |
110 |
if expected is None: |
111 |
expected = format |
|
2363.5.6
by Aaron Bentley
Add short format description |
112 |
self.make_branch('%s_branch' % format, format=format) |
2363.5.5
by Aaron Bentley
add info.describe_format |
113 |
branch = _mod_branch.Branch.open('%s_branch' % format) |
114 |
self.assertEqual(expected, info.describe_format(branch.bzrdir, |
|
115 |
branch.repository, branch, None)) |
|
116 |
||
117 |
def assertRepoDescription(self, format, expected=None): |
|
2363.5.22
by Aaron Bentley
Restructure tests |
118 |
"""Assert repository's format description matches expectations"""
|
2363.5.5
by Aaron Bentley
add info.describe_format |
119 |
if expected is None: |
120 |
expected = format |
|
2363.5.6
by Aaron Bentley
Add short format description |
121 |
self.make_repository('%s_repo' % format, format=format) |
2363.5.5
by Aaron Bentley
add info.describe_format |
122 |
repo = _mod_repository.Repository.open('%s_repo' % format) |
123 |
self.assertEqual(expected, info.describe_format(repo.bzrdir, |
|
124 |
repo, None, None)) |
|
125 |
||
2363.5.22
by Aaron Bentley
Restructure tests |
126 |
def test_describe_tree_format(self): |
6241.2.1
by Jelmer Vernooij
bzr info now shows the bound location too for local branches without tree. |
127 |
for key in controldir.format_registry.keys(): |
128 |
if key in controldir.format_registry.aliases(): |
|
2363.5.5
by Aaron Bentley
add info.describe_format |
129 |
continue
|
130 |
self.assertTreeDescription(key) |
|
131 |
||
2363.5.22
by Aaron Bentley
Restructure tests |
132 |
def test_describe_checkout_format(self): |
6241.2.1
by Jelmer Vernooij
bzr info now shows the bound location too for local branches without tree. |
133 |
for key in controldir.format_registry.keys(): |
134 |
if key in controldir.format_registry.aliases(): |
|
3152.2.2
by Robert Collins
The bzrdir format registry now accepts an ``alias`` keyword to |
135 |
# Aliases will not describe correctly in the UI because the
|
136 |
# real format is found.
|
|
137 |
continue
|
|
138 |
# legacy: weave does not support checkouts
|
|
139 |
if key == 'weave': |
|
140 |
continue
|
|
6241.2.1
by Jelmer Vernooij
bzr info now shows the bound location too for local branches without tree. |
141 |
if controldir.format_registry.get_info(key).experimental: |
3152.2.2
by Robert Collins
The bzrdir format registry now accepts an ``alias`` keyword to |
142 |
# We don't require that experimental formats support checkouts
|
143 |
# or describe correctly in the UI.
|
|
2363.5.6
by Aaron Bentley
Add short format description |
144 |
continue
|
6241.2.1
by Jelmer Vernooij
bzr info now shows the bound location too for local branches without tree. |
145 |
if controldir.format_registry.get_info(key).hidden: |
4976.2.1
by Ian Clatworthy
Hide most storage formats |
146 |
continue
|
2363.5.6
by Aaron Bentley
Add short format description |
147 |
expected = None |
4977.1.2
by Ian Clatworthy
(igc) Fix comparison bug in format name tests (trivial) |
148 |
if key in ('pack-0.92',): |
4976.2.1
by Ian Clatworthy
Hide most storage formats |
149 |
expected = 'pack-0.92' |
3586.2.6
by Ian Clatworthy
add 1.7 and 1.7-rich-root formats |
150 |
elif key in ('knit', 'metaweave'): |
6241.2.1
by Jelmer Vernooij
bzr info now shows the bound location too for local branches without tree. |
151 |
if 'metaweave' in controldir.format_registry: |
5582.10.96
by Jelmer Vernooij
Support running without plugins. |
152 |
expected = 'knit or metaweave' |
153 |
else: |
|
154 |
expected = 'knit' |
|
4210.4.1
by Ian Clatworthy
replace experimental development-wt5 formats with 1.14 formats |
155 |
elif key in ('1.14', '1.14-rich-root'): |
4265.1.1
by John Arbash Meinel
Merge the a couple rev older brisbane-core into bzr.dev, most things are resolve in favor of bzr.dev |
156 |
expected = '1.14 or 1.14-rich-root' |
2363.5.6
by Aaron Bentley
Add short format description |
157 |
self.assertCheckoutDescription(key, expected) |
158 |
||
2363.5.22
by Aaron Bentley
Restructure tests |
159 |
def test_describe_branch_format(self): |
6241.2.1
by Jelmer Vernooij
bzr info now shows the bound location too for local branches without tree. |
160 |
for key in controldir.format_registry.keys(): |
161 |
if key in controldir.format_registry.aliases(): |
|
2363.5.5
by Aaron Bentley
add info.describe_format |
162 |
continue
|
6241.2.1
by Jelmer Vernooij
bzr info now shows the bound location too for local branches without tree. |
163 |
if controldir.format_registry.get_info(key).hidden: |
4210.4.2
by Ian Clatworthy
split filtered views support out into WorkingTreeFormat6 |
164 |
continue
|
2363.5.5
by Aaron Bentley
add info.describe_format |
165 |
expected = None |
166 |
if key in ('dirstate', 'knit'): |
|
2363.5.17
by Aaron Bentley
Change separator from '/' to 'or' |
167 |
expected = 'dirstate or knit' |
4977.1.2
by Ian Clatworthy
(igc) Fix comparison bug in format name tests (trivial) |
168 |
elif key in ('1.14',): |
4976.2.1
by Ian Clatworthy
Hide most storage formats |
169 |
expected = '1.14' |
4977.1.2
by Ian Clatworthy
(igc) Fix comparison bug in format name tests (trivial) |
170 |
elif key in ('1.14-rich-root',): |
4976.2.1
by Ian Clatworthy
Hide most storage formats |
171 |
expected = '1.14-rich-root' |
2363.5.5
by Aaron Bentley
add info.describe_format |
172 |
self.assertBranchDescription(key, expected) |
173 |
||
2363.5.22
by Aaron Bentley
Restructure tests |
174 |
def test_describe_repo_format(self): |
6241.2.1
by Jelmer Vernooij
bzr info now shows the bound location too for local branches without tree. |
175 |
for key in controldir.format_registry.keys(): |
176 |
if key in controldir.format_registry.aliases(): |
|
2363.5.5
by Aaron Bentley
add info.describe_format |
177 |
continue
|
6241.2.1
by Jelmer Vernooij
bzr info now shows the bound location too for local branches without tree. |
178 |
if controldir.format_registry.get_info(key).hidden: |
4210.4.2
by Ian Clatworthy
split filtered views support out into WorkingTreeFormat6 |
179 |
continue
|
2363.5.5
by Aaron Bentley
add info.describe_format |
180 |
expected = None |
181 |
if key in ('dirstate', 'knit', 'dirstate-tags'): |
|
2363.5.17
by Aaron Bentley
Change separator from '/' to 'or' |
182 |
expected = 'dirstate or dirstate-tags or knit' |
4977.1.2
by Ian Clatworthy
(igc) Fix comparison bug in format name tests (trivial) |
183 |
elif key in ('1.14',): |
4976.2.1
by Ian Clatworthy
Hide most storage formats |
184 |
expected = '1.14' |
4977.1.2
by Ian Clatworthy
(igc) Fix comparison bug in format name tests (trivial) |
185 |
elif key in ('1.14-rich-root',): |
4976.2.1
by Ian Clatworthy
Hide most storage formats |
186 |
expected = '1.14-rich-root' |
2363.5.5
by Aaron Bentley
add info.describe_format |
187 |
self.assertRepoDescription(key, expected) |
188 |
||
6241.2.1
by Jelmer Vernooij
bzr info now shows the bound location too for local branches without tree. |
189 |
format = controldir.format_registry.make_bzrdir('knit') |
2363.5.5
by Aaron Bentley
add info.describe_format |
190 |
format.set_branch_format(_mod_branch.BzrBranchFormat6()) |
191 |
tree = self.make_branch_and_tree('unknown', format=format) |
|
192 |
self.assertEqual('unnamed', info.describe_format(tree.bzrdir, |
|
193 |
tree.branch.repository, tree.branch, tree)) |
|
2363.5.18
by Aaron Bentley
Get all tests passing |
194 |
|
6241.4.1
by Jelmer Vernooij
Make gather_location_info understand control directories. |
195 |
def test_gather_location_controldir_only(self): |
196 |
bzrdir = self.make_bzrdir('.') |
|
197 |
self.assertEqual([('control directory', bzrdir.user_url)], |
|
198 |
info.gather_location_info(control=bzrdir)) |
|
199 |
||
2363.5.18
by Aaron Bentley
Get all tests passing |
200 |
def test_gather_location_standalone(self): |
201 |
tree = self.make_branch_and_tree('tree') |
|
2363.5.23
by Aaron Bentley
Output 2-tuples from gather_locations |
202 |
self.assertEqual([('branch root', tree.bzrdir.root_transport.base)], |
6241.4.1
by Jelmer Vernooij
Make gather_location_info understand control directories. |
203 |
info.gather_location_info( |
204 |
tree.branch.repository, tree.branch, tree, control=tree.bzrdir)) |
|
2363.5.23
by Aaron Bentley
Output 2-tuples from gather_locations |
205 |
self.assertEqual([('branch root', tree.bzrdir.root_transport.base)], |
6241.4.1
by Jelmer Vernooij
Make gather_location_info understand control directories. |
206 |
info.gather_location_info( |
207 |
tree.branch.repository, tree.branch, control=tree.bzrdir)) |
|
2363.5.18
by Aaron Bentley
Get all tests passing |
208 |
return tree |
209 |
||
210 |
def test_gather_location_repo(self): |
|
211 |
srepo = self.make_repository('shared', shared=True) |
|
6241.4.1
by Jelmer Vernooij
Make gather_location_info understand control directories. |
212 |
self.assertEqual( |
213 |
[('shared repository', srepo.bzrdir.root_transport.base)], |
|
214 |
info.gather_location_info(srepo, control=srepo.bzrdir)) |
|
2363.5.18
by Aaron Bentley
Get all tests passing |
215 |
urepo = self.make_repository('unshared') |
6241.4.1
by Jelmer Vernooij
Make gather_location_info understand control directories. |
216 |
self.assertEqual( |
217 |
[('repository', urepo.bzrdir.root_transport.base)], |
|
218 |
info.gather_location_info(urepo, control=urepo.bzrdir)) |
|
2363.5.18
by Aaron Bentley
Get all tests passing |
219 |
|
220 |
def test_gather_location_repo_branch(self): |
|
221 |
srepo = self.make_repository('shared', shared=True) |
|
6241.4.1
by Jelmer Vernooij
Make gather_location_info understand control directories. |
222 |
self.assertEqual( |
223 |
[('shared repository', srepo.bzrdir.root_transport.base)], |
|
224 |
info.gather_location_info(srepo, control=srepo.bzrdir)) |
|
2363.5.18
by Aaron Bentley
Get all tests passing |
225 |
tree = self.make_branch_and_tree('shared/tree') |
6241.4.1
by Jelmer Vernooij
Make gather_location_info understand control directories. |
226 |
self.assertEqual( |
227 |
[('shared repository', srepo.bzrdir.root_transport.base), |
|
228 |
('repository branch', tree.branch.base)], |
|
229 |
info.gather_location_info(srepo, tree.branch, tree, srepo.bzrdir)) |
|
2363.5.18
by Aaron Bentley
Get all tests passing |
230 |
|
2363.5.22
by Aaron Bentley
Restructure tests |
231 |
def test_gather_location_light_checkout(self): |
2363.5.18
by Aaron Bentley
Get all tests passing |
232 |
tree = self.make_branch_and_tree('tree') |
233 |
lcheckout = tree.branch.create_checkout('lcheckout', lightweight=True) |
|
234 |
self.assertEqual( |
|
2363.5.23
by Aaron Bentley
Output 2-tuples from gather_locations |
235 |
[('light checkout root', lcheckout.bzrdir.root_transport.base), |
236 |
('checkout of branch', tree.bzrdir.root_transport.base)], |
|
2363.5.22
by Aaron Bentley
Restructure tests |
237 |
self.gather_tree_location_info(lcheckout)) |
238 |
||
239 |
def test_gather_location_heavy_checkout(self): |
|
240 |
tree = self.make_branch_and_tree('tree') |
|
241 |
checkout = tree.branch.create_checkout('checkout') |
|
242 |
self.assertEqual( |
|
2363.5.23
by Aaron Bentley
Output 2-tuples from gather_locations |
243 |
[('checkout root', checkout.bzrdir.root_transport.base), |
244 |
('checkout of branch', tree.bzrdir.root_transport.base)], |
|
2363.5.22
by Aaron Bentley
Restructure tests |
245 |
self.gather_tree_location_info(checkout)) |
246 |
light_checkout = checkout.branch.create_checkout('light_checkout', |
|
247 |
lightweight=True) |
|
248 |
self.assertEqual( |
|
2363.5.23
by Aaron Bentley
Output 2-tuples from gather_locations |
249 |
[('light checkout root', |
250 |
light_checkout.bzrdir.root_transport.base), |
|
251 |
('checkout root', checkout.bzrdir.root_transport.base), |
|
252 |
('checkout of branch', tree.bzrdir.root_transport.base)], |
|
2363.5.22
by Aaron Bentley
Restructure tests |
253 |
self.gather_tree_location_info(light_checkout) |
254 |
)
|
|
255 |
||
256 |
def test_gather_location_shared_repo_checkout(self): |
|
257 |
tree = self.make_branch_and_tree('tree') |
|
2363.5.18
by Aaron Bentley
Get all tests passing |
258 |
srepo = self.make_repository('shared', shared=True) |
2363.5.22
by Aaron Bentley
Restructure tests |
259 |
shared_checkout = tree.branch.create_checkout('shared/checkout') |
2363.5.18
by Aaron Bentley
Get all tests passing |
260 |
self.assertEqual( |
2363.5.23
by Aaron Bentley
Output 2-tuples from gather_locations |
261 |
[('repository checkout root', |
262 |
shared_checkout.bzrdir.root_transport.base), |
|
263 |
('checkout of branch', tree.bzrdir.root_transport.base), |
|
264 |
('shared repository', srepo.bzrdir.root_transport.base)], |
|
2363.5.22
by Aaron Bentley
Restructure tests |
265 |
self.gather_tree_location_info(shared_checkout)) |
266 |
||
267 |
def gather_tree_location_info(self, tree): |
|
6241.4.1
by Jelmer Vernooij
Make gather_location_info understand control directories. |
268 |
return info.gather_location_info( |
269 |
tree.branch.repository, tree.branch, tree, tree.bzrdir) |
|
2363.5.19
by Aaron Bentley
Add support for bound branches |
270 |
|
271 |
def test_gather_location_bound(self): |
|
272 |
branch = self.make_branch('branch') |
|
273 |
bound_branch = self.make_branch('bound_branch') |
|
274 |
bound_branch.bind(branch) |
|
275 |
self.assertEqual( |
|
2363.5.23
by Aaron Bentley
Output 2-tuples from gather_locations |
276 |
[('branch root', bound_branch.bzrdir.root_transport.base), |
277 |
('bound to branch', branch.bzrdir.root_transport.base)], |
|
6241.4.1
by Jelmer Vernooij
Make gather_location_info understand control directories. |
278 |
info.gather_location_info( |
279 |
bound_branch.repository, bound_branch, control=bound_branch.bzrdir) |
|
2363.5.19
by Aaron Bentley
Add support for bound branches |
280 |
)
|
1551.15.41
by Aaron Bentley
Make info provide more related brances, and format all branches nicely |
281 |
|
6241.2.1
by Jelmer Vernooij
bzr info now shows the bound location too for local branches without tree. |
282 |
def test_gather_location_bound_in_repository(self): |
283 |
repo = self.make_repository('repo', shared=True) |
|
284 |
repo.set_make_working_trees(False) |
|
285 |
branch = self.make_branch('branch') |
|
286 |
bound_branch = controldir.ControlDir.create_branch_convenience( |
|
287 |
'repo/bound_branch') |
|
288 |
bound_branch.bind(branch) |
|
289 |
self.assertEqual( |
|
290 |
[('shared repository', bound_branch.repository.bzrdir.user_url), |
|
291 |
('repository branch', bound_branch.bzrdir.user_url), |
|
292 |
('bound to branch', branch.bzrdir.user_url)], |
|
293 |
info.gather_location_info(bound_branch.repository, bound_branch) |
|
294 |
)
|
|
295 |
||
1551.15.41
by Aaron Bentley
Make info provide more related brances, and format all branches nicely |
296 |
def test_location_list(self): |
2804.4.3
by Alexander Belchenko
fix for test_info-tests: using osutils.getcwd instead of os.getcwd (sigh) |
297 |
if sys.platform == 'win32': |
298 |
raise tests.TestSkipped('Windows-unfriendly test') |
|
1551.15.41
by Aaron Bentley
Make info provide more related brances, and format all branches nicely |
299 |
locs = info.LocationList('/home/foo') |
300 |
locs.add_url('a', 'file:///home/foo/') |
|
301 |
locs.add_url('b', 'file:///home/foo/bar/') |
|
302 |
locs.add_url('c', 'file:///home/bar/bar') |
|
303 |
locs.add_url('d', 'http://example.com/example/') |
|
304 |
locs.add_url('e', None) |
|
1551.15.43
by Aaron Bentley
Provide ways of getting at unicode-clean output |
305 |
self.assertEqual(locs.locs, [('a', '.'), |
1551.15.41
by Aaron Bentley
Make info provide more related brances, and format all branches nicely |
306 |
('b', 'bar'), |
307 |
('c', '/home/bar/bar'), |
|
308 |
('d', 'http://example.com/example/')]) |
|
1551.15.43
by Aaron Bentley
Provide ways of getting at unicode-clean output |
309 |
self.assertEqualDiff(' a: .\n b: bar\n c: /home/bar/bar\n' |
310 |
' d: http://example.com/example/\n', |
|
311 |
''.join(locs.get_lines())) |
|
1551.15.41
by Aaron Bentley
Make info provide more related brances, and format all branches nicely |
312 |
|
313 |
def test_gather_related_braches(self): |
|
314 |
branch = self.make_branch('.') |
|
315 |
branch.set_public_branch('baz') |
|
316 |
branch.set_push_location('bar') |
|
317 |
branch.set_parent('foo') |
|
318 |
branch.set_submit_branch('qux') |
|
319 |
self.assertEqual( |
|
320 |
[('public branch', 'baz'), ('push branch', 'bar'), |
|
321 |
('parent branch', 'foo'), ('submit branch', 'qux')], |
|
1551.15.43
by Aaron Bentley
Provide ways of getting at unicode-clean output |
322 |
info._gather_related_branches(branch).locs) |