Merge lp:~mwhudson/launchpad/bzr-2.1b4-upgrade into lp:launchpad

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Michael Hudson-Doyle
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~mwhudson/launchpad/bzr-2.1b4-upgrade
Merge into: lp:launchpad
Diff against target: 409 lines (+24/-94)
17 files modified
lib/devscripts/ec2test/entrypoint.py (+6/-0)
lib/lp/codehosting/bzrutils.py (+1/-27)
lib/lp/codehosting/codeimport/tests/test_worker.py (+0/-8)
lib/lp/codehosting/codeimport/worker.py (+2/-3)
lib/lp/codehosting/puller/tests/test_scheduler.py (+0/-8)
lib/lp/codehosting/puller/tests/test_worker.py (+1/-2)
lib/lp/codehosting/puller/tests/test_worker_formats.py (+1/-6)
lib/lp/codehosting/scanner/tests/test_acceptance.py (+2/-3)
lib/lp/codehosting/scanner/tests/test_bzrsync.py (+1/-2)
lib/lp/codehosting/tests/test_acceptance.py (+3/-16)
lib/lp/codehosting/tests/test_bzrutils.py (+1/-5)
lib/lp/codehosting/vfs/branchfs.py (+1/-2)
lib/lp/codehosting/vfs/tests/test_branchfs.py (+1/-2)
lib/lp/codehosting/vfs/tests/test_transport.py (+1/-5)
lib/lp/codehosting/vfs/transport.py (+1/-2)
lib/lp/testing/__init__.py (+1/-2)
versions.cfg (+1/-1)
To merge this branch: bzr merge lp:~mwhudson/launchpad/bzr-2.1b4-upgrade
Reviewer Review Type Date Requested Status
Jonathan Lange (community) Approve
Review via email: mp+16521@code.launchpad.net

Commit message

Upgrade to 2.1b4 and drop some compatibility code for older bzrs

To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Hi,

This branch updates us to bzr 2.1b4. This could have been a one character change in versions.cfg, but I accidentally ended up removing a bunch of cruft we had that was only there to support old versions of bzr. The one of these that has the largest (textual) impact is removing lp.codehosting.bzrutils.ensure_base, all the others are pretty trivial I think.

Cheers,
mwh

Revision history for this message
Jonathan Lange (jml) wrote :

Nice. Thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/devscripts/ec2test/entrypoint.py'
2--- lib/devscripts/ec2test/entrypoint.py 2009-09-18 05:36:00 +0000
3+++ lib/devscripts/ec2test/entrypoint.py 2009-12-23 02:50:28 +0000
4@@ -13,6 +13,7 @@
5 import sys
6
7 from bzrlib.errors import BzrCommandError
8+from bzrlib import ui
9
10 from devscripts.ec2test import builtins
11 from devscripts.ec2test.controller import (
12@@ -32,6 +33,11 @@
13
14 We run the specified command, or give help if none was specified.
15 """
16+ # XXX MichaelHudson, 2009-12-23, bug=499637: run_bzr fails unless you set
17+ # a ui_factory.
18+ ui.ui_factory = ui.make_ui_for_terminal(
19+ sys.stdin, sys.stdout, sys.stderr)
20+
21 controller = EC2CommandController()
22 controller.install_bzrlib_hooks()
23 controller.load_module(builtins)
24
25=== modified file 'lib/lp/codehosting/bzrutils.py'
26--- lib/lp/codehosting/bzrutils.py 2009-09-18 00:08:40 +0000
27+++ lib/lp/codehosting/bzrutils.py 2009-12-23 02:50:28 +0000
28@@ -11,7 +11,6 @@
29 __all__ = [
30 'add_exception_logging_hook',
31 'DenyingServer',
32- 'ensure_base',
33 'get_branch_stacked_on_url',
34 'get_vfs_format_classes',
35 'HttpAsLocalTransport',
36@@ -26,8 +25,7 @@
37
38 from bzrlib import config, trace
39 from bzrlib.errors import (
40- NoSuchFile, NotStacked, UnstackableBranchFormat,
41- UnstackableRepositoryFormat)
42+ NotStacked, UnstackableBranchFormat, UnstackableRepositoryFormat)
43 from bzrlib.remote import RemoteBranch, RemoteBzrDir, RemoteRepository
44 from bzrlib.transport import register_transport, unregister_transport
45 from bzrlib.transport.local import LocalTransport
46@@ -105,30 +103,6 @@
47 return stacked_on_url
48
49
50-# XXX: JonathanLange 2007-06-13 bugs=120135:
51-# This should probably be part of bzrlib.
52-def ensure_base(transport):
53- """Make sure that the base directory of `transport` exists.
54-
55- If the base directory does not exist, try to make it. If the parent of the
56- base directory doesn't exist, try to make that, and so on.
57- """
58- try:
59- transport.ensure_base()
60- except NoSuchFile:
61- # transport.create_prefix was added in Bazaar 1.15, and _create_prefix
62- # was removed. Check to see if transport has a create_prefix method
63- # and use the old _create_prefix if it's not there.
64- #
65- # This can be removed once Bazaar 1.15 has landed on Launchpad.
66- create_prefix = getattr(transport, 'create_prefix', None)
67- if create_prefix is not None:
68- create_prefix()
69- else:
70- from bzrlib.builtins import _create_prefix
71- _create_prefix(transport)
72-
73-
74 _exception_logging_hooks = []
75
76 _original_log_exception_quietly = trace.log_exception_quietly
77
78=== modified file 'lib/lp/codehosting/codeimport/tests/test_worker.py'
79--- lib/lp/codehosting/codeimport/tests/test_worker.py 2009-12-01 03:02:27 +0000
80+++ lib/lp/codehosting/codeimport/tests/test_worker.py 2009-12-23 02:50:28 +0000
81@@ -898,14 +898,6 @@
82 super(TestBzrSvnImport, self).setUp()
83 load_optional_plugin('svn')
84 self.setUpImport()
85- # XXX MichaelHudson, 2009-11-24, bug=464174:
86- # TestCaseWithMemoryTransport likes to set these environment variables
87- # to unicode strings and bzr-svn hits an assertion failure in this
88- # case.
89- os.environ['BZR_HOME'] = os.environ['BZR_HOME'].encode(
90- sys.getfilesystemencoding())
91- os.environ['HOME'] = os.environ['HOME'].encode(
92- sys.getfilesystemencoding())
93
94 def makeImportWorker(self, source_details):
95 """Make a new `ImportWorker`."""
96
97=== modified file 'lib/lp/codehosting/codeimport/worker.py'
98--- lib/lp/codehosting/codeimport/worker.py 2009-12-08 02:53:47 +0000
99+++ lib/lp/codehosting/codeimport/worker.py 2009-12-23 02:50:28 +0000
100@@ -28,7 +28,6 @@
101 from bzrlib.upgrade import upgrade
102
103 from canonical.cachedproperty import cachedproperty
104-from lp.codehosting.bzrutils import ensure_base
105 from lp.codehosting.codeimport.foreigntree import (
106 CVSWorkingTree, SubversionWorkingTree)
107 from lp.codehosting.codeimport.tarball import (
108@@ -78,7 +77,7 @@
109
110 def push(self, db_branch_id, bzr_tree, required_format):
111 """Push up `bzr_tree` as the Bazaar branch for `code_import`."""
112- ensure_base(self.transport)
113+ self.transport.create_prefix()
114 branch_from = bzr_tree.branch
115 target_url = self._getMirrorURL(db_branch_id)
116 try:
117@@ -262,7 +261,7 @@
118 source_transport = get_transport('.')
119 remote_name = self._getRemoteName(filename)
120 local_file = source_transport.get(filename)
121- ensure_base(self._transport)
122+ self._transport.create_prefix()
123 try:
124 self._transport.put_file(remote_name, local_file)
125 finally:
126
127=== modified file 'lib/lp/codehosting/puller/tests/test_scheduler.py'
128--- lib/lp/codehosting/puller/tests/test_scheduler.py 2009-12-22 00:26:49 +0000
129+++ lib/lp/codehosting/puller/tests/test_scheduler.py 2009-12-23 02:50:28 +0000
130@@ -643,14 +643,6 @@
131 def setUp(self):
132 TrialTestCase.setUp(self)
133 PullerBranchTestCase.setUp(self)
134- # XXX MichaelHudson, 2009-11-21, bug=464174:
135- # TestCaseWithMemoryTransport likes to set these environment variables
136- # to unicode strings and Twisted's spawnProcess doesn't like that
137- # (reasonably enough).
138- os.environ['BZR_HOME'] = os.environ['BZR_HOME'].encode(
139- sys.getfilesystemencoding())
140- os.environ['HOME'] = os.environ['HOME'].encode(
141- sys.getfilesystemencoding())
142 self.makeCleanDirectory(config.codehosting.hosted_branches_root)
143 self.makeCleanDirectory(config.codehosting.mirrored_branches_root)
144 branch_id = self.factory.makeAnyBranch(
145
146=== modified file 'lib/lp/codehosting/puller/tests/test_worker.py'
147--- lib/lp/codehosting/puller/tests/test_worker.py 2009-12-22 00:26:49 +0000
148+++ lib/lp/codehosting/puller/tests/test_worker.py 2009-12-23 02:50:28 +0000
149@@ -21,7 +21,6 @@
150 from bzrlib.tests import TestCaseInTempDir, TestCaseWithTransport
151 from bzrlib.transport import get_transport
152
153-from lp.codehosting.bzrutils import ensure_base
154 from lp.codehosting.puller.worker import (
155 BranchLoopError, BranchMirrorer, BranchReferenceForbidden,
156 PullerWorkerProtocol, StackedOnBranchNotFound,
157@@ -134,7 +133,7 @@
158 source_tree.commit('commit message')
159 # Make the directory.
160 dest = get_transport(to_mirror.dest)
161- ensure_base(dest)
162+ dest.create_prefix()
163 dest.mkdir('.bzr')
164 # 'dest' is not a branch.
165 self.assertRaises(
166
167=== modified file 'lib/lp/codehosting/puller/tests/test_worker_formats.py'
168--- lib/lp/codehosting/puller/tests/test_worker_formats.py 2009-06-25 04:06:00 +0000
169+++ lib/lp/codehosting/puller/tests/test_worker_formats.py 2009-12-23 02:50:28 +0000
170@@ -12,12 +12,7 @@
171 from bzrlib.repofmt.knitrepo import RepositoryFormatKnit1
172 from bzrlib.repofmt.pack_repo import RepositoryFormatKnitPack5
173 from bzrlib.repofmt.weaverepo import RepositoryFormat6, RepositoryFormat7
174-try:
175- from bzrlib.tests.repository_implementations.test_repository import (
176- TestCaseWithRepository)
177-except ImportError:
178- from bzrlib.tests.per_repository import TestCaseWithRepository
179-
180+from bzrlib.tests.per_repository import TestCaseWithRepository
181
182 from lp.codehosting.puller.tests import PullerWorkerMixin
183 from lp.codehosting.tests.helpers import LoomTestMixin
184
185=== modified file 'lib/lp/codehosting/scanner/tests/test_acceptance.py'
186--- lib/lp/codehosting/scanner/tests/test_acceptance.py 2009-06-25 04:06:00 +0000
187+++ lib/lp/codehosting/scanner/tests/test_acceptance.py 2009-12-23 02:50:28 +0000
188@@ -22,7 +22,6 @@
189 from zope.component import getUtility
190
191 from lp.codehosting.vfs import branch_id_to_path
192-from lp.codehosting.bzrutils import ensure_base
193 from lp.codehosting.tests.helpers import (
194 create_branch_with_one_revision, LoomTestMixin)
195 from canonical.config import config
196@@ -49,7 +48,7 @@
197 local_path_from_url(
198 config.codehosting.internal_branch_by_id_root),
199 branch_id_to_path(db_branch.id))
200- ensure_base(get_transport(destination))
201+ get_transport(destination).create_prefix()
202 self.addCleanup(lambda: shutil.rmtree(destination))
203 return destination
204
205@@ -112,7 +111,7 @@
206 # Build the loom in the destination directory.
207 self.addCleanup(lambda: os.chdir(os.getcwd()))
208 os.chdir(destination)
209- loom_tree = self.makeLoomBranchAndTree('.')
210+ self.makeLoomBranchAndTree('.')
211
212 loom_branch = bzrlib.branch.Branch.open(destination)
213 self.installTestBranch(self.db_branch, loom_branch)
214
215=== modified file 'lib/lp/codehosting/scanner/tests/test_bzrsync.py'
216--- lib/lp/codehosting/scanner/tests/test_bzrsync.py 2009-10-17 14:06:03 +0000
217+++ lib/lp/codehosting/scanner/tests/test_bzrsync.py 2009-12-23 02:50:28 +0000
218@@ -32,7 +32,6 @@
219 from lp.code.model.branchrevision import BranchRevision
220 from lp.code.model.branchmergeproposaljob import IUpdatePreviewDiffJobSource
221 from lp.code.model.revision import Revision, RevisionAuthor, RevisionParent
222-from lp.codehosting.bzrutils import ensure_base
223 from lp.codehosting.scanner.bzrsync import (
224 BzrSync, InvalidStackedBranchURL, schedule_diff_updates,
225 schedule_translation_upload)
226@@ -128,7 +127,7 @@
227
228 def makeBzrBranchAndTree(self, db_branch, format=None):
229 """Make a Bazaar branch at the warehouse location of `db_branch`."""
230- ensure_base(self.get_transport(db_branch.unique_name))
231+ self.get_transport(db_branch.unique_name).create_prefix()
232 return self.make_branch_and_tree(db_branch.unique_name, format=format)
233
234 def makeDatabaseBranch(self, *args, **kwargs):
235
236=== modified file 'lib/lp/codehosting/tests/test_acceptance.py'
237--- lib/lp/codehosting/tests/test_acceptance.py 2009-11-21 00:28:10 +0000
238+++ lib/lp/codehosting/tests/test_acceptance.py 2009-12-23 02:50:28 +0000
239@@ -11,7 +11,7 @@
240 import xmlrpclib
241
242 import bzrlib.branch
243-from bzrlib.tests import TestCaseWithTransport
244+from bzrlib.tests import multiply_tests, TestCaseWithTransport
245 from bzrlib.urlutils import local_path_from_url
246 from bzrlib.workingtree import WorkingTree
247
248@@ -265,11 +265,7 @@
249 # Push up a new branch.
250 remote_url = self.getTransportURL('~testuser/+junk/new-branch')
251 self.push(self.first_tree, remote_url)
252- # XXX MichaelHudson, 2008-12-11: The way that getLastRevision is
253- # currently implemented doesn't work with empty branches. When it can
254- # be rewritten to use revision-info, the next line can be re-enabled.
255- # See comment in getLastRevision for more.
256- #self.assertBranchesMatch(self.first_tree, remote_url)
257+ self.assertBranchesMatch(self.first_tree, remote_url)
258
259 # Commit to it.
260 tree.commit('new revision', allow_pointless=True)
261@@ -629,16 +625,7 @@
262 if scenario[0] not in excluded_scenarios
263 and not scenario[0].startswith('RemoteRepositoryFormat')]
264 new_suite = unittest.TestSuite()
265- try:
266- from bzrlib.tests import multiply_tests
267- multiply_tests(base_suite, scenarios, new_suite)
268- except ImportError:
269- # XXX: MichaelHudson, 2009-03-11: This except clause can be deleted
270- # once sourcecode/bzr has bzr.dev r4102.
271- from bzrlib.tests import adapt_tests, TestScenarioApplier
272- adapter = TestScenarioApplier()
273- adapter.scenarios = scenarios
274- adapt_tests(base_suite, adapter, new_suite)
275+ multiply_tests(base_suite, scenarios, new_suite)
276 return new_suite
277
278
279
280=== modified file 'lib/lp/codehosting/tests/test_bzrutils.py'
281--- lib/lp/codehosting/tests/test_bzrutils.py 2009-11-21 00:34:12 +0000
282+++ lib/lp/codehosting/tests/test_bzrutils.py 2009-12-23 02:50:28 +0000
283@@ -16,11 +16,7 @@
284 from bzrlib.tests import (
285 multiply_tests, TestCase, TestCaseWithTransport, TestLoader,
286 TestNotApplicable)
287-try:
288- from bzrlib.tests.per_branch import TestCaseWithBzrDir, branch_scenarios
289-except ImportError:
290- from bzrlib.tests.branch_implementations import (
291- TestCaseWithBzrDir, branch_scenarios)
292+from bzrlib.tests.per_branch import TestCaseWithBzrDir, branch_scenarios
293
294 from lp.codehosting.bzrutils import (
295 add_exception_logging_hook, DenyingServer, get_branch_stacked_on_url,
296
297=== modified file 'lib/lp/codehosting/vfs/branchfs.py'
298--- lib/lp/codehosting/vfs/branchfs.py 2009-10-20 02:20:37 +0000
299+++ lib/lp/codehosting/vfs/branchfs.py 2009-12-23 02:50:28 +0000
300@@ -83,7 +83,6 @@
301
302 from lp.codehosting.vfs.branchfsclient import (
303 BlockingProxy, BranchFileSystemClient, trap_fault)
304-from lp.codehosting.bzrutils import ensure_base
305 from lp.codehosting.vfs.transport import (
306 AsyncVirtualServer, AsyncVirtualTransport, _MultiServer,
307 get_chrooted_transport, get_readonly_transport, TranslationError)
308@@ -281,7 +280,7 @@
309 self._checkPath(trailing_path)
310 transport = self.base_transport.clone(branch_id_to_path(data['id']))
311 try:
312- ensure_base(transport)
313+ transport.create_prefix()
314 except TransportNotPossible:
315 # Silently ignore TransportNotPossible. This is raised when the
316 # base transport is read-only.
317
318=== modified file 'lib/lp/codehosting/vfs/tests/test_branchfs.py'
319--- lib/lp/codehosting/vfs/tests/test_branchfs.py 2009-11-21 00:28:10 +0000
320+++ lib/lp/codehosting/vfs/tests/test_branchfs.py 2009-12-23 02:50:28 +0000
321@@ -27,7 +27,6 @@
322 AsyncLaunchpadTransport, BranchTransportDispatch,
323 DirectDatabaseLaunchpadServer, LaunchpadInternalServer, LaunchpadServer,
324 TransportDispatch, UnknownTransportType, branch_id_to_path)
325-from lp.codehosting.bzrutils import ensure_base
326 from lp.codehosting.inmemory import InMemoryFrontend, XMLRPCWrapper
327 from lp.codehosting.sftp import FatLocalTransport
328 from lp.codehosting.vfs.transport import AsyncVirtualTransport
329@@ -547,7 +546,7 @@
330 """
331 backing_transport = self.backing_transport.clone(
332 '%s/.bzr/' % branch_to_path(branch, add_slash=False))
333- ensure_base(backing_transport)
334+ backing_transport.create_prefix()
335 return backing_transport
336
337 def test_get_mapped_file(self):
338
339=== modified file 'lib/lp/codehosting/vfs/tests/test_transport.py'
340--- lib/lp/codehosting/vfs/tests/test_transport.py 2009-07-17 00:26:05 +0000
341+++ lib/lp/codehosting/vfs/tests/test_transport.py 2009-12-23 02:50:28 +0000
342@@ -7,11 +7,7 @@
343
344 import unittest
345
346-try:
347- from bzrlib.tests import per_transport
348-except ImportError:
349- from bzrlib.tests import test_transport_implementations as per_transport
350-
351+from bzrlib.tests import per_transport
352 from bzrlib.transport import chroot, get_transport, Transport
353 from bzrlib.transport.local import LocalTransport
354 from bzrlib.urlutils import local_path_to_url
355
356=== modified file 'lib/lp/codehosting/vfs/transport.py'
357--- lib/lp/codehosting/vfs/transport.py 2009-06-25 04:06:00 +0000
358+++ lib/lp/codehosting/vfs/transport.py 2009-12-23 02:50:28 +0000
359@@ -30,7 +30,6 @@
360 unregister_transport)
361
362 from twisted.internet import defer
363-from lp.codehosting.bzrutils import ensure_base
364 from canonical.twistedsupport import extract_result, gatherResults
365
366
367@@ -56,7 +55,7 @@
368 """Return a chrooted transport serving `url`."""
369 transport = get_transport(url)
370 if mkdir:
371- ensure_base(transport)
372+ transport.create_prefix()
373 chroot_server = chroot.ChrootServer(transport)
374 chroot_server.setUp()
375 return get_transport(chroot_server.get_url())
376
377=== modified file 'lib/lp/testing/__init__.py'
378--- lib/lp/testing/__init__.py 2009-10-29 09:25:20 +0000
379+++ lib/lp/testing/__init__.py 2009-12-23 02:50:28 +0000
380@@ -34,7 +34,6 @@
381 isinstance as zope_isinstance, removeSecurityProxy)
382
383 from canonical.launchpad.webapp import errorlog
384-from lp.codehosting.bzrutils import ensure_base
385 from lp.codehosting.vfs import branch_id_to_path, get_multi_server
386 from canonical.config import config
387 # Import the login and logout functions here as it is a much better
388@@ -588,7 +587,7 @@
389 # This is a work-around for some failures on PQM, arguably caused by
390 # relying on test set-up that is happening in the Makefile rather than
391 # the actual test set-up.
392- ensure_base(get_transport(base))
393+ get_transport(base).create_prefix()
394 return os.path.join(base, branch_id_to_path(branch.id))
395
396 def createMirroredBranchAndTree(self):
397
398=== modified file 'versions.cfg'
399--- versions.cfg 2009-12-21 03:18:24 +0000
400+++ versions.cfg 2009-12-23 02:50:28 +0000
401@@ -3,7 +3,7 @@
402
403 [versions]
404 # Alphabetical, case-insensitive, please! :-)
405-bzr = 2.1b3
406+bzr = 2.1b4
407 chameleon.core = 1.0b35
408 chameleon.zpt = 1.0b17
409 ClientForm = 0.2.10