Merge lp:~jelmer/brz/lock-breaking into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/lock-breaking
Merge into: lp:brz
Diff against target: 36 lines (+7/-6)
1 file modified
breezy/tests/per_controldir/test_controldir.py (+7/-6)
To merge this branch: bzr merge lp:~jelmer/brz/lock-breaking
Reviewer Review Type Date Requested Status
Martin Packman Approve
Review via email: mp+340563@code.launchpad.net

Commit message

Allow ControlDir.break_lock to not be implemented.

Description of the change

Allow ControlDir.break_lock to not be implemented.

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

Thanks.

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

Running landing tests failed
https://ci.breezy-vcs.org/job/brz-dev/1/

Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :

Running landing tests failed
https://ci.breezy-vcs.org/job/brz-dev/2/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/tests/per_controldir/test_controldir.py'
2--- breezy/tests/per_controldir/test_controldir.py 2018-02-24 15:50:23 +0000
3+++ breezy/tests/per_controldir/test_controldir.py 2018-03-03 13:40:36 +0000
4@@ -1667,16 +1667,19 @@
5 "format does not support branch references")
6 unused_repo = thisdir.create_repository()
7 master.lock_write()
8- unused_repo.lock_write()
9- try:
10+ with unused_repo.lock_write():
11 # two yes's : branch and repository. If the repo in this
12 # dir is inappropriately accessed, 3 will be needed, and
13 # we'll see that because the stream will be fully consumed
14 breezy.ui.ui_factory = CannedInputUIFactory([True, True, True])
15 # determine if the repository will have been locked;
16 this_repo_locked = \
17- thisdir.open_repository().get_physical_lock_status()
18- master.controldir.break_lock()
19+ thisdir.find_repository().get_physical_lock_status()
20+ try:
21+ master.controldir.break_lock()
22+ except NotImplementedError:
23+ # bzrdir does not support break_lock
24+ raise TestNotApplicable("format does not support breaking locks")
25 if this_repo_locked:
26 # only two ys should have been read
27 self.assertEqual([True], breezy.ui.ui_factory.responses)
28@@ -1693,8 +1696,6 @@
29 # lock should not have touched it.
30 repo = thisdir.open_repository()
31 self.assertRaises(errors.LockContention, repo.lock_write)
32- finally:
33- unused_repo.unlock()
34 self.assertRaises(errors.LockBroken, master.unlock)
35
36 def test_break_lock_tree(self):

Subscribers

People subscribed via source and target branches