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
=== modified file 'lib/tests/test_loggraphprovider.py'
--- lib/tests/test_loggraphprovider.py 2009-07-02 01:24:02 +0000
+++ lib/tests/test_loggraphprovider.py 2009-09-21 09:35:43 +0000
@@ -16,9 +16,13 @@
16# along with this program; if not, write to the Free Software16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.17# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1818
19from bzrlib import tests19from bzrlib import (
20 errors,
21 tests,
22 )
23from bzrlib.transport import memory
20from bzrlib.plugins.qbzr.lib.loggraphprovider import LogGraphProvider24from bzrlib.plugins.qbzr.lib.loggraphprovider import LogGraphProvider
21from bzrlib import errors25
2226
23class TestLogGraphProvider(tests.TestCaseWithTransport):27class TestLogGraphProvider(tests.TestCaseWithTransport):
2428
@@ -149,13 +153,18 @@
149 (tree2.basedir, tree2.branch.base, None))),153 (tree2.basedir, tree2.branch.base, None))),
150 set(self.branches_to_base(gp.branches)))154 set(self.branches_to_base(gp.branches)))
151 155
156 def test_open_locations_in_shared_reporaise_not_a_branch(self):
157 repo = self.make_repository("repo", shared=True)
158 gp = LogGraphProvider(False)
159 self.assertRaises(errors.NotBranchError,
160 gp.open_locations, ["repo/non_existant_branch"])
161
152 def test_open_locations_raise_not_a_branch(self):162 def test_open_locations_raise_not_a_branch(self):
153 repo = self.make_repository("repo", shared=True)163 self.vfs_transport_factory = memory.MemoryServer
154 gp = LogGraphProvider(False)164 gp = LogGraphProvider(False)
155 self.assertRaises(errors.NotBranchError,165 self.assertRaises(errors.NotBranchError,
156 gp.open_locations, ["repo/non_existant_branch"])166 gp.open_locations,
157 self.assertRaises(errors.NotBranchError,167 [self.get_url("non_existant_branch")])
158 gp.open_locations, ["/non_existant_branch"])
159168
160 def check_open_location_files(self):169 def check_open_location_files(self):
161 gp = LogGraphProvider(False)170 gp = LogGraphProvider(False)
162171
=== modified file 'lib/tests/test_tree_branch.py'
--- lib/tests/test_tree_branch.py 2009-08-29 14:30:02 +0000
+++ lib/tests/test_tree_branch.py 2009-09-21 09:35:43 +0000
@@ -21,36 +21,47 @@
2121
22"""Tests for TreeBranch wrapper object."""22"""Tests for TreeBranch wrapper object."""
2323
24from bzrlib import errors, osutils24from bzrlib import (
25from bzrlib.tests import TestCase, TestCaseWithTransport25 errors,
2626 osutils,
27 tests,
28 )
29from bzrlib.transport import memory
27from bzrlib.plugins.qbzr.lib import tree_branch30from bzrlib.plugins.qbzr.lib import tree_branch
28from bzrlib.plugins.qbzr.lib.tests import mock31from bzrlib.plugins.qbzr.lib.tests import mock
2932
3033
31class TestTreeBranch(TestCaseWithTransport):34class TestTreeBranch(tests.TestCaseWithTransport):
3235
33 def test_errors_no_ui_mode(self):36 def test_errors_no_ui_mode_no_branch(self):
34 # no branch37 self.vfs_transport_factory = memory.MemoryServer
35 mf = mock.MockFunction()38 mf = mock.MockFunction()
36 self.assertRaises(errors.NotBranchError,39 self.assertRaises(errors.NotBranchError,
37 tree_branch.TreeBranch.open_containing, '/non/existent/path',40 tree_branch.TreeBranch.open_containing,
38 ui_mode=False, _critical_dialog=mf)41 self.get_url('non/existent/path'),
42 ui_mode=False, _critical_dialog=mf)
39 self.assertEqual(0, mf.count)43 self.assertEqual(0, mf.count)
40 # no tree44
45 def test_errors_no_ui_mode_no_tree(self):
46 mf = mock.MockFunction()
41 self.make_branch('a')47 self.make_branch('a')
42 self.assertRaises(errors.NoWorkingTree,48 self.assertRaises(errors.NoWorkingTree,
43 tree_branch.TreeBranch.open_containing, 'a', require_tree=True,49 tree_branch.TreeBranch.open_containing, 'a', require_tree=True,
44 ui_mode=False, _critical_dialog=mf)50 ui_mode=False, _critical_dialog=mf)
45 self.assertEqual(0, mf.count)51 self.assertEqual(0, mf.count)
4652
47 def test_errors_ui_mode(self):53 def test_errors_ui_mode_no_branch(self):
54 self.vfs_transport_factory = memory.MemoryServer
48 mf = mock.MockFunction()55 mf = mock.MockFunction()
49 tb = tree_branch.TreeBranch.open_containing('/non/existent/path',56 tb = tree_branch.TreeBranch.open_containing(
57 self.get_url('non/existent/path'),
50 ui_mode=True, _critical_dialog=mf)58 ui_mode=True, _critical_dialog=mf)
51 self.assertEqual(None, tb)59 self.assertEqual(None, tb)
52 self.assertEqual(1, mf.count)60 self.assertEqual(1, mf.count)
53 #61
62
63 def test_errors_ui_mode_no_tree(self):
64 mf = mock.MockFunction()
54 self.make_branch('a')65 self.make_branch('a')
55 mf = mock.MockFunction()66 mf = mock.MockFunction()
56 tb = tree_branch.TreeBranch.open_containing('a',67 tb = tree_branch.TreeBranch.open_containing('a',
5768
=== modified file 'lib/tests/test_util.py'
--- lib/tests/test_util.py 2009-06-15 15:21:33 +0000
+++ lib/tests/test_util.py 2009-09-21 09:35:43 +0000
@@ -20,14 +20,17 @@
2020
21import sys21import sys
2222
23from bzrlib import errors23from bzrlib import (
24from bzrlib.tests import TestCase, TestCaseWithTransport24 errors,
25 tests,
26 )
27from bzrlib.transport import memory
2528
26from bzrlib.plugins.qbzr.lib import util29from bzrlib.plugins.qbzr.lib import util
27from bzrlib.plugins.qbzr.lib.tests import mock30from bzrlib.plugins.qbzr.lib.tests import mock
2831
2932
30class TestUtil(TestCase):33class TestUtil(tests.TestCase):
3134
32 def test_file_extension(self):35 def test_file_extension(self):
33 self.assertEquals('', util.file_extension(''))36 self.assertEquals('', util.file_extension(''))
@@ -170,14 +173,18 @@
170 self.assertEqual(1, util.ensure_unicode(1))173 self.assertEqual(1, util.ensure_unicode(1))
171174
172175
173class TestOpenTree(TestCaseWithTransport):176class TestOpenTree(tests.TestCaseWithTransport):
177
178 def test_no_ui_mode_no_branch(self):
179 self.vfs_transport_factory = memory.MemoryServer
180 mf = mock.MockFunction()
181 self.assertRaises(errors.NotBranchError,
182 util.open_tree, self.get_url('non/existent/path'),
183 ui_mode=False, _critical_dialog=mf)
184 self.assertEqual(0, mf.count)
174185
175 def test_no_ui_mode(self):186 def test_no_ui_mode(self):
176 mf = mock.MockFunction()187 mf = mock.MockFunction()
177 self.assertRaises(errors.NotBranchError,
178 util.open_tree, '/non/existent/path', ui_mode=False, _critical_dialog=mf)
179 self.assertEqual(0, mf.count)
180 #
181 self.make_branch('a')188 self.make_branch('a')
182 self.assertRaises(errors.NoWorkingTree,189 self.assertRaises(errors.NoWorkingTree,
183 util.open_tree, 'a', ui_mode=False, _critical_dialog=mf)190 util.open_tree, 'a', ui_mode=False, _critical_dialog=mf)
@@ -188,12 +195,16 @@
188 self.assertNotEqual(None, tree)195 self.assertNotEqual(None, tree)
189 self.assertEqual(0, mf.count)196 self.assertEqual(0, mf.count)
190197
198 def test_ui_mode_no_branch(self):
199 self.vfs_transport_factory = memory.MemoryServer
200 mf = mock.MockFunction()
201 tree = util.open_tree(self.get_url('/non/existent/path'),
202 ui_mode=True, _critical_dialog=mf)
203 self.assertEqual(None, tree)
204 self.assertEqual(1, mf.count)
205
191 def test_ui_mode(self):206 def test_ui_mode(self):
192 mf = mock.MockFunction()207 mf = mock.MockFunction()
193 tree = util.open_tree('/non/existent/path', ui_mode=True, _critical_dialog=mf)
194 self.assertEqual(None, tree)
195 self.assertEqual(1, mf.count)
196 #
197 self.make_branch('a')208 self.make_branch('a')
198 mf = mock.MockFunction()209 mf = mock.MockFunction()
199 tree = util.open_tree('a', ui_mode=True, _critical_dialog=mf)210 tree = util.open_tree('a', ui_mode=True, _critical_dialog=mf)

Subscribers

People subscribed via source and target branches

to status/vote changes: