Merge lp:~vila/qbzr/433843-fix-isolation-breaks into lp:~qbzr-dev/qbzr/trunk

Proposed by Vincent Ladeuil
Status: Merged
Merged at revision: not available
Proposed branch: lp:~vila/qbzr/433843-fix-isolation-breaks
Merge into: lp:~qbzr-dev/qbzr/trunk
Diff against target: None lines
To merge this branch: bzr merge lp:~vila/qbzr/433843-fix-isolation-breaks
Reviewer Review Type Date Requested Status
Gary van der Merwe Approve
Robert Collins Pending
Review via email: mp+12151@code.launchpad.net

This proposal supersedes a proposal from 2009-09-21.

To post a comment you must log in.
Revision history for this message
Vincent Ladeuil (vila) wrote : Posted in a previous version of this proposal

Defect localisation rules :)
Eager tests must die !

Revision history for this message
Robert Collins (lifeless) wrote : Posted in a previous version of this proposal

rather than '/non/existent/path' I suggest
self.vfs_transport_factory = MemoryTransport
... self.get_url('non/existent/path')

permit_dir('/') will break if / has a branch.

-Rob

review: Needs Fixing
Revision history for this message
Alexander Belchenko (bialix) wrote : Posted in a previous version of this proposal

This patch require bzr.dev (API v.2.1 or higher) and incompatible with bzr 1.18-2.0.
Either self.permit_dir should be optional or we can't merge this patch right now.

Revision history for this message
Vincent Ladeuil (vila) wrote :

Same spirit, different implementation, wider audience.

Revision history for this message
Robert Collins (lifeless) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Looks fine to me; should be bzr 2.0 API compatible too :)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkq3SsoACgkQ42zgmrPGrq5JrQCeN6nRS6IvoFVqn2vGaVlzmKYC
7ZkAoJomik/xjphQD5KXATAhnxFVWKgO
=4AZ8
-----END PGP SIGNATURE-----

Revision history for this message
Vincent Ladeuil (vila) wrote :

> Looks fine to me; should be bzr 2.0 API compatible too :)

That was the idea yes, hence the "wider audience" :-D

Revision history for this message
Alexander Belchenko (bialix) wrote :

Today qbzr trunk has 4 failures unrelated to the scope of your patch. But those failures prevents me to properly review and test your patch. Sorry. I hope we will return to it soon.

Revision history for this message
Gary van der Merwe (garyvdm) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/tests/test_loggraphprovider.py'
2--- lib/tests/test_loggraphprovider.py 2009-07-02 01:24:02 +0000
3+++ lib/tests/test_loggraphprovider.py 2009-09-21 09:35:43 +0000
4@@ -16,9 +16,13 @@
5 # along with this program; if not, write to the Free Software
6 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
7
8-from bzrlib import tests
9+from bzrlib import (
10+ errors,
11+ tests,
12+ )
13+from bzrlib.transport import memory
14 from bzrlib.plugins.qbzr.lib.loggraphprovider import LogGraphProvider
15-from bzrlib import errors
16+
17
18 class TestLogGraphProvider(tests.TestCaseWithTransport):
19
20@@ -149,13 +153,18 @@
21 (tree2.basedir, tree2.branch.base, None))),
22 set(self.branches_to_base(gp.branches)))
23
24+ def test_open_locations_in_shared_reporaise_not_a_branch(self):
25+ repo = self.make_repository("repo", shared=True)
26+ gp = LogGraphProvider(False)
27+ self.assertRaises(errors.NotBranchError,
28+ gp.open_locations, ["repo/non_existant_branch"])
29+
30 def test_open_locations_raise_not_a_branch(self):
31- repo = self.make_repository("repo", shared=True)
32+ self.vfs_transport_factory = memory.MemoryServer
33 gp = LogGraphProvider(False)
34 self.assertRaises(errors.NotBranchError,
35- gp.open_locations, ["repo/non_existant_branch"])
36- self.assertRaises(errors.NotBranchError,
37- gp.open_locations, ["/non_existant_branch"])
38+ gp.open_locations,
39+ [self.get_url("non_existant_branch")])
40
41 def check_open_location_files(self):
42 gp = LogGraphProvider(False)
43
44=== modified file 'lib/tests/test_tree_branch.py'
45--- lib/tests/test_tree_branch.py 2009-08-29 14:30:02 +0000
46+++ lib/tests/test_tree_branch.py 2009-09-21 09:35:43 +0000
47@@ -21,36 +21,47 @@
48
49 """Tests for TreeBranch wrapper object."""
50
51-from bzrlib import errors, osutils
52-from bzrlib.tests import TestCase, TestCaseWithTransport
53-
54+from bzrlib import (
55+ errors,
56+ osutils,
57+ tests,
58+ )
59+from bzrlib.transport import memory
60 from bzrlib.plugins.qbzr.lib import tree_branch
61 from bzrlib.plugins.qbzr.lib.tests import mock
62
63
64-class TestTreeBranch(TestCaseWithTransport):
65+class TestTreeBranch(tests.TestCaseWithTransport):
66
67- def test_errors_no_ui_mode(self):
68- # no branch
69+ def test_errors_no_ui_mode_no_branch(self):
70+ self.vfs_transport_factory = memory.MemoryServer
71 mf = mock.MockFunction()
72 self.assertRaises(errors.NotBranchError,
73- tree_branch.TreeBranch.open_containing, '/non/existent/path',
74- ui_mode=False, _critical_dialog=mf)
75+ tree_branch.TreeBranch.open_containing,
76+ self.get_url('non/existent/path'),
77+ ui_mode=False, _critical_dialog=mf)
78 self.assertEqual(0, mf.count)
79- # no tree
80+
81+ def test_errors_no_ui_mode_no_tree(self):
82+ mf = mock.MockFunction()
83 self.make_branch('a')
84 self.assertRaises(errors.NoWorkingTree,
85 tree_branch.TreeBranch.open_containing, 'a', require_tree=True,
86 ui_mode=False, _critical_dialog=mf)
87 self.assertEqual(0, mf.count)
88
89- def test_errors_ui_mode(self):
90+ def test_errors_ui_mode_no_branch(self):
91+ self.vfs_transport_factory = memory.MemoryServer
92 mf = mock.MockFunction()
93- tb = tree_branch.TreeBranch.open_containing('/non/existent/path',
94+ tb = tree_branch.TreeBranch.open_containing(
95+ self.get_url('non/existent/path'),
96 ui_mode=True, _critical_dialog=mf)
97 self.assertEqual(None, tb)
98 self.assertEqual(1, mf.count)
99- #
100+
101+
102+ def test_errors_ui_mode_no_tree(self):
103+ mf = mock.MockFunction()
104 self.make_branch('a')
105 mf = mock.MockFunction()
106 tb = tree_branch.TreeBranch.open_containing('a',
107
108=== modified file 'lib/tests/test_util.py'
109--- lib/tests/test_util.py 2009-06-15 15:21:33 +0000
110+++ lib/tests/test_util.py 2009-09-21 09:35:43 +0000
111@@ -20,14 +20,17 @@
112
113 import sys
114
115-from bzrlib import errors
116-from bzrlib.tests import TestCase, TestCaseWithTransport
117+from bzrlib import (
118+ errors,
119+ tests,
120+ )
121+from bzrlib.transport import memory
122
123 from bzrlib.plugins.qbzr.lib import util
124 from bzrlib.plugins.qbzr.lib.tests import mock
125
126
127-class TestUtil(TestCase):
128+class TestUtil(tests.TestCase):
129
130 def test_file_extension(self):
131 self.assertEquals('', util.file_extension(''))
132@@ -170,14 +173,18 @@
133 self.assertEqual(1, util.ensure_unicode(1))
134
135
136-class TestOpenTree(TestCaseWithTransport):
137+class TestOpenTree(tests.TestCaseWithTransport):
138+
139+ def test_no_ui_mode_no_branch(self):
140+ self.vfs_transport_factory = memory.MemoryServer
141+ mf = mock.MockFunction()
142+ self.assertRaises(errors.NotBranchError,
143+ util.open_tree, self.get_url('non/existent/path'),
144+ ui_mode=False, _critical_dialog=mf)
145+ self.assertEqual(0, mf.count)
146
147 def test_no_ui_mode(self):
148 mf = mock.MockFunction()
149- self.assertRaises(errors.NotBranchError,
150- util.open_tree, '/non/existent/path', ui_mode=False, _critical_dialog=mf)
151- self.assertEqual(0, mf.count)
152- #
153 self.make_branch('a')
154 self.assertRaises(errors.NoWorkingTree,
155 util.open_tree, 'a', ui_mode=False, _critical_dialog=mf)
156@@ -188,12 +195,16 @@
157 self.assertNotEqual(None, tree)
158 self.assertEqual(0, mf.count)
159
160+ def test_ui_mode_no_branch(self):
161+ self.vfs_transport_factory = memory.MemoryServer
162+ mf = mock.MockFunction()
163+ tree = util.open_tree(self.get_url('/non/existent/path'),
164+ ui_mode=True, _critical_dialog=mf)
165+ self.assertEqual(None, tree)
166+ self.assertEqual(1, mf.count)
167+
168 def test_ui_mode(self):
169 mf = mock.MockFunction()
170- tree = util.open_tree('/non/existent/path', ui_mode=True, _critical_dialog=mf)
171- self.assertEqual(None, tree)
172- self.assertEqual(1, mf.count)
173- #
174 self.make_branch('a')
175 mf = mock.MockFunction()
176 tree = util.open_tree('a', ui_mode=True, _critical_dialog=mf)

Subscribers

People subscribed via source and target branches

to status/vote changes: