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
=== modified file 'breezy/tests/per_controldir/test_controldir.py'
--- breezy/tests/per_controldir/test_controldir.py 2018-02-24 15:50:23 +0000
+++ breezy/tests/per_controldir/test_controldir.py 2018-03-03 13:40:36 +0000
@@ -1667,16 +1667,19 @@
1667 "format does not support branch references")1667 "format does not support branch references")
1668 unused_repo = thisdir.create_repository()1668 unused_repo = thisdir.create_repository()
1669 master.lock_write()1669 master.lock_write()
1670 unused_repo.lock_write()1670 with unused_repo.lock_write():
1671 try:
1672 # two yes's : branch and repository. If the repo in this1671 # two yes's : branch and repository. If the repo in this
1673 # dir is inappropriately accessed, 3 will be needed, and1672 # dir is inappropriately accessed, 3 will be needed, and
1674 # we'll see that because the stream will be fully consumed1673 # we'll see that because the stream will be fully consumed
1675 breezy.ui.ui_factory = CannedInputUIFactory([True, True, True])1674 breezy.ui.ui_factory = CannedInputUIFactory([True, True, True])
1676 # determine if the repository will have been locked;1675 # determine if the repository will have been locked;
1677 this_repo_locked = \1676 this_repo_locked = \
1678 thisdir.open_repository().get_physical_lock_status()1677 thisdir.find_repository().get_physical_lock_status()
1679 master.controldir.break_lock()1678 try:
1679 master.controldir.break_lock()
1680 except NotImplementedError:
1681 # bzrdir does not support break_lock
1682 raise TestNotApplicable("format does not support breaking locks")
1680 if this_repo_locked:1683 if this_repo_locked:
1681 # only two ys should have been read1684 # only two ys should have been read
1682 self.assertEqual([True], breezy.ui.ui_factory.responses)1685 self.assertEqual([True], breezy.ui.ui_factory.responses)
@@ -1693,8 +1696,6 @@
1693 # lock should not have touched it.1696 # lock should not have touched it.
1694 repo = thisdir.open_repository()1697 repo = thisdir.open_repository()
1695 self.assertRaises(errors.LockContention, repo.lock_write)1698 self.assertRaises(errors.LockContention, repo.lock_write)
1696 finally:
1697 unused_repo.unlock()
1698 self.assertRaises(errors.LockBroken, master.unlock)1699 self.assertRaises(errors.LockBroken, master.unlock)
16991700
1700 def test_break_lock_tree(self):1701 def test_break_lock_tree(self):

Subscribers

People subscribed via source and target branches