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

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: 7224
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/switch-colocated
Merge into: lp:brz
Diff against target: 70 lines (+14/-7)
2 files modified
breezy/builtins.py (+9/-2)
breezy/tests/blackbox/test_switch.py (+5/-5)
To merge this branch: bzr merge lp:~jelmer/brz/switch-colocated
Reviewer Review Type Date Requested Status
Martin Packman Approve
Review via email: mp+361258@code.launchpad.net

Commit message

Display colocated branch name when switching between branches.

Description of the change

Display colocated branch name when switching between branches.

To post a comment you must log in.
Martin Packman (gz) wrote :

Looks good, thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/builtins.py'
2--- breezy/builtins.py 2018-12-10 05:22:17 +0000
3+++ breezy/builtins.py 2018-12-21 23:50:32 +0000
4@@ -6364,8 +6364,15 @@
5 if had_explicit_nick:
6 branch = control_dir.open_branch() # get the new branch!
7 branch.nick = to_branch.nick
8- note(gettext('Switched to branch: %s'),
9- urlutils.unescape_for_display(to_branch.base, 'utf-8'))
10+ if to_branch.name:
11+ if to_branch.controldir.control_url != control_dir.control_url:
12+ note(gettext('Switched to branch %s at %s'),
13+ to_branch.name, urlutils.unescape_for_display(to_branch.base, 'utf-8'))
14+ else:
15+ note(gettext('Switched to branch %s'), to_branch.name)
16+ else:
17+ note(gettext('Switched to branch at %s'),
18+ urlutils.unescape_for_display(to_branch.base, 'utf-8'))
19
20
21 class cmd_view(Command):
22
23=== modified file 'breezy/tests/blackbox/test_switch.py'
24--- breezy/tests/blackbox/test_switch.py 2018-11-16 23:28:26 +0000
25+++ breezy/tests/blackbox/test_switch.py 2018-12-21 23:50:32 +0000
26@@ -55,7 +55,7 @@
27 os.chdir('checkout')
28 out, err = self.run_bzr('switch ../branch2')
29 self.assertContainsRe(err, 'Tree is up to date at revision 0.\n')
30- self.assertContainsRe(err, 'Switched to branch: .*/branch2.\n')
31+ self.assertContainsRe(err, 'Switched to branch at .*/branch2.\n')
32 self.assertEqual('', out)
33
34 def test_switch_out_of_date_light_checkout(self):
35@@ -69,7 +69,7 @@
36 out, err = self.run_bzr('switch ../branch2')
37 #self.assertContainsRe(err, '\+N file')
38 self.assertContainsRe(err, 'Updated to revision 1.\n')
39- self.assertContainsRe(err, 'Switched to branch: .*/branch2.\n')
40+ self.assertContainsRe(err, 'Switched to branch at .*/branch2.\n')
41 self.assertEqual('', out)
42
43 def _test_switch_nick(self, lightweight):
44@@ -431,7 +431,7 @@
45 $ cd checkout
46 $ brz switch --create-branch switched
47 2>Tree is up to date at revision 0.
48- 2>Switched to branch:...switched...
49+ 2>Switched to branch at .../switched/
50 $ cd ..
51 ''' % locals())
52 bound_branch = branch.Branch.open_containing('checkout')[0]
53@@ -590,7 +590,7 @@
54 Created a standalone tree (format: 2a)
55 $ brz switch -b trunk
56 2>Tree is up to date at revision 0.
57- 2>Switched to branch:...
58+ 2>Switched to branch trunk
59 $ brz commit -m 1 --unchanged
60 2>Committing to: ...
61 2>Committed revision 1.
62@@ -599,7 +599,7 @@
63 2>Committed revision 2.
64 $ brz switch -b blah -r1
65 2>Updated to revision 1.
66- 2>Switched to branch:...
67+ 2>Switched to branch blah
68 $ brz branches
69 * blah
70 trunk

Subscribers

People subscribed via source and target branches