14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
from urllib import quote
18
19
from bzrlib import (
19
20
branch as _mod_branch,
187
188
tree = self.make_branch_and_tree('shared/tree')
188
189
self.assertEqual([('shared repository',
189
190
srepo.bzrdir.root_transport.base),
190
('repository branch', 'tree')],
191
('repository branch', tree.branch.base)],
191
192
info.gather_location_info(srepo, tree.branch, tree))
193
194
def test_gather_location_light_checkout(self):
239
240
('bound to branch', branch.bzrdir.root_transport.base)],
240
241
info.gather_location_info(bound_branch.repository, bound_branch)
244
def test_location_list(self):
245
locs = info.LocationList('/home/foo')
246
locs.add_url('a', 'file:///home/foo/')
247
locs.add_url('b', 'file:///home/foo/bar/')
248
locs.add_url('c', 'file:///home/bar/bar')
249
locs.add_url('d', 'http://example.com/example/')
250
locs.add_url('e', None)
251
self.assertEqual(locs.locs, [('a', '.'),
253
('c', '/home/bar/bar'),
254
('d', 'http://example.com/example/')])
255
self.assertEqualDiff(' a: .\n b: bar\n c: /home/bar/bar\n'
256
' d: http://example.com/example/\n',
257
''.join(locs.get_lines()))
259
def test_gather_related_braches(self):
260
branch = self.make_branch('.')
261
branch.set_public_branch('baz')
262
branch.set_push_location('bar')
263
branch.set_parent('foo')
264
branch.set_submit_branch('qux')
266
[('public branch', 'baz'), ('push branch', 'bar'),
267
('parent branch', 'foo'), ('submit branch', 'qux')],
268
info._gather_related_branches(branch).locs)