Merge lp:~jelmer/brz/info-colocated into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: 7213
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/info-colocated
Merge into: lp:brz
Diff against target: 73 lines (+30/-5)
3 files modified
breezy/git/tests/test_blackbox.py (+6/-1)
breezy/info.py (+12/-4)
breezy/tests/blackbox/test_info.py (+12/-0)
To merge this branch: bzr merge lp:~jelmer/brz/info-colocated
Reviewer Review Type Date Requested Status
Martin Packman Approve
Review via email: mp+359663@code.launchpad.net

Commit message

Show colocated branch name in 'brz info'.

Description of the change

Show colocated branch name in 'brz info'.

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote :

Looks good, thanks!

review: Approve
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Flake8 failures.

On December 10, 2018 2:51:53 AM UTC, The Breezy Bot <email address hidden> wrote:
>Running landing tests failed
>https://ci.breezy-vcs.org/job/brz/job/brz-land/129/
>--
>https://code.launchpad.net/~jelmer/brz/info-colocated/+merge/359663
>You are the owner of lp:~jelmer/brz/info-colocated.

Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
lp:~jelmer/brz/info-colocated updated
7214. By Jelmer Vernooij

Merge trunk.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/git/tests/test_blackbox.py'
2--- breezy/git/tests/test_blackbox.py 2018-11-19 20:11:08 +0000
3+++ breezy/git/tests/test_blackbox.py 2018-12-11 00:00:51 +0000
4@@ -63,7 +63,12 @@
5 self.simple_commit()
6 output, error = self.run_bzr(['info'])
7 self.assertEqual(error, '')
8- self.assertTrue("Standalone tree (format: git)" in output)
9+ self.assertEqual(
10+ output,
11+ 'Standalone tree (format: git)\n'
12+ 'Location:\n'
13+ ' light checkout root: .\n'
14+ ' checkout of co-located branch: master\n')
15
16 def test_ignore(self):
17 self.simple_commit()
18
19=== modified file 'breezy/info.py'
20--- breezy/info.py 2018-11-12 01:41:38 +0000
21+++ breezy/info.py 2018-12-11 00:00:51 +0000
22@@ -108,7 +108,15 @@
23 else:
24 locs['checkout root'] = branch_path
25 if working_path != master_path:
26- locs['checkout of branch'] = master_path
27+ (master_path_base, params) = urlutils.split_segment_parameters(
28+ master_path)
29+ if working_path == master_path_base:
30+ locs['checkout of co-located branch'] = params['branch']
31+ elif 'branch' in params:
32+ locs['checkout of branch'] = "%s, branch %s" (
33+ master_path_base, params['branch'])
34+ else:
35+ locs['checkout of branch'] = master_path
36 elif repository.is_shared():
37 locs['repository branch'] = branch_path
38 elif branch_path is not None:
39@@ -138,9 +146,9 @@
40 locs['shared repository'] = repository.user_url
41 order = ['control directory', 'light checkout root',
42 'repository checkout root', 'checkout root',
43- 'checkout of branch', 'shared repository',
44- 'repository', 'repository branch', 'branch root',
45- 'bound to branch']
46+ 'checkout of branch', 'checkout of co-located branch',
47+ 'shared repository', 'repository', 'repository branch',
48+ 'branch root', 'bound to branch']
49 return [(n, locs[n]) for n in order if n in locs]
50
51
52
53=== modified file 'breezy/tests/blackbox/test_info.py'
54--- breezy/tests/blackbox/test_info.py 2018-11-11 04:08:32 +0000
55+++ breezy/tests/blackbox/test_info.py 2018-12-11 00:00:51 +0000
56@@ -84,6 +84,18 @@
57 ' checkout of branch: target\n')
58 self.assertEqual(err, '')
59
60+ def test_info_colocated(self):
61+ br = self.make_branch_and_tree('target', format='development-colo')
62+ target = br.controldir.create_branch(name='dichtbij')
63+ br.controldir.set_branch_reference(target)
64+ out, err = self.run_bzr('info target')
65+ self.assertEqual(out,
66+ 'Standalone tree (format: development-colo)\n'
67+ 'Location:\n'
68+ ' light checkout root: target\n'
69+ ' checkout of co-located branch: dichtbij\n')
70+ self.assertEqual(err, '')
71+
72 def test_info_standalone(self):
73 transport = self.get_transport()
74

Subscribers

People subscribed via source and target branches