Merge lp:~cjwatson/launchpad/codehosting-breezy into lp:launchpad

Proposed by Colin Watson
Status: Rejected
Rejected by: Colin Watson
Proposed branch: lp:~cjwatson/launchpad/codehosting-breezy
Merge into: lp:launchpad
Diff against target: 4220 lines (+708/-667)
99 files modified
Makefile (+2/-2)
brzplugins/lpserve/__init__.py (+20/-20)
brzplugins/lpserve/test_lpserve.py (+26/-26)
constraints.txt (+5/-0)
lib/launchpad_loggerhead/app.py (+3/-3)
lib/launchpad_loggerhead/wsgi.py (+5/-5)
lib/lp/app/browser/stringformatter.py (+1/-1)
lib/lp/code/browser/bazaar.py (+3/-3)
lib/lp/code/browser/sourcepackagerecipe.py (+1/-1)
lib/lp/code/bzr.py (+23/-23)
lib/lp/code/configure.zcml (+4/-4)
lib/lp/code/errors.py (+1/-1)
lib/lp/code/interfaces/branch.py (+4/-4)
lib/lp/code/interfaces/tests/test_branch.py (+10/-10)
lib/lp/code/mail/codereviewcomment.py (+10/-13)
lib/lp/code/mail/patches.py (+15/-16)
lib/lp/code/model/branch.py (+3/-3)
lib/lp/code/model/branchjob.py (+11/-11)
lib/lp/code/model/branchlookup.py (+1/-1)
lib/lp/code/model/diff.py (+5/-5)
lib/lp/code/model/directbranchcommit.py (+5/-4)
lib/lp/code/model/gitrepository.py (+1/-1)
lib/lp/code/model/revision.py (+2/-2)
lib/lp/code/model/sourcepackagerecipedata.py (+1/-1)
lib/lp/code/model/tests/test_branch.py (+6/-6)
lib/lp/code/model/tests/test_branchjob.py (+26/-25)
lib/lp/code/model/tests/test_branchmergeproposaljobs.py (+2/-2)
lib/lp/code/model/tests/test_diff.py (+3/-3)
lib/lp/code/model/tests/test_gitref.py (+1/-1)
lib/lp/code/model/tests/test_gitrepository.py (+1/-1)
lib/lp/code/model/tests/test_sourcepackagerecipe.py (+1/-1)
lib/lp/code/scripts/tests/test_scan_branches.py (+1/-1)
lib/lp/code/scripts/tests/test_sendbranchmail.py (+5/-5)
lib/lp/code/scripts/tests/test_upgrade_branches.py (+1/-1)
lib/lp/code/stories/branches/xx-bazaar-home.txt (+15/-15)
lib/lp/code/stories/webservice/xx-branch.txt (+1/-1)
lib/lp/code/templates/bazaar-index.pt (+2/-2)
lib/lp/code/tests/helpers.py (+1/-1)
lib/lp/code/tests/test_bzr.py (+11/-10)
lib/lp/code/xmlrpc/branch.py (+1/-1)
lib/lp/code/xmlrpc/codehosting.py (+1/-1)
lib/lp/code/xmlrpc/tests/test_branch.py (+1/-1)
lib/lp/code/xmlrpc/tests/test_codehosting.py (+3/-3)
lib/lp/codehosting/__init__.py (+54/-22)
lib/lp/codehosting/bzrutils.py (+15/-15)
lib/lp/codehosting/codeimport/tests/test_worker.py (+2/-2)
lib/lp/codehosting/inmemory.py (+1/-1)
lib/lp/codehosting/puller/scheduler.py (+1/-1)
lib/lp/codehosting/puller/tests/__init__.py (+3/-3)
lib/lp/codehosting/puller/tests/test_acceptance.py (+7/-7)
lib/lp/codehosting/puller/tests/test_errors.py (+2/-2)
lib/lp/codehosting/puller/tests/test_scheduler.py (+6/-8)
lib/lp/codehosting/puller/tests/test_worker.py (+21/-21)
lib/lp/codehosting/puller/tests/test_worker_formats.py (+16/-16)
lib/lp/codehosting/puller/worker.py (+21/-16)
lib/lp/codehosting/rewrite.py (+1/-1)
lib/lp/codehosting/scanner/buglinks.py (+1/-1)
lib/lp/codehosting/scanner/bzrsync.py (+7/-7)
lib/lp/codehosting/scanner/mergedetection.py (+1/-1)
lib/lp/codehosting/scanner/tests/test_buglinks.py (+4/-4)
lib/lp/codehosting/scanner/tests/test_bzrsync.py (+8/-7)
lib/lp/codehosting/scanner/tests/test_email.py (+1/-1)
lib/lp/codehosting/scanner/tests/test_mergedetection.py (+3/-3)
lib/lp/codehosting/scripts/tests/test_upgrade_all_branches.py (+1/-1)
lib/lp/codehosting/sftp.py (+4/-4)
lib/lp/codehosting/sshserver/session.py (+20/-17)
lib/lp/codehosting/sshserver/tests/test_session.py (+16/-9)
lib/lp/codehosting/tests/helpers.py (+9/-7)
lib/lp/codehosting/tests/servers.py (+1/-1)
lib/lp/codehosting/tests/test_acceptance.py (+35/-35)
lib/lp/codehosting/tests/test_breezy.py (+5/-5)
lib/lp/codehosting/tests/test_bzrutils.py (+18/-15)
lib/lp/codehosting/tests/test_format_comparison.py (+1/-1)
lib/lp/codehosting/tests/test_lpserve.py (+6/-6)
lib/lp/codehosting/tests/test_sftp.py (+6/-6)
lib/lp/codehosting/tests/test_upgrade.py (+16/-18)
lib/lp/codehosting/upgrade.py (+9/-11)
lib/lp/codehosting/vfs/branchfs.py (+11/-13)
lib/lp/codehosting/vfs/tests/test_branchfs.py (+20/-22)
lib/lp/codehosting/vfs/tests/test_filesystem.py (+8/-8)
lib/lp/codehosting/vfs/tests/test_transport.py (+4/-4)
lib/lp/codehosting/vfs/tests/test_transport_extensions.py (+1/-1)
lib/lp/codehosting/vfs/transport.py (+29/-29)
lib/lp/scripts/runlaunchpad.py (+4/-4)
lib/lp/testing/__init__.py (+13/-11)
lib/lp/testing/factory.py (+3/-3)
lib/lp/translations/browser/productseries.py (+1/-1)
lib/lp/translations/pottery/detect_intltool.py (+1/-1)
lib/lp/translations/pottery/tests/test_detect_intltool.py (+2/-2)
lib/lp/translations/scripts/tests/test_translations_to_branch.py (+2/-2)
lib/lp/translations/scripts/translations_to_branch.py (+2/-2)
lib/lp/translations/tests/test_rosetta_branches_script.py (+3/-3)
lib/lp_sitecustomize.py (+13/-6)
scripts/mirror-branch.py (+2/-20)
scripts/update-stacked-on.py (+5/-4)
setup.py (+2/-0)
utilities/create-lp-wadl-and-apidoc.py (+3/-3)
utilities/sourcedeps.cache (+9/-9)
utilities/sourcedeps.conf (+3/-3)
To merge this branch: bzr merge lp:~cjwatson/launchpad/codehosting-breezy
Reviewer Review Type Date Requested Status
Launchpad code reviewers Pending
Review via email: mp+373020@code.launchpad.net

Commit message

Port codehosting to Breezy.

Description of the change

Most of this is relatively mechanical: bzrlib imports become breezy imports, some things move around a little more (mainly to breezy.bzr), bzrdir becomes controldir in many cases, I tightened up some bytes/text handling, and there were a couple of other minor API changes.

Due to problems with subvertpy, codeimport remains on Bazaar for now. This entails some fiddly code to allow Bazaar and Breezy to coexist in the same codebase.

DirectBranchCommit.commit needs a new call to self.transform_preview.fixup_new_roots. I think this may technically have been needed by Bazaar too, since bzrlib.transform._alter_files calls it, but it no longer seems to be possible to get away without it.

We have to explicitly initialize Breezy in lib/lp/codehosting/__init__.py, as otherwise it initializes itself with a terminal-oriented UI, causing some unexpected output to appear in logs.

We have to disable some plugins that are now built into Breezy and likely to cause trouble if invoked, although unfortunately we have no very elegant way to do that. cvs, darcs, email, and mtn are disabled using BRZ_DISABLE_PLUGINS. git requires more work: we can't allow Breezy to even import this until codeimport is also ported, since it requires a newer version of dulwich which is incompatible with bzr-git (and that isn't particularly straightforward to fix), so I ended up stubbing it in sys.modules so that importing it has no effect. Fortunately Breezy currently only imports breezy.git and relies on it to register its own formats, so this crude strategy works.

The hack in scripts/mirror-branch.py to force bzr to use urllib is no longer required: Breezy removed pycurl support.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

Unmerged revisions

19054. By Colin Watson

Port codehosting to Breezy.

Most of this is relatively mechanical: bzrlib imports become breezy imports,
some things move around a little more (mainly to breezy.bzr), bzrdir becomes
controldir in many cases, I tightened up some bytes/text handling, and there
were a couple of other minor API changes.

Due to problems with subvertpy, codeimport remains on Bazaar for now. This
entails some fiddly code to allow Bazaar and Breezy to coexist in the same
codebase.

DirectBranchCommit.commit needs a new call to
self.transform_preview.fixup_new_roots. I think this may technically have
been needed by Bazaar too, since bzrlib.transform._alter_files calls it, but
it no longer seems to be possible to get away without it.

We have to explicitly initialize Breezy in lib/lp/codehosting/__init__.py,
as otherwise it initializes itself with a terminal-oriented UI, causing some
unexpected output to appear in logs.

We have to disable some plugins that are now built into Breezy and likely to
cause trouble if invoked, although unfortunately we have no very elegant way
to do that. cvs, darcs, email, and mtn are disabled using
BRZ_DISABLE_PLUGINS. git requires more work: we can't allow Breezy to even
import this until codeimport is also ported, since it requires a newer
version of dulwich which is incompatible with bzr-git (and that isn't
particularly straightforward to fix), so I ended up stubbing it in
sys.modules so that importing it has no effect. Fortunately Breezy
currently only imports breezy.git and relies on it to register its own
formats, so this crude strategy works.

The hack in scripts/mirror-branch.py to force bzr to use urllib is no longer
required: Breezy removed pycurl support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2019-05-22 14:57:45 +0000
3+++ Makefile 2019-09-19 21:35:23 +0000
4@@ -306,10 +306,10 @@
5 memcached,rabbitmq -i $(LPCONFIG)
6
7 run_codebrowse: compile
8- BZR_PLUGIN_PATH=bzrplugins $(PY) scripts/start-loggerhead.py
9+ BRZ_PLUGIN_PATH=brzplugins $(PY) scripts/start-loggerhead.py
10
11 start_codebrowse: compile
12- BZR_PLUGIN_PATH=$(shell pwd)/bzrplugins $(PY) scripts/start-loggerhead.py --daemon
13+ BRZ_PLUGIN_PATH=$(shell pwd)/brzplugins $(PY) scripts/start-loggerhead.py --daemon
14
15 stop_codebrowse:
16 $(PY) scripts/stop-loggerhead.py
17
18=== added directory 'brzplugins'
19=== added symlink 'brzplugins/builder'
20=== target is u'../sourcecode/brz-builder/brzbuildrecipe'
21=== added symlink 'brzplugins/difftacular'
22=== target is u'../sourcecode/difftacular'
23=== added symlink 'brzplugins/loom'
24=== target is u'../sourcecode/brz-loom'
25=== renamed directory 'bzrplugins/lpserve' => 'brzplugins/lpserve'
26=== modified file 'brzplugins/lpserve/__init__.py'
27--- bzrplugins/lpserve/__init__.py 2012-06-29 08:40:05 +0000
28+++ brzplugins/lpserve/__init__.py 2019-09-19 21:35:23 +0000
29@@ -28,7 +28,7 @@
30 import threading
31 import time
32
33-from bzrlib import (
34+from breezy import (
35 commands,
36 errors,
37 lockdir,
38@@ -36,15 +36,15 @@
39 trace,
40 ui,
41 )
42-from bzrlib.commands import (
43+from breezy.commands import (
44 Command,
45 register_command,
46 )
47-from bzrlib.option import (
48+from breezy.option import (
49 Option,
50 RegistryOption,
51 )
52-from bzrlib.transport import (
53+from breezy.transport import (
54 get_transport,
55 transport_server_registry,
56 )
57@@ -88,7 +88,7 @@
58 type=unicode),
59 RegistryOption(
60 'protocol', help="Protocol to serve.",
61- lazy_registry=('bzrlib.transport', 'transport_server_registry'),
62+ lazy_registry=('breezy.transport', 'transport_server_registry'),
63 value_switches=True),
64 ]
65
66@@ -192,7 +192,7 @@
67 that should be reset.
68
69 fork-env allows you to supply environment variables such as
70- "BZR_EMAIL: joe@foo.com" which will be set in os.environ before
71+ "BRZ_EMAIL: joe@foo.com" which will be set in os.environ before
72 the command is run.
73 """
74
75@@ -301,9 +301,9 @@
76 # don't know any way to *remove* a function registered via
77 # 'atexit()' so if the forking service has some state, we my try to
78 # clean it up incorrectly.
79- # Note that the bzr script itself uses sys.exitfunc(); os._exit() in
80- # the 'bzr' main script, as the teardown time of all the python
81- # state was quite noticeable in real-world runtime. As such, bzrlib
82+ # Note that the brz script itself uses sys.exitfunc(); os._exit() in
83+ # the 'brz' main script, as the teardown time of all the python
84+ # state was quite noticeable in real-world runtime. As such, breezy
85 # should be pretty safe, or it would have been failing for people
86 # already.
87 # [Decision #7]
88@@ -483,7 +483,7 @@
89 os.rmdir(base_path)
90
91 def _bind_child_file_descriptors(self, base_path):
92- # Note: by this point bzrlib has opened stderr for logging
93+ # Note: by this point breezy has opened stderr for logging
94 # (as part of starting the service process in the first place).
95 # As such, it has a stream handler that writes to stderr.
96 # logging tries to flush and close that, but the file is already
97@@ -975,16 +975,16 @@
98 # manually, and observe what was expensive to import. It doesn't seem
99 # very easy to get this right automatically.
100 libraries_to_preload = [
101- 'bzrlib.errors',
102- 'bzrlib.repofmt.groupcompress_repo',
103- 'bzrlib.repository',
104- 'bzrlib.smart',
105- 'bzrlib.smart.protocol',
106- 'bzrlib.smart.request',
107- 'bzrlib.smart.server',
108- 'bzrlib.smart.vfs',
109- 'bzrlib.transport.local',
110- 'bzrlib.transport.readonly',
111+ 'breezy.bzr.groupcompress_repo',
112+ 'breezy.bzr.smart',
113+ 'breezy.bzr.smart.protocol',
114+ 'breezy.bzr.smart.request',
115+ 'breezy.bzr.smart.server',
116+ 'breezy.bzr.smart.vfs',
117+ 'breezy.errors',
118+ 'breezy.repository',
119+ 'breezy.transport.local',
120+ 'breezy.transport.readonly',
121 'lp.codehosting.bzrutils',
122 'lp.codehosting.vfs',
123 'lp.codehosting.vfs.branchfs',
124
125=== modified file 'brzplugins/lpserve/test_lpserve.py'
126--- bzrplugins/lpserve/test_lpserve.py 2018-01-02 10:54:31 +0000
127+++ brzplugins/lpserve/test_lpserve.py 2019-09-19 21:35:23 +0000
128@@ -11,18 +11,18 @@
129 import threading
130 import time
131
132-from bzrlib import (
133+from breezy import (
134 errors,
135 osutils,
136 tests,
137 trace,
138 )
139-from bzrlib.plugins import lpserve
140+from breezy.plugins import lpserve
141 from testtools import content
142
143 from lp.codehosting import (
144- get_bzr_path,
145- get_BZR_PLUGIN_PATH_for_subprocess,
146+ get_brz_path,
147+ get_BRZ_PLUGIN_PATH_for_subprocess,
148 )
149 from lp.testing.fakemethod import FakeMethod
150
151@@ -187,13 +187,13 @@
152 self.assertEnv({}, 'end\n')
153
154 def test_one_entries(self):
155- self.assertEnv({'BZR_EMAIL': 'joe@foo.com'},
156- 'BZR_EMAIL: joe@foo.com\n'
157+ self.assertEnv({'BRZ_EMAIL': 'joe@foo.com'},
158+ 'BRZ_EMAIL: joe@foo.com\n'
159 'end\n')
160
161 def test_two_entries(self):
162- self.assertEnv({'BZR_EMAIL': 'joe@foo.com', 'BAR': 'foo'},
163- 'BZR_EMAIL: joe@foo.com\n'
164+ self.assertEnv({'BRZ_EMAIL': 'joe@foo.com', 'BAR': 'foo'},
165+ 'BRZ_EMAIL: joe@foo.com\n'
166 'BAR: foo\n'
167 'end\n')
168
169@@ -201,10 +201,10 @@
170 self.assertInvalid('')
171
172 def test_invalid_end(self):
173- self.assertInvalid("BZR_EMAIL: joe@foo.com\n")
174+ self.assertInvalid("BRZ_EMAIL: joe@foo.com\n")
175
176 def test_invalid_entry(self):
177- self.assertInvalid("BZR_EMAIL joe@foo.com\nend\n")
178+ self.assertInvalid("BRZ_EMAIL joe@foo.com\nend\n")
179
180
181 class TestLPForkingService(TestCaseWithLPForkingService):
182@@ -238,19 +238,19 @@
183 def test_send_fork_env_with_env(self):
184 response = self.send_message_to_service(
185 'fork-env rocks\n'
186- 'BZR_EMAIL: joe@example.com\n'
187+ 'BRZ_EMAIL: joe@example.com\n'
188 'end\n')
189 self.assertEqual('ok\nfake forking\n', response)
190- self.assertEqual([(['rocks'], {'BZR_EMAIL': 'joe@example.com'})],
191+ self.assertEqual([(['rocks'], {'BRZ_EMAIL': 'joe@example.com'})],
192 self.service.fork_log)
193
194 def test_send_fork_env_slowly(self):
195 response = self.send_message_to_service(
196 'fork-env rocks\n'
197- 'BZR_EMAIL: joe@example.com\n'
198+ 'BRZ_EMAIL: joe@example.com\n'
199 'end\n', one_byte_at_a_time=True)
200 self.assertEqual('ok\nfake forking\n', response)
201- self.assertEqual([(['rocks'], {'BZR_EMAIL': 'joe@example.com'})],
202+ self.assertEqual([(['rocks'], {'BRZ_EMAIL': 'joe@example.com'})],
203 self.service.fork_log)
204
205 def test_send_incomplete_fork_env_timeout(self):
206@@ -258,7 +258,7 @@
207 # content
208 response = self.send_message_to_service(
209 'fork-env rocks\n'
210- 'BZR_EMAIL: joe@example.com\n',
211+ 'BRZ_EMAIL: joe@example.com\n',
212 one_byte_at_a_time=True)
213 # Note that we *don't* send a final 'end\n'
214 self.assertStartsWith(response, 'FAILURE\n')
215@@ -315,24 +315,24 @@
216 The launchpad infrastructure requires a fair amount of configuration to
217 get paths, etc correct. This provides a "start_bzr_subprocess" command
218 that has all of those paths appropriately set, but otherwise functions the
219- same as the bzrlib.tests.TestCase version.
220+ same as the breezy.tests.TestCase version.
221 """
222
223 def start_bzr_subprocess(self, process_args, env_changes=None,
224 working_dir=None):
225 """Start bzr in a subprocess for testing.
226
227- Copied and modified from `bzrlib.tests.TestCase.start_bzr_subprocess`.
228+ Copied and modified from `breezy.tests.TestCase.start_bzr_subprocess`.
229 This version removes some of the skipping stuff, some of the
230 irrelevant comments (e.g. about win32) and uses Launchpad's own
231- mechanisms for getting the path to 'bzr'.
232+ mechanisms for getting the path to 'brz'.
233
234 Comments starting with 'LAUNCHPAD' are comments about our
235 modifications.
236 """
237 if env_changes is None:
238 env_changes = {}
239- env_changes['BZR_PLUGIN_PATH'] = get_BZR_PLUGIN_PATH_for_subprocess()
240+ env_changes['BRZ_PLUGIN_PATH'] = get_BRZ_PLUGIN_PATH_for_subprocess()
241 old_env = {}
242
243 def cleanup_environment():
244@@ -348,12 +348,12 @@
245 cwd = osutils.getcwd()
246 os.chdir(working_dir)
247
248- # LAUNCHPAD: We can't use self.get_bzr_path(), since it'll find
249- # lib/bzrlib, rather than the path to bin/bzr.
250- bzr_path = get_bzr_path()
251+ # LAUNCHPAD: We can't use self.get_brz_path(), since it'll find
252+ # lib/breezy, rather than the path to bin/brz.
253+ brz_path = get_brz_path()
254 try:
255 cleanup_environment()
256- command = [bzr_path]
257+ command = [brz_path]
258 command.extend(process_args)
259 process = self._popen(
260 command, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
261@@ -464,8 +464,8 @@
262 # The service wants to create this file as a socket.
263 os.remove(path)
264 env_changes = {
265- 'BZR_PLUGIN_PATH': lpserve.__path__[0],
266- 'BZR_LOG': tempname,
267+ 'BRZ_PLUGIN_PATH': lpserve.__path__[0],
268+ 'BRZ_LOG': tempname,
269 }
270 proc = self._start_subprocess(path, env_changes)
271 return proc, path
272@@ -579,7 +579,7 @@
273
274 def test_fork_respects_env_vars(self):
275 path, pid, sock = self.send_fork_request('whoami',
276- env={'BZR_EMAIL': 'this_test@example.com'})
277+ env={'BRZ_EMAIL': 'this_test@example.com'})
278 stdout_content, stderr_content = self.communicate_with_fork(path)
279 self.assertEqual('', stderr_content)
280 self.assertEqual('this_test@example.com\n', stdout_content)
281
282=== removed symlink 'bzrplugins/builder'
283=== target was u'../sourcecode/bzr-builder/'
284=== removed symlink 'bzrplugins/difftacular'
285=== target was u'../sourcecode/difftacular/'
286=== removed symlink 'bzrplugins/loom'
287=== target was u'../sourcecode/bzr-loom'
288=== modified file 'constraints.txt'
289--- constraints.txt 2019-08-23 11:40:51 +0000
290+++ constraints.txt 2019-09-19 21:35:23 +0000
291@@ -233,6 +233,8 @@
292 BeautifulSoup==3.2.1
293 beautifulsoup4[lxml]==4.7.1
294 billiard==3.5.0.5
295+bleach==3.1.0
296+breezy==3.0.1
297 bson==0.3.3
298 # lp:~launchpad/bzr/lp
299 bzr==2.6.0.lp.4
300@@ -241,6 +243,7 @@
301 cffi==1.11.2
302 Chameleon==2.11
303 chardet==3.0.4
304+configobj==5.0.6
305 constantly==15.1.0
306 cookies==2.2.1
307 cryptography==2.7
308@@ -257,6 +260,7 @@
309 enum34==1.1.6
310 epydoc==3.0.1
311 extras==1.0.0
312+fastimport==0.9.8
313 feedparser==5.2.1
314 feedvalidator==0.0.0DEV-r1049
315 fixtures==3.0.0
316@@ -381,6 +385,7 @@
317 vine==1.1.4
318 virtualenv-tools3==2.0.0
319 wadllib==1.3.2
320+webencodings==0.5.1
321 wheel==0.29.0
322 wsgiref==0.1.2
323 z3c.pt==2.2.3
324
325=== modified file 'lib/launchpad_loggerhead/app.py'
326--- lib/launchpad_loggerhead/app.py 2019-06-13 10:14:15 +0000
327+++ lib/launchpad_loggerhead/app.py 2019-09-19 21:35:23 +0000
328@@ -8,13 +8,13 @@
329 import urlparse
330 import xmlrpclib
331
332-from bzrlib import (
333+from breezy import (
334 errors,
335 lru_cache,
336 urlutils,
337 )
338-from bzrlib.transport import get_transport
339-from bzrlib.url_policy_open import open_only_scheme
340+from breezy.transport import get_transport
341+from breezy.url_policy_open import open_only_scheme
342 from loggerhead.apps import (
343 favicon_app,
344 static_app,
345
346=== modified file 'lib/launchpad_loggerhead/wsgi.py'
347--- lib/launchpad_loggerhead/wsgi.py 2018-06-25 09:16:49 +0000
348+++ lib/launchpad_loggerhead/wsgi.py 2019-09-19 21:35:23 +0000
349@@ -153,16 +153,16 @@
350 cfg.update(self.options)
351 return cfg
352
353- def _load_bzr_plugins(self):
354- from bzrlib.plugin import load_plugins
355+ def _load_brz_plugins(self):
356+ from breezy.plugin import load_plugins
357 load_plugins()
358
359- import bzrlib.plugins
360- if getattr(bzrlib.plugins, "loom", None) is None:
361+ import breezy.plugins
362+ if getattr(breezy.plugins, "loom", None) is None:
363 log.error("Loom plugin loading failed.")
364
365 def load(self):
366- self._load_bzr_plugins()
367+ self._load_brz_plugins()
368
369 with open(os.path.join(
370 config.root, config.codebrowse.secret_path)) as secret_file:
371
372=== modified file 'lib/lp/app/browser/stringformatter.py'
373--- lib/lp/app/browser/stringformatter.py 2016-06-20 21:19:21 +0000
374+++ lib/lp/app/browser/stringformatter.py 2019-09-19 21:35:23 +0000
375@@ -21,7 +21,7 @@
376 import re
377 import sys
378
379-from bzrlib.patches import hunk_from_header
380+from breezy.patches import hunk_from_header
381 from lxml import html
382 import markdown
383 from zope.component import getUtility
384
385=== modified file 'lib/lp/code/browser/bazaar.py'
386--- lib/lp/code/browser/bazaar.py 2012-01-01 02:58:52 +0000
387+++ lib/lp/code/browser/bazaar.py 2019-09-19 21:35:23 +0000
388@@ -12,7 +12,7 @@
389
390 from datetime import datetime
391
392-import bzrlib
393+import breezy
394 from zope.component import getUtility
395
396 from lp.code.enums import CodeImportReviewStatus
397@@ -51,8 +51,8 @@
398 review_status=CodeImportReviewStatus.REVIEWED).count()
399
400 @property
401- def bzr_version(self):
402- return bzrlib.__version__
403+ def brz_version(self):
404+ return breezy.__version__
405
406 def _precacheViewPermissions(self, branches):
407 """Precache the launchpad.View permissions on the branches."""
408
409=== modified file 'lib/lp/code/browser/sourcepackagerecipe.py'
410--- lib/lp/code/browser/sourcepackagerecipe.py 2018-07-16 00:49:00 +0000
411+++ lib/lp/code/browser/sourcepackagerecipe.py 2019-09-19 21:35:23 +0000
412@@ -17,7 +17,7 @@
413
414 import itertools
415
416-from bzrlib.plugins.builder.recipe import (
417+from breezy.plugins.builder.recipe import (
418 ForbiddenInstructionError,
419 RecipeParseError,
420 )
421
422=== modified file 'lib/lp/code/bzr.py'
423--- lib/lp/code/bzr.py 2019-06-08 05:06:08 +0000
424+++ lib/lp/code/bzr.py 2019-09-19 21:35:23 +0000
425@@ -24,53 +24,53 @@
426 # Silence lint warning.
427 lp.codehosting
428
429-from bzrlib.branch import (
430+from breezy.branch import UnstackableBranchFormat
431+from breezy.bzr.branch import (
432 BranchReferenceFormat,
433 BzrBranchFormat6,
434 BzrBranchFormat7,
435 )
436-from bzrlib.branchfmt.fullhistory import BzrBranchFormat5
437-from bzrlib.bzrdir import (
438+from breezy.bzr.bzrdir import (
439 BzrDirMetaFormat1,
440 BzrDirMetaFormat1Colo,
441 )
442-from bzrlib.errors import (
443+from breezy.bzr.fullhistory import BzrBranchFormat5
444+from breezy.bzr.groupcompress_repo import RepositoryFormat2a
445+from breezy.bzr.knitpack_repo import (
446+ RepositoryFormatKnitPack1,
447+ RepositoryFormatKnitPack3,
448+ RepositoryFormatKnitPack4,
449+ RepositoryFormatKnitPack5,
450+ )
451+from breezy.bzr.knitrepo import (
452+ RepositoryFormatKnit1,
453+ RepositoryFormatKnit3,
454+ RepositoryFormatKnit4,
455+ )
456+from breezy.errors import (
457 NotStacked,
458 NoSuchRevision,
459- UnstackableBranchFormat,
460 )
461-from bzrlib.plugins.loom.branch import (
462+from breezy.plugins.loom.branch import (
463 BzrBranchLoomFormat1,
464 BzrBranchLoomFormat6,
465 )
466-from bzrlib.plugins.weave_fmt.branch import BzrBranchFormat4
467-from bzrlib.plugins.weave_fmt.bzrdir import (
468+from breezy.plugins.weave_fmt.branch import BzrBranchFormat4
469+from breezy.plugins.weave_fmt.bzrdir import (
470 BzrDirFormat4,
471 BzrDirFormat5,
472 BzrDirFormat6,
473 )
474-from bzrlib.plugins.weave_fmt.repository import (
475+from breezy.plugins.weave_fmt.repository import (
476 RepositoryFormat4,
477 RepositoryFormat5,
478 RepositoryFormat6,
479 RepositoryFormat7,
480 )
481-from bzrlib.repofmt.groupcompress_repo import RepositoryFormat2a
482-from bzrlib.repofmt.knitpack_repo import (
483- RepositoryFormatKnitPack1,
484- RepositoryFormatKnitPack3,
485- RepositoryFormatKnitPack4,
486- RepositoryFormatKnitPack5,
487- )
488-from bzrlib.revision import (
489+from breezy.revision import (
490 is_null,
491 NULL_REVISION,
492 )
493-from bzrlib.repofmt.knitrepo import (
494- RepositoryFormatKnit1,
495- RepositoryFormatKnit3,
496- RepositoryFormatKnit4,
497- )
498 from lazr.enum import (
499 DBEnumeratedType,
500 DBItem,
501@@ -305,7 +305,7 @@
502
503 :returns: tuple of (ControlFormat, BranchFormat, RepositoryFormat)
504 """
505- control_string = bzr_branch.bzrdir._format.get_format_string()
506+ control_string = bzr_branch.controldir._format.get_format_string()
507 branch_string = bzr_branch._format.get_format_string()
508 repository_string = bzr_branch.repository._format.get_format_string()
509 return (ControlFormat.get_enum(control_string),
510
511=== modified file 'lib/lp/code/configure.zcml'
512--- lib/lp/code/configure.zcml 2019-04-15 11:17:52 +0000
513+++ lib/lp/code/configure.zcml 2019-09-19 21:35:23 +0000
514@@ -1191,19 +1191,19 @@
515 />
516 </class>
517 <class
518- class="bzrlib.plugins.builder.recipe.BaseRecipeBranch">
519+ class="breezy.plugins.builder.recipe.BaseRecipeBranch">
520 <allow attributes="name url revspec revid child_branches deb_version __str__" />
521 </class>
522 <class
523- class="bzrlib.plugins.builder.recipe.RecipeBranch">
524+ class="breezy.plugins.builder.recipe.RecipeBranch">
525 <allow attributes="name url revspec revid child_branches __str__" />
526 </class>
527 <class
528- class="bzrlib.plugins.builder.recipe.MergeInstruction">
529+ class="breezy.plugins.builder.recipe.MergeInstruction">
530 <allow attributes="as_tuple recipe_branch nest_path" />
531 </class>
532 <class
533- class="bzrlib.plugins.builder.recipe.NestInstruction">
534+ class="breezy.plugins.builder.recipe.NestInstruction">
535 <allow attributes="as_tuple recipe_branch nest_path" />
536 </class>
537
538
539=== modified file 'lib/lp/code/errors.py'
540--- lib/lp/code/errors.py 2018-08-17 11:46:36 +0000
541+++ lib/lp/code/errors.py 2019-09-19 21:35:23 +0000
542@@ -66,7 +66,7 @@
543
544 import httplib
545
546-from bzrlib.plugins.builder.recipe import RecipeParseError
547+from breezy.plugins.builder.recipe import RecipeParseError
548 from lazr.restful.declarations import error_status
549
550 from lp.app.errors import (
551
552=== modified file 'lib/lp/code/interfaces/branch.py'
553--- lib/lp/code/interfaces/branch.py 2019-06-08 05:06:08 +0000
554+++ lib/lp/code/interfaces/branch.py 2019-09-19 21:35:23 +0000
555@@ -512,7 +512,7 @@
556
557 They are ordered with the most recent revision first, and the list
558 only contains those in the "leftmost tree", or in other words
559- the revisions that match the revision history from bzrlib for this
560+ the revisions that match the revision history from breezy for this
561 branch.
562
563 The revisions are listed as tuples of (`BranchRevision`, `Revision`).
564@@ -719,7 +719,7 @@
565 """Construct a URL for this branch in codebrowse.
566
567 :param extras: Zero or more path segments that will be joined onto the
568- end of the URL (with `bzrlib.urlutils.join`).
569+ end of the URL (with `breezy.urlutils.join`).
570 """
571
572 browse_source_url = Attribute(
573@@ -993,7 +993,7 @@
574 :return: tuple of three items.
575 1. Ancestry set of bzr revision-ids.
576 2. History list of bzr revision-ids. Similar to the result of
577- bzrlib.Branch.revision_history().
578+ breezy.Branch.revision_history().
579 3. Dictionnary mapping bzr bzr revision-ids to the database ids of
580 the corresponding BranchRevision rows for this branch.
581 """
582@@ -1012,7 +1012,7 @@
583 You can only call this if a server returned by `get_ro_server` or
584 `get_rw_server` is running.
585
586- :raise bzrlib.url_policy_open.BadUrl: If the branch is stacked
587+ :raise breezy.url_policy_open.BadUrl: If the branch is stacked
588 on or a reference to an unacceptable URL.
589 """
590
591
592=== modified file 'lib/lp/code/interfaces/tests/test_branch.py'
593--- lib/lp/code/interfaces/tests/test_branch.py 2011-09-26 07:33:00 +0000
594+++ lib/lp/code/interfaces/tests/test_branch.py 2019-09-19 21:35:23 +0000
595@@ -5,9 +5,9 @@
596
597 __metaclass__ = type
598
599-from bzrlib.branch import format_registry as branch_format_registry
600-from bzrlib.bzrdir import BzrProber
601-from bzrlib.repository import format_registry as repo_format_registry
602+from breezy.branch import format_registry as branch_format_registry
603+from breezy.bzr import BzrProber
604+from breezy.repository import format_registry as repo_format_registry
605
606 from lp.code.bzr import (
607 BranchFormat,
608@@ -27,21 +27,21 @@
609 """
610
611 def test_control_format_complement(self):
612- self.bzrlib_is_subset(BzrProber.formats.keys(), ControlFormat)
613+ self.breezy_is_subset(BzrProber.formats.keys(), ControlFormat)
614
615 def test_branch_format_complement(self):
616- self.bzrlib_is_subset(branch_format_registry.keys(), BranchFormat)
617+ self.breezy_is_subset(branch_format_registry.keys(), BranchFormat)
618
619 def test_repository_format_complement(self):
620- self.bzrlib_is_subset(repo_format_registry.keys(), RepositoryFormat)
621+ self.breezy_is_subset(repo_format_registry.keys(), RepositoryFormat)
622
623- def bzrlib_is_subset(self, bzrlib_formats, launchpad_enum):
624- """Ensure the bzr format marker list is a subset of launchpad."""
625- bzrlib_format_strings = set(bzrlib_formats)
626+ def breezy_is_subset(self, breezy_formats, launchpad_enum):
627+ """Ensure the Breezy format marker list is a subset of Launchpad."""
628+ breezy_format_strings = set(breezy_formats)
629 launchpad_format_strings = set(format.title for format
630 in launchpad_enum.items)
631 self.assertEqual(
632- set(), bzrlib_format_strings.difference(launchpad_format_strings))
633+ set(), breezy_format_strings.difference(launchpad_format_strings))
634
635 def test_repositoryDescriptions(self):
636 self.checkDescriptions(RepositoryFormat)
637
638=== modified file 'lib/lp/code/mail/codereviewcomment.py'
639--- lib/lp/code/mail/codereviewcomment.py 2019-09-13 23:47:20 +0000
640+++ lib/lp/code/mail/codereviewcomment.py 2019-09-19 21:35:23 +0000
641@@ -10,7 +10,7 @@
642 'CodeReviewCommentMailer',
643 ]
644
645-from bzrlib.patches import BinaryPatch
646+from breezy.patches import BinaryPatch
647 from zope.component import getUtility
648 from zope.security.proxy import removeSecurityProxy
649
650@@ -174,9 +174,9 @@
651 """Returns a list of correctly formatted comment(s)."""
652 comment_lines = []
653 if comment is not None:
654- comment_lines.append('')
655+ comment_lines.append(b'')
656 comment_lines.extend(comment.splitlines())
657- comment_lines.append('')
658+ comment_lines.append(b'')
659 return comment_lines
660
661
662@@ -201,7 +201,7 @@
663
664 if isinstance(patch, dict) and 'dirty_head' in patch:
665 for line in patch['dirty_head']:
666- dirty_head.append(u'> %s' % line.rstrip('\n'))
667+ dirty_head.append(b'> %s' % line.rstrip(b'\n'))
668 line_count += 1 # inc for dirty headers
669 comment = comments.get(str(line_count))
670 if comment:
671@@ -213,7 +213,7 @@
672 if type(patch) is BinaryPatch:
673 if dirty_comment:
674 result_lines.extend(dirty_head)
675- result_lines.append(u'> %s' % str(patch).rstrip('\n'))
676+ result_lines.append(b'> %s' % patch.as_bytes().rstrip(b'\n'))
677 line_count += 1
678 comment = comments.get(str(line_count))
679 if comment:
680@@ -224,7 +224,7 @@
681 line_count += 1 # inc patch headers
682 comment = comments.get(str(line_count))
683
684- patch_lines.append('> {0}'.format(ph))
685+ patch_lines.append(b'> %s' % ph)
686 if comment:
687 patch_lines.extend(format_comment(comment))
688 patch_comment = True
689@@ -236,8 +236,7 @@
690
691 # add context line (hunk header)
692 line_count += 1 # inc hunk context line
693- hunk_lines.append(u'> %s' % hunk.get_header().rstrip('\n').decode(
694- 'utf-8', 'replace'))
695+ hunk_lines.append(b'> %s' % hunk.get_header().rstrip(b'\n'))
696
697 # comment for context line (hunk header)
698 comment = comments.get(str(line_count))
699@@ -248,11 +247,9 @@
700 for hunk_line in hunk.lines:
701 # A single HunkLine can actually represent multiple
702 # lines in the "No newline at end of file" case.
703- hunk_line = str(hunk_line)
704- for line in hunk_line.splitlines():
705+ for line in hunk_line.as_bytes().splitlines():
706 line_count += 1 # inc hunk lines
707- hunk_lines.append(u'> %s' % line.rstrip('\n').decode(
708- 'utf-8', 'replace'))
709+ hunk_lines.append(b'> %s' % line.rstrip(b'\n'))
710 comment = comments.get(str(line_count))
711 if comment:
712 hunk_lines.extend(format_comment(comment))
713@@ -270,5 +267,5 @@
714 elif dirty_comment:
715 result_lines.extend(dirty_head)
716
717- result_text = '\n'.join(result_lines)
718+ result_text = b'\n'.join(result_lines).decode('UTF-8', errors='replace')
719 return '\n\nDiff comments:\n\n%s\n\n' % result_text
720
721=== modified file 'lib/lp/code/mail/patches.py'
722--- lib/lp/code/mail/patches.py 2019-09-13 23:47:20 +0000
723+++ lib/lp/code/mail/patches.py 2019-09-19 21:35:23 +0000
724@@ -1,4 +1,4 @@
725-# This file was partially cloned from bzr-2.6.0-lp-3 (bzrlib.patches) and
726+# This file was partially cloned from breezy 3.0.0 (breezy.patches) and
727 # customised for LP.
728 #
729 # Copyright (C) 2005-2010 Aaron Bentley, Canonical Ltd
730@@ -20,7 +20,7 @@
731
732 from __future__ import absolute_import
733
734-from bzrlib.patches import (
735+from breezy.patches import (
736 binary_files_re,
737 hunk_from_header,
738 parse_patch,
739@@ -50,10 +50,10 @@
740 beginning = True
741 in_git_patch = False
742
743- dirty_headers = ('=== ', 'diff ', 'index ')
744+ dirty_headers = (b'=== ', b'diff ', b'index ')
745 for line in iter_lines:
746 # preserve bzr modified/added headers and blank lines
747- if line.startswith(dirty_headers) or not line.strip('\n'):
748+ if line.startswith(dirty_headers) or not line.strip(b'\n'):
749 if len(saved_lines) > 0:
750 if keep_dirty and len(dirty_head) > 0:
751 yield {'saved_lines': saved_lines,
752@@ -63,7 +63,7 @@
753 yield saved_lines
754 in_git_patch = False
755 saved_lines = []
756- if line.startswith('diff --git'):
757+ if line.startswith(b'diff --git'):
758 in_git_patch = True
759 dirty_head.append(line)
760 continue
761@@ -73,14 +73,14 @@
762 # in the patch before the next "diff" header line can do so.
763 dirty_head.append(line)
764 continue
765- if line.startswith('*** '):
766+ if line.startswith(b'*** '):
767 continue
768- if line.startswith('#'):
769+ if line.startswith(b'#'):
770 continue
771 elif orig_range > 0:
772- if line.startswith('-') or line.startswith(' '):
773+ if line.startswith(b'-') or line.startswith(b' '):
774 orig_range -= 1
775- elif line.startswith('--- ') or regex.match(line):
776+ elif line.startswith(b'--- ') or regex.match(line):
777 if allow_dirty and beginning:
778 # Patches can have "junk" at the beginning
779 # Stripping junk from the end of patches is handled when we
780@@ -95,7 +95,7 @@
781 yield saved_lines
782 in_git_patch = False
783 saved_lines = []
784- elif line.startswith('@@'):
785+ elif line.startswith(b'@@'):
786 hunk = hunk_from_header(line)
787 orig_range = hunk.orig_range
788 saved_lines.append(line)
789@@ -116,12 +116,11 @@
790 :kwarg keep_dirty: If True, returns a dict of patches with dirty headers.
791 Default False.
792 '''
793- patches = []
794 for patch_lines in iter_file_patch(iter_lines, allow_dirty, keep_dirty):
795 if 'dirty_head' in patch_lines:
796- patches.append({'patch': parse_patch(
797- patch_lines['saved_lines'], allow_dirty),
798- 'dirty_head': patch_lines['dirty_head']})
799+ yield {
800+ 'patch': parse_patch(patch_lines['saved_lines'], allow_dirty),
801+ 'dirty_head': patch_lines['dirty_head'],
802+ }
803 else:
804- patches.append(parse_patch(patch_lines, allow_dirty))
805- return patches
806+ yield parse_patch(patch_lines, allow_dirty)
807
808=== modified file 'lib/lp/code/model/branch.py'
809--- lib/lp/code/model/branch.py 2019-06-13 08:54:49 +0000
810+++ lib/lp/code/model/branch.py 2019-09-19 21:35:23 +0000
811@@ -14,9 +14,9 @@
812 import operator
813 import os.path
814
815-from bzrlib import urlutils
816-from bzrlib.revision import NULL_REVISION
817-from bzrlib.url_policy_open import open_only_scheme
818+from breezy import urlutils
819+from breezy.revision import NULL_REVISION
820+from breezy.url_policy_open import open_only_scheme
821 from lazr.lifecycle.event import ObjectCreatedEvent
822 import pytz
823 import six
824
825=== modified file 'lib/lp/code/model/branchjob.py'
826--- lib/lp/code/model/branchjob.py 2018-03-30 20:42:14 +0000
827+++ lib/lp/code/model/branchjob.py 2019-09-19 21:35:23 +0000
828@@ -19,20 +19,20 @@
829 from StringIO import StringIO
830 import tempfile
831
832-from bzrlib.branch import Branch as BzrBranch
833-from bzrlib.diff import show_diff_trees
834-from bzrlib.errors import (
835+from breezy.branch import Branch as BzrBranch
836+from breezy.diff import show_diff_trees
837+from breezy.errors import (
838 NoSuchFile,
839 NotBranchError,
840 )
841-from bzrlib.log import (
842+from breezy.log import (
843 log_formatter,
844 show_log,
845 )
846-from bzrlib.revision import NULL_REVISION
847-from bzrlib.revisionspec import RevisionInfo
848-from bzrlib.transport import get_transport
849-from bzrlib.upgrade import upgrade
850+from breezy.revision import NULL_REVISION
851+from breezy.revisionspec import RevisionInfo
852+from breezy.transport import get_transport
853+from breezy.upgrade import upgrade
854 from lazr.delegates import delegate_to
855 from lazr.enum import (
856 DBEnumeratedType,
857@@ -533,7 +533,7 @@
858 repository = self.bzr_branch.repository
859 added_revisions = repository.get_graph().find_unique_ancestors(
860 self.last_revision_id, [self.last_scanned_id])
861- # Avoid hitting the database since bzrlib makes it easy to check.
862+ # Avoid hitting the database since breezy makes it easy to check.
863 # There are possibly more efficient ways to get the mainline
864 # revisions, but this is simple and it works.
865 history = branch_revision_history(self.bzr_branch)
866@@ -625,7 +625,7 @@
867 """Determine which revisions were merged by this revision.
868
869 :param revision_id: ID of the revision to examine.
870- :param graph: a bzrlib.graph.Graph.
871+ :param graph: a breezy.graph.Graph.
872 :return: a set of revision IDs.
873 """
874 parents = graph.get_parent_map([revision_id])[revision_id]
875@@ -901,7 +901,7 @@
876 continue
877 file_id, (from_path, to_path) = changed_file[:2]
878 changed_files.append((
879- to_path, to_tree.get_file_text(file_id)))
880+ to_path, to_tree.get_file_text(to_path)))
881 finally:
882 from_tree.unlock()
883 finally:
884
885=== modified file 'lib/lp/code/model/branchlookup.py'
886--- lib/lp/code/model/branchlookup.py 2015-09-29 15:00:10 +0000
887+++ lib/lp/code/model/branchlookup.py 2019-09-19 21:35:23 +0000
888@@ -9,7 +9,7 @@
889 __all__ = []
890
891
892-from bzrlib.urlutils import escape
893+from breezy.urlutils import escape
894 from lazr.enum import DBItem
895 from lazr.uri import (
896 InvalidURIError,
897
898=== modified file 'lib/lp/code/model/diff.py'
899--- lib/lp/code/model/diff.py 2016-07-01 20:07:09 +0000
900+++ lib/lp/code/model/diff.py 2019-09-19 21:35:23 +0000
901@@ -16,14 +16,14 @@
902 import sys
903 from uuid import uuid1
904
905-from bzrlib import trace
906-from bzrlib.diff import show_diff_trees
907-from bzrlib.merge import Merge3Merger
908-from bzrlib.patches import (
909+from breezy import trace
910+from breezy.diff import show_diff_trees
911+from breezy.merge import Merge3Merger
912+from breezy.patches import (
913 parse_patches,
914 Patch,
915 )
916-from bzrlib.plugins.difftacular.generate_diff import diff_ignore_branches
917+from breezy.plugins.difftacular.generate_diff import diff_ignore_branches
918 from lazr.delegates import delegate_to
919 import simplejson
920 from sqlobject import (
921
922=== modified file 'lib/lp/code/model/directbranchcommit.py'
923--- lib/lp/code/model/directbranchcommit.py 2013-06-20 05:50:00 +0000
924+++ lib/lp/code/model/directbranchcommit.py 2019-09-19 21:35:23 +0000
925@@ -12,9 +12,9 @@
926
927 import os.path
928
929-from bzrlib.generate_ids import gen_file_id
930-from bzrlib.revision import NULL_REVISION
931-from bzrlib.transform import (
932+from breezy.bzr.generate_ids import gen_file_id
933+from breezy.revision import NULL_REVISION
934+from breezy.transform import (
935 ROOT_PARENT,
936 TransformPreview,
937 )
938@@ -226,10 +226,11 @@
939 if rev_id == NULL_REVISION:
940 if list(self.transform_preview.iter_changes()) == []:
941 return
942+ self.transform_preview.fixup_new_roots()
943 committer_id = self.getBzrCommitterID()
944 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
945 # required to generate the revision-id.
946- with override_environ(BZR_EMAIL=committer_id):
947+ with override_environ(BRZ_EMAIL=committer_id):
948 new_rev_id = self.transform_preview.commit(
949 self.bzrbranch, commit_message, self.merge_parents,
950 committer=committer_id)
951
952=== modified file 'lib/lp/code/model/gitrepository.py'
953--- lib/lp/code/model/gitrepository.py 2019-09-16 09:05:01 +0000
954+++ lib/lp/code/model/gitrepository.py 2019-09-19 21:35:23 +0000
955@@ -27,7 +27,7 @@
956 from operator import attrgetter
957 from urllib import quote_plus
958
959-from bzrlib import urlutils
960+from breezy import urlutils
961 from lazr.enum import DBItem
962 from lazr.lifecycle.event import ObjectModifiedEvent
963 from lazr.lifecycle.snapshot import Snapshot
964
965=== modified file 'lib/lp/code/model/revision.py'
966--- lib/lp/code/model/revision.py 2015-09-28 17:38:45 +0000
967+++ lib/lp/code/model/revision.py 2019-09-19 21:35:23 +0000
968@@ -16,7 +16,7 @@
969 )
970 import email
971
972-from bzrlib.revision import NULL_REVISION
973+from breezy.revision import NULL_REVISION
974 import pytz
975 from sqlobject import (
976 BoolCol,
977@@ -322,7 +322,7 @@
978 This works around a bug in Python that causes datetime.fromtimestamp
979 to raise an exception if it is given a negative, fractional timestamp.
980
981- :param timestamp: A timestamp from a bzrlib.revision.Revision
982+ :param timestamp: A timestamp from a breezy.revision.Revision
983 :type timestamp: float
984
985 :return: A datetime corresponding to the given timestamp.
986
987=== modified file 'lib/lp/code/model/sourcepackagerecipedata.py'
988--- lib/lp/code/model/sourcepackagerecipedata.py 2018-07-23 17:15:40 +0000
989+++ lib/lp/code/model/sourcepackagerecipedata.py 2019-09-19 21:35:23 +0000
990@@ -13,7 +13,7 @@
991
992 import re
993
994-from bzrlib.plugins.builder.recipe import (
995+from breezy.plugins.builder.recipe import (
996 BaseRecipeBranch,
997 MergeInstruction,
998 NestInstruction,
999
1000=== modified file 'lib/lp/code/model/tests/test_branch.py'
1001--- lib/lp/code/model/tests/test_branch.py 2019-06-08 05:06:08 +0000
1002+++ lib/lp/code/model/tests/test_branch.py 2019-09-19 21:35:23 +0000
1003@@ -13,10 +13,10 @@
1004 )
1005 import json
1006
1007-from bzrlib.branch import Branch
1008-from bzrlib.bzrdir import BzrDir
1009-from bzrlib.revision import NULL_REVISION
1010-from bzrlib.url_policy_open import BadUrl
1011+from breezy.branch import Branch
1012+from breezy.bzr.bzrdir import BzrDir
1013+from breezy.revision import NULL_REVISION
1014+from breezy.url_policy_open import BadUrl
1015 from pytz import UTC
1016 from sqlobject import SQLObjectNotFound
1017 from storm.exceptions import LostObjectError
1018@@ -2257,7 +2257,7 @@
1019 def test_tip_revision_when_no_revisions(self):
1020 # When a branch has no revisions but does have Bazaar data, its tip
1021 # revision is None and its last_scanned_id is
1022- # bzrlib.revision.NULL_REVISION.
1023+ # breezy.revision.NULL_REVISION.
1024 branch = self.factory.makeBranch()
1025 branch.updateScannedDetails(None, 0)
1026 self.assertEqual(NULL_REVISION, branch.last_scanned_id)
1027@@ -3276,7 +3276,7 @@
1028 db_branch, tree = self.create_branch_and_tree()
1029 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
1030 # required to generate the revision-id.
1031- with override_environ(BZR_EMAIL='me@example.com'):
1032+ with override_environ(BRZ_EMAIL='me@example.com'):
1033 revid = tree.commit('')
1034 bzr_branch = db_branch.getBzrBranch()
1035 self.assertEqual(revid, bzr_branch.last_revision())
1036
1037=== modified file 'lib/lp/code/model/tests/test_branchjob.py'
1038--- lib/lp/code/model/tests/test_branchjob.py 2018-03-30 20:42:14 +0000
1039+++ lib/lp/code/model/tests/test_branchjob.py 2019-09-19 21:35:23 +0000
1040@@ -11,11 +11,11 @@
1041 import os
1042 import shutil
1043
1044-from bzrlib import errors as bzr_errors
1045-from bzrlib.branch import Branch
1046-from bzrlib.bzrdir import BzrDir
1047-from bzrlib.revision import NULL_REVISION
1048-from bzrlib.transport import get_transport
1049+from breezy import errors as bzr_errors
1050+from breezy.branch import Branch
1051+from breezy.bzr.bzrdir import BzrDir
1052+from breezy.revision import NULL_REVISION
1053+from breezy.transport import get_transport
1054 from fixtures import MockPatch
1055 import pytz
1056 from sqlobject import SQLObjectNotFound
1057@@ -149,7 +149,7 @@
1058 db_branch, bzr_tree = self.create_branch_and_tree()
1059 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
1060 # required to generate the revision-id.
1061- with override_environ(BZR_EMAIL='me@example.com'):
1062+ with override_environ(BRZ_EMAIL='me@example.com'):
1063 bzr_tree.commit('First commit', rev_id=b'rev1')
1064 bzr_tree.commit('Second commit', rev_id=b'rev2')
1065 bzr_tree.commit('Third commit', rev_id=b'rev3')
1066@@ -177,7 +177,7 @@
1067 db_branch, bzr_tree = self.create_branch_and_tree()
1068 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
1069 # required to generate the revision-id.
1070- with override_environ(BZR_EMAIL='me@example.com'):
1071+ with override_environ(BRZ_EMAIL='me@example.com'):
1072 bzr_tree.commit('First commit', rev_id=b'rev1')
1073 LaunchpadZopelessLayer.commit()
1074
1075@@ -198,7 +198,7 @@
1076 private_bug = self.factory.makeBug(
1077 target=product, information_type=InformationType.USERDATA)
1078 bug_line = b'https://launchpad.net/bugs/%s fixed' % private_bug.id
1079- with override_environ(BZR_EMAIL='me@example.com'):
1080+ with override_environ(BRZ_EMAIL='me@example.com'):
1081 bzr_tree.commit(
1082 'First commit', rev_id=b'rev1', revprops={b'bugs': bug_line})
1083 job = BranchScanJob.create(db_branch)
1084@@ -314,7 +314,7 @@
1085 db_branch, tree = self.create_branch_and_tree()
1086 branch2 = BzrDir.create_branch_convenience('.')
1087 tree.branch.set_stacked_on_url(branch2.base)
1088- branch2.bzrdir.destroy_branch()
1089+ branch2.controldir.destroy_branch()
1090 # Create BranchUpgradeJob manually, because we're trying to upgrade a
1091 # branch that doesn't need upgrading.
1092 requester = self.factory.makePerson()
1093@@ -463,7 +463,7 @@
1094 try:
1095 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
1096 # required to generate the revision-id.
1097- with override_environ(BZR_EMAIL='me@example.com'):
1098+ with override_environ(BRZ_EMAIL='me@example.com'):
1099 tree.commit('rev1', rev_id=b'rev1')
1100 tree.commit('rev2', rev_id=b'rev2')
1101 tree.commit('rev3', rev_id=b'rev3')
1102@@ -492,7 +492,7 @@
1103 tree.add_parent_tree_id(b'rev3')
1104 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
1105 # required to generate the revision-id.
1106- with override_environ(BZR_EMAIL='me@example.com'):
1107+ with override_environ(BRZ_EMAIL='me@example.com'):
1108 tree.commit('rev3a', rev_id=b'rev3a')
1109 self.updateDBRevisions(branch, tree.branch, [b'rev3', b'rev3a'])
1110 job = RevisionsAddedJob.create(branch, 'rev1', 'rev3', '')
1111@@ -533,7 +533,7 @@
1112 self.addCleanup(tree.unlock)
1113 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
1114 # required to generate the revision-id.
1115- with override_environ(BZR_EMAIL='me@example.com'):
1116+ with override_environ(BRZ_EMAIL='me@example.com'):
1117 tree.commit(
1118 'rev1', rev_id=b'rev1', timestamp=1000, timezone=0,
1119 committer='J. Random Hacker <jrandom@example.org>')
1120@@ -552,14 +552,14 @@
1121 tree.branch.nick = 'nicholas'
1122 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
1123 # required to generate the revision-id.
1124- with override_environ(BZR_EMAIL='me@example.com'):
1125+ with override_environ(BRZ_EMAIL='me@example.com'):
1126 tree.commit('rev1')
1127- tree2 = tree.bzrdir.sprout('tree2').open_workingtree()
1128+ tree2 = tree.controldir.sprout('tree2').open_workingtree()
1129 tree2.commit('rev2a', rev_id=b'rev2a-id', committer='foo@')
1130 tree2.commit('rev3', rev_id=b'rev3-id',
1131 authors=['bar@', 'baz@blaine.com'])
1132 tree.merge_from_branch(tree2.branch)
1133- tree3 = tree.bzrdir.sprout('tree3').open_workingtree()
1134+ tree3 = tree.controldir.sprout('tree3').open_workingtree()
1135 tree3.commit('rev2b', rev_id=b'rev2b-id', committer='qux@')
1136 tree.merge_from_branch(tree3.branch, force=True)
1137 if include_ghost:
1138@@ -808,17 +808,17 @@
1139 self.useBzrBranches(direct_database=True)
1140 db_branch, tree = self.create_branch_and_tree()
1141 first_revision = b'rev-1'
1142- tree.bzrdir.root_transport.put_bytes('hello.txt', 'Hello World\n')
1143+ tree.controldir.root_transport.put_bytes('hello.txt', b'Hello World\n')
1144 tree.add('hello.txt')
1145 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
1146 # required to generate the revision-id.
1147- with override_environ(BZR_EMAIL='me@example.com'):
1148+ with override_environ(BRZ_EMAIL='me@example.com'):
1149 tree.commit(
1150 rev_id=first_revision, message="Log message",
1151 committer="Joe Bloggs <joe@example.com>",
1152 timestamp=1000000000.0, timezone=0)
1153- tree.bzrdir.root_transport.put_bytes(
1154- 'hello.txt', 'Hello World\n\nFoo Bar\n')
1155+ tree.controldir.root_transport.put_bytes(
1156+ 'hello.txt', b'Hello World\n\nFoo Bar\n')
1157 second_revision = b'rev-2'
1158 tree.commit(
1159 rev_id=second_revision, message="Extended contents",
1160@@ -864,7 +864,7 @@
1161 rev_id = b'rev-1'
1162 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
1163 # required to generate the revision-id.
1164- with override_environ(BZR_EMAIL='me@example.com'):
1165+ with override_environ(BRZ_EMAIL='me@example.com'):
1166 tree.commit(
1167 rev_id=rev_id, message="Non ASCII: \xe9",
1168 committer="Non ASCII: \xed", timestamp=1000000000.0,
1169@@ -971,8 +971,9 @@
1170 except IndexError:
1171 file_content = self.factory.getUniqueString()
1172 dname = os.path.dirname(file_name)
1173- self.tree.bzrdir.root_transport.clone(dname).create_prefix()
1174- self.tree.bzrdir.root_transport.put_bytes(file_name, file_content)
1175+ self.tree.controldir.root_transport.clone(dname).create_prefix()
1176+ self.tree.controldir.root_transport.put_bytes(
1177+ file_name, file_content)
1178 if len(files) > 0:
1179 self.tree.smart_add(
1180 [self.tree.abspath(file_pair[0]) for file_pair in files])
1181@@ -980,7 +981,7 @@
1182 commit_message = self.factory.getUniqueString('commit')
1183 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
1184 # required to generate the revision-id.
1185- with override_environ(BZR_EMAIL='me@example.com'):
1186+ with override_environ(BRZ_EMAIL='me@example.com'):
1187 revision_id = self.tree.commit(commit_message)
1188 self.branch.last_scanned_id = revision_id
1189 self.branch.last_mirrored_id = revision_id
1190@@ -1076,7 +1077,7 @@
1191 # An empty POT cannot be uploaded, if if the product series is
1192 # configured for template import.
1193 entries = self._runJobWithFile(
1194- TranslationsBranchImportMode.IMPORT_TEMPLATES, 'empty.pot', '')
1195+ TranslationsBranchImportMode.IMPORT_TEMPLATES, 'empty.pot', b'')
1196 self.assertEqual(entries, [])
1197
1198 def test_upload_hidden_pot(self):
1199@@ -1103,7 +1104,7 @@
1200 def test_upload_pot_content(self):
1201 # The content of the uploaded file is stored in the librarian.
1202 # The uploader of a POT is the series owner.
1203- POT_CONTENT = "pot content\n"
1204+ POT_CONTENT = b"pot content\n"
1205 self._runJobWithFile(
1206 TranslationsBranchImportMode.IMPORT_TEMPLATES,
1207 'foo.pot', POT_CONTENT)
1208
1209=== modified file 'lib/lp/code/model/tests/test_branchmergeproposaljobs.py'
1210--- lib/lp/code/model/tests/test_branchmergeproposaljobs.py 2019-06-20 13:16:35 +0000
1211+++ lib/lp/code/model/tests/test_branchmergeproposaljobs.py 2019-09-19 21:35:23 +0000
1212@@ -190,7 +190,7 @@
1213 target_branch, tree = self.create_branch_and_tree()
1214 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
1215 # required to generate the revision-id.
1216- with override_environ(BZR_EMAIL='me@example.com'):
1217+ with override_environ(BRZ_EMAIL='me@example.com'):
1218 tree.commit('test')
1219 source_branch = self.factory.makeProductBranch(
1220 product=target_branch.product)
1221@@ -212,7 +212,7 @@
1222 tree = self.create_branch_and_tree(db_branch=bmp.target_branch)[1]
1223 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
1224 # required to generate the revision-id.
1225- with override_environ(BZR_EMAIL='me@example.com'):
1226+ with override_environ(BRZ_EMAIL='me@example.com'):
1227 tree.commit('Initial commit')
1228 self.createBzrBranch(bmp.source_branch, tree.branch)
1229 self.factory.makeRevisionsForBranch(bmp.source_branch, count=1)
1230
1231=== modified file 'lib/lp/code/model/tests/test_diff.py'
1232--- lib/lp/code/model/tests/test_diff.py 2017-10-04 01:49:22 +0000
1233+++ lib/lp/code/model/tests/test_diff.py 2019-09-19 21:35:23 +0000
1234@@ -12,8 +12,8 @@
1235 import logging
1236 from textwrap import dedent
1237
1238-from bzrlib import trace
1239-from bzrlib.patches import (
1240+from breezy import trace
1241+from breezy.patches import (
1242 InsertLine,
1243 parse_patches,
1244 RemoveLine,
1245@@ -565,7 +565,7 @@
1246 reload(trace)
1247 bmp, source_rev_id, target_rev_id = self.createExampleBzrMerge()
1248 handler = RecordLister()
1249- logger = logging.getLogger('bzr')
1250+ logger = logging.getLogger('brz')
1251 logger.addHandler(handler)
1252 try:
1253 PreviewDiff.fromBranchMergeProposal(bmp)
1254
1255=== modified file 'lib/lp/code/model/tests/test_gitref.py'
1256--- lib/lp/code/model/tests/test_gitref.py 2019-05-22 14:57:45 +0000
1257+++ lib/lp/code/model/tests/test_gitref.py 2019-09-19 21:35:23 +0000
1258@@ -14,7 +14,7 @@
1259 import hashlib
1260 import json
1261
1262-from bzrlib import urlutils
1263+from breezy import urlutils
1264 import pytz
1265 import responses
1266 from storm.store import Store
1267
1268=== modified file 'lib/lp/code/model/tests/test_gitrepository.py'
1269--- lib/lp/code/model/tests/test_gitrepository.py 2019-09-16 09:05:01 +0000
1270+++ lib/lp/code/model/tests/test_gitrepository.py 2019-09-19 21:35:23 +0000
1271@@ -16,7 +16,7 @@
1272 import hashlib
1273 import json
1274
1275-from bzrlib import urlutils
1276+from breezy import urlutils
1277 from fixtures import MockPatch
1278 from lazr.lifecycle.event import ObjectModifiedEvent
1279 from pymacaroons import Macaroon
1280
1281=== modified file 'lib/lp/code/model/tests/test_sourcepackagerecipe.py'
1282--- lib/lp/code/model/tests/test_sourcepackagerecipe.py 2019-01-25 11:47:20 +0000
1283+++ lib/lp/code/model/tests/test_sourcepackagerecipe.py 2019-09-19 21:35:23 +0000
1284@@ -13,7 +13,7 @@
1285 )
1286 import textwrap
1287
1288-from bzrlib.plugins.builder.recipe import ForbiddenInstructionError
1289+from breezy.plugins.builder.recipe import ForbiddenInstructionError
1290 from pytz import UTC
1291 from storm.locals import Store
1292 from testtools.matchers import Equals
1293
1294=== modified file 'lib/lp/code/scripts/tests/test_scan_branches.py'
1295--- lib/lp/code/scripts/tests/test_scan_branches.py 2017-09-14 03:59:29 +0000
1296+++ lib/lp/code/scripts/tests/test_scan_branches.py 2019-09-19 21:35:23 +0000
1297@@ -39,7 +39,7 @@
1298 target, target_tree = self.create_branch_and_tree(db_branch=db_branch)
1299 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
1300 # required to generate the revision-id.
1301- with override_environ(BZR_EMAIL='me@example.com'):
1302+ with override_environ(BRZ_EMAIL='me@example.com'):
1303 target_tree.commit('First commit', rev_id='rev1')
1304 target_tree.commit('Second commit', rev_id='rev2')
1305 target_tree.commit('Third commit', rev_id='rev3')
1306
1307=== modified file 'lib/lp/code/scripts/tests/test_sendbranchmail.py'
1308--- lib/lp/code/scripts/tests/test_sendbranchmail.py 2013-07-04 07:18:21 +0000
1309+++ lib/lp/code/scripts/tests/test_sendbranchmail.py 2019-09-19 21:35:23 +0000
1310@@ -32,12 +32,12 @@
1311 BranchSubscriptionDiffSize.WHOLEDIFF,
1312 CodeReviewNotificationLevel.FULL,
1313 branch.registrant)
1314- transport = tree.bzrdir.root_transport
1315- transport.put_bytes('foo', 'bar')
1316+ transport = tree.controldir.root_transport
1317+ transport.put_bytes('foo', b'bar')
1318 tree.add('foo')
1319 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
1320 # required to generate the revision-id.
1321- with override_environ(BZR_EMAIL='me@example.com'):
1322+ with override_environ(BRZ_EMAIL='me@example.com'):
1323 tree.commit('Added foo.', rev_id='rev1')
1324 return branch, tree
1325
1326@@ -65,10 +65,10 @@
1327 """RevisionsAddedJobs are run by sendbranchmail."""
1328 self.useBzrBranches()
1329 branch, tree = self.createBranch()
1330- tree.bzrdir.root_transport.put_bytes('foo', 'baz')
1331+ tree.controldir.root_transport.put_bytes('foo', b'baz')
1332 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
1333 # required to generate the revision-id.
1334- with override_environ(BZR_EMAIL='me@example.com'):
1335+ with override_environ(BRZ_EMAIL='me@example.com'):
1336 tree.commit('Added foo.', rev_id='rev2')
1337 job = RevisionsAddedJob.create(
1338 branch, 'rev1', 'rev2', 'from@example.org')
1339
1340=== modified file 'lib/lp/code/scripts/tests/test_upgrade_branches.py'
1341--- lib/lp/code/scripts/tests/test_upgrade_branches.py 2013-07-04 06:54:18 +0000
1342+++ lib/lp/code/scripts/tests/test_upgrade_branches.py 2019-09-19 21:35:23 +0000
1343@@ -4,7 +4,7 @@
1344 """Test the upgrade_branches script."""
1345
1346
1347-from bzrlib.branch import Branch as BzrBranch
1348+from breezy.branch import Branch as BzrBranch
1349 import transaction
1350
1351 from lp.code.model.branch import (
1352
1353=== modified file 'lib/lp/code/stories/branches/xx-bazaar-home.txt'
1354--- lib/lp/code/stories/branches/xx-bazaar-home.txt 2019-05-22 14:57:45 +0000
1355+++ lib/lp/code/stories/branches/xx-bazaar-home.txt 2019-09-19 21:35:23 +0000
1356@@ -1,15 +1,15 @@
1357 The Launchpad Code front page
1358 =============================
1359
1360-First we manually set the Bazaar version, so that this document will not need
1361-updating when Launchpad upgrades Bazaar.
1362-
1363- >>> import bzrlib
1364- >>> bzrlib_version = bzrlib.__version__
1365- >>> bzrlib.__version__ = '0.92.0'
1366-
1367-
1368-Check that the Bazaar home page works.
1369+First we manually set the Breezy version, so that this document will not need
1370+updating when Launchpad upgrades Breezy.
1371+
1372+ >>> import breezy
1373+ >>> breezy_version = breezy.__version__
1374+ >>> breezy.__version__ = '3.0.0'
1375+
1376+
1377+Check that the Code home page works.
1378
1379 >>> browser.open('http://code.launchpad.test/')
1380 >>> footer = find_tag_by_id(browser.contents, 'application-footer')
1381@@ -18,12 +18,12 @@
1382 30 branches registered in
1383 6 projects
1384 1 imported branches
1385- Launchpad uses Bazaar 0.92.0.
1386-
1387-
1388-Restore the original Bazaar version:
1389-
1390- >>> bzrlib.__version__ = bzrlib_version
1391+ Launchpad uses Breezy 3.0.0.
1392+
1393+
1394+Restore the original Breezy version:
1395+
1396+ >>> breezy.__version__ = breezy_version
1397
1398
1399 The main code home page now has a subset of the project tag cloud,
1400
1401=== modified file 'lib/lp/code/stories/webservice/xx-branch.txt'
1402--- lib/lp/code/stories/webservice/xx-branch.txt 2019-04-16 10:53:13 +0000
1403+++ lib/lp/code/stories/webservice/xx-branch.txt 2019-09-19 21:35:23 +0000
1404@@ -3,7 +3,7 @@
1405
1406 Launchpad provides two ways to programmatically interact with your
1407 branches. You can either interact with the branches themselves using
1408-`bzrlib`, or you can use Launchpad's webservice APIs to explore
1409+`breezy`, or you can use Launchpad's webservice APIs to explore
1410 information about the branches and how they relate to the rest of
1411 the things on Launchpad.
1412
1413
1414=== modified file 'lib/lp/code/templates/bazaar-index.pt'
1415--- lib/lp/code/templates/bazaar-index.pt 2012-10-08 02:24:51 +0000
1416+++ lib/lp/code/templates/bazaar-index.pt 2019-09-19 21:35:23 +0000
1417@@ -128,8 +128,8 @@
1418 </a>
1419 </div>
1420 <div>
1421- Launchpad uses <a href="http://bazaar.canonical.com/">Bazaar</a>
1422- <tal:version tal:content="view/bzr_version">2.0</tal:version>.
1423+ Launchpad uses <a href="https://www.breezy-vcs.org/">Breezy</a>
1424+ <tal:version tal:content="view/brz_version">3.0.0</tal:version>.
1425 </div>
1426 </div>
1427
1428
1429=== modified file 'lib/lp/code/tests/helpers.py'
1430--- lib/lp/code/tests/helpers.py 2018-09-07 13:43:50 +0000
1431+++ lib/lp/code/tests/helpers.py 2019-09-19 21:35:23 +0000
1432@@ -26,7 +26,7 @@
1433 from difflib import unified_diff
1434 from itertools import count
1435
1436-from bzrlib.plugins.builder.recipe import RecipeParser
1437+from breezy.plugins.builder.recipe import RecipeParser
1438 import fixtures
1439 import transaction
1440 from zope.component import getUtility
1441
1442=== modified file 'lib/lp/code/tests/test_bzr.py'
1443--- lib/lp/code/tests/test_bzr.py 2018-01-02 16:10:26 +0000
1444+++ lib/lp/code/tests/test_bzr.py 2019-09-19 21:35:23 +0000
1445@@ -7,12 +7,13 @@
1446
1447 __metaclass__ = type
1448
1449-from bzrlib.errors import NoSuchRevision
1450-from bzrlib.revision import NULL_REVISION
1451-from bzrlib.tests import (
1452+from breezy.errors import NoSuchRevision
1453+from breezy.revision import NULL_REVISION
1454+from breezy.tests import (
1455 TestCaseInTempDir,
1456 TestCaseWithTransport,
1457 )
1458+import six
1459
1460 from lp.code.bzr import (
1461 branch_revision_history,
1462@@ -49,7 +50,7 @@
1463
1464 def test_get_branch_format_2a(self):
1465 # Test the 2a branch format.
1466- branch = self.make_branch('test', '2a')
1467+ branch = self.make_branch('test', six.ensure_str('2a'))
1468 formats = get_branch_formats(branch)
1469 self.assertEqual(ControlFormat.BZR_METADIR_1, formats[0])
1470 self.assertEqual(BranchFormat.BZR_BRANCH_7, formats[1])
1471@@ -57,7 +58,7 @@
1472
1473 def test_get_branch_format_1_9(self):
1474 # Test the 1.9 branch format.
1475- branch = self.make_branch('test', '1.9')
1476+ branch = self.make_branch('test', six.ensure_str('1.9'))
1477 formats = get_branch_formats(branch)
1478 self.assertEqual(ControlFormat.BZR_METADIR_1, formats[0])
1479 self.assertEqual(BranchFormat.BZR_BRANCH_7, formats[1])
1480@@ -65,7 +66,7 @@
1481
1482 def test_get_branch_format_packs(self):
1483 # Test the packs branch format.
1484- branch = self.make_branch('test', 'pack-0.92')
1485+ branch = self.make_branch('test', six.ensure_str('pack-0.92'))
1486 formats = get_branch_formats(branch)
1487 self.assertEqual(ControlFormat.BZR_METADIR_1, formats[0])
1488 self.assertEqual(BranchFormat.BZR_BRANCH_6, formats[1])
1489@@ -73,7 +74,7 @@
1490
1491 def test_get_branch_format_knits(self):
1492 # Test the knits branch format.
1493- branch = self.make_branch('test', 'knit')
1494+ branch = self.make_branch('test', six.ensure_str('knit'))
1495 formats = get_branch_formats(branch)
1496 self.assertEqual(ControlFormat.BZR_METADIR_1, formats[0])
1497 self.assertEqual(BranchFormat.BZR_BRANCH_5, formats[1])
1498@@ -89,7 +90,7 @@
1499
1500 def test_some_commits(self):
1501 branch = self.make_branch('test')
1502- tree = branch.bzrdir.create_workingtree()
1503+ tree = branch.controldir.create_workingtree()
1504 tree.commit('acommit', rev_id=b'A')
1505 tree.commit('bcommit', rev_id=b'B')
1506 tree.commit('ccommit', rev_id=b'C')
1507@@ -109,7 +110,7 @@
1508 def test_some(self):
1509 # Verify ancestors are included.
1510 branch = self.make_branch('test')
1511- tree = branch.bzrdir.create_workingtree()
1512+ tree = branch.controldir.create_workingtree()
1513 tree.commit('msg a', rev_id=b'A')
1514 tree.commit('msg b', rev_id=b'B')
1515 tree.commit('msg c', rev_id=b'C')
1516@@ -123,7 +124,7 @@
1517 def test_children(self):
1518 # Verify non-mainline children are included.
1519 branch = self.make_branch('test')
1520- tree = branch.bzrdir.create_workingtree()
1521+ tree = branch.controldir.create_workingtree()
1522 tree.commit('msg a', rev_id=b'A')
1523 branch.generate_revision_history(NULL_REVISION)
1524 tree.set_parent_ids([])
1525
1526=== modified file 'lib/lp/code/xmlrpc/branch.py'
1527--- lib/lp/code/xmlrpc/branch.py 2017-05-23 12:42:38 +0000
1528+++ lib/lp/code/xmlrpc/branch.py 2019-09-19 21:35:23 +0000
1529@@ -12,7 +12,7 @@
1530
1531 from xmlrpclib import Fault
1532
1533-from bzrlib import urlutils
1534+from breezy import urlutils
1535 from zope.component import getUtility
1536 from zope.interface import (
1537 implementer,
1538
1539=== modified file 'lib/lp/code/xmlrpc/codehosting.py'
1540--- lib/lp/code/xmlrpc/codehosting.py 2018-12-10 13:54:34 +0000
1541+++ lib/lp/code/xmlrpc/codehosting.py 2019-09-19 21:35:23 +0000
1542@@ -13,7 +13,7 @@
1543
1544 import datetime
1545
1546-from bzrlib.urlutils import (
1547+from breezy.urlutils import (
1548 escape,
1549 unescape,
1550 )
1551
1552=== modified file 'lib/lp/code/xmlrpc/tests/test_branch.py'
1553--- lib/lp/code/xmlrpc/tests/test_branch.py 2019-05-22 14:57:45 +0000
1554+++ lib/lp/code/xmlrpc/tests/test_branch.py 2019-09-19 21:35:23 +0000
1555@@ -8,7 +8,7 @@
1556 import os
1557 import xmlrpclib
1558
1559-from bzrlib import urlutils
1560+from breezy import urlutils
1561 from lazr.uri import URI
1562 from zope.security.proxy import removeSecurityProxy
1563
1564
1565=== modified file 'lib/lp/code/xmlrpc/tests/test_codehosting.py'
1566--- lib/lp/code/xmlrpc/tests/test_codehosting.py 2019-05-22 14:57:45 +0000
1567+++ lib/lp/code/xmlrpc/tests/test_codehosting.py 2019-09-19 21:35:23 +0000
1568@@ -8,8 +8,8 @@
1569 import datetime
1570 import os
1571
1572-from bzrlib import bzrdir
1573-from bzrlib.urlutils import escape
1574+from breezy import controldir
1575+from breezy.urlutils import escape
1576 import pytz
1577 from testscenarios import (
1578 load_tests_apply_scenarios,
1579@@ -659,7 +659,7 @@
1580 branch, 'next_mirror_time', UTC_NOW)
1581
1582 def getFormatStringsForFormatName(self, format_name):
1583- default_format = bzrdir.format_registry.get(format_name)()
1584+ default_format = controldir.format_registry.get(format_name)()
1585 control_string = default_format.get_format_string()
1586 branch_string = default_format.get_branch_format().get_format_string()
1587 repository_string = \
1588
1589=== modified file 'lib/lp/codehosting/__init__.py'
1590--- lib/lp/codehosting/__init__.py 2017-12-19 12:32:57 +0000
1591+++ lib/lp/codehosting/__init__.py 2019-09-19 21:35:23 +0000
1592@@ -9,16 +9,21 @@
1593
1594 __metaclass__ = type
1595 __all__ = [
1596- 'get_bzr_path',
1597+ 'get_brz_path',
1598 'get_BZR_PLUGIN_PATH_for_subprocess',
1599 ]
1600
1601
1602 import os
1603
1604-import bzrlib
1605-from bzrlib.branch import Branch
1606-from bzrlib.plugin import load_plugins
1607+import breezy
1608+from breezy import ui as brz_ui
1609+from breezy.branch import Branch
1610+from breezy.library_state import BzrLibraryState as BrzLibraryState
1611+from breezy.plugin import load_plugins as brz_load_plugins
1612+# This import is needed so that brz's logger gets registered.
1613+import breezy.trace
1614+from bzrlib.plugin import load_plugins as bzr_load_plugins
1615 # This import is needed so that bzr's logger gets registered.
1616 import bzrlib.trace
1617 from zope.security import checker
1618@@ -26,9 +31,9 @@
1619 from lp.services.config import config
1620
1621
1622-def get_bzr_path():
1623- """Find the path to the copy of Bazaar for this rocketfuel instance"""
1624- return os.path.join(config.root, 'bin', 'bzr')
1625+def get_brz_path():
1626+ """Find the path to the copy of Breezy for this rocketfuel instance"""
1627+ return os.path.join(config.root, 'bin', 'brz')
1628
1629
1630 def _get_bzr_plugins_path():
1631@@ -48,23 +53,50 @@
1632 return ":".join((_get_bzr_plugins_path(), "-site"))
1633
1634
1635+def _get_brz_plugins_path():
1636+ """Find the path to the Breezy plugins for this rocketfuel instance."""
1637+ return os.path.join(config.root, 'brzplugins')
1638+
1639+
1640+def get_BRZ_PLUGIN_PATH_for_subprocess():
1641+ """Calculate the appropriate value for the BRZ_PLUGIN_PATH environment.
1642+
1643+ The '-site' token tells breezy not to include the 'site specific plugins
1644+ directory' (which is usually something like
1645+ /usr/lib/pythonX.Y/dist-packages/breezy/plugins/) in the plugin search
1646+ path, which would be inappropriate for Launchpad, which may have an
1647+ incompatible version of breezy in its virtualenv.
1648+ """
1649+ return ":".join((_get_brz_plugins_path(), "-site"))
1650+
1651+
1652+# We must explicitly initialize Breezy, as otherwise it will initialize
1653+# itself with a terminal-oriented UI.
1654+if breezy._global_state is None:
1655+ brz_state = BrzLibraryState(
1656+ ui=brz_ui.SilentUIFactory(), trace=breezy.trace.Config())
1657+ brz_state._start()
1658+
1659+
1660+# XXX cjwatson 2019-06-13: Remove BZR_PLUGIN_PATH and supporting code once
1661+# all of Launchpad has been ported to Breezy.
1662 os.environ['BZR_PLUGIN_PATH'] = get_BZR_PLUGIN_PATH_for_subprocess()
1663+os.environ['BRZ_PLUGIN_PATH'] = get_BRZ_PLUGIN_PATH_for_subprocess()
1664+
1665+# Disable some Breezy plugins that are likely to cause trouble if used on
1666+# the server. (Unfortunately there doesn't seem to be a good way to load
1667+# only explicitly-specified plugins at the moment.)
1668+os.environ['BRZ_DISABLE_PLUGINS'] = ':'.join([
1669+ 'cvs',
1670+ 'darcs',
1671+ 'email',
1672+ 'mtn',
1673+ ])
1674
1675 # We want to have full access to Launchpad's Bazaar plugins throughout the
1676 # codehosting package.
1677-load_plugins([_get_bzr_plugins_path()])
1678-
1679-
1680-def load_bundled_plugin(plugin_name):
1681- """Load a plugin bundled with Bazaar."""
1682- from bzrlib.plugin import get_core_plugin_path
1683- from bzrlib import plugins
1684- if get_core_plugin_path() not in plugins.__path__:
1685- plugins.__path__.append(get_core_plugin_path())
1686- __import__("bzrlib.plugins.%s" % plugin_name)
1687-
1688-
1689-load_bundled_plugin("weave_fmt")
1690+bzr_load_plugins([_get_bzr_plugins_path()])
1691+brz_load_plugins()
1692
1693
1694 def dont_wrap_class_and_subclasses(cls):
1695@@ -75,6 +107,6 @@
1696
1697 # Don't wrap Branch or its subclasses in Zope security proxies. Make sure
1698 # the various LoomBranch classes are present first.
1699-import bzrlib.plugins.loom.branch
1700-bzrlib.plugins.loom.branch
1701+import breezy.plugins.loom.branch
1702+breezy.plugins.loom.branch
1703 dont_wrap_class_and_subclasses(Branch)
1704
1705=== modified file 'lib/lp/codehosting/bzrutils.py'
1706--- lib/lp/codehosting/bzrutils.py 2015-07-10 06:06:59 +0000
1707+++ lib/lp/codehosting/bzrutils.py 2019-09-19 21:35:23 +0000
1708@@ -1,10 +1,10 @@
1709 # Copyright 2009 Canonical Ltd. This software is licensed under the
1710 # GNU Affero General Public License version 3 (see the file LICENSE).
1711
1712-"""Utilities for dealing with Bazaar.
1713+"""Utilities for dealing with Breezy.
1714
1715 Much of the code in here should be submitted upstream. The rest is code that
1716-integrates between Bazaar's infrastructure and Launchpad's infrastructure.
1717+integrates between Breezy's infrastructure and Launchpad's infrastructure.
1718 """
1719
1720 __metaclass__ = type
1721@@ -28,30 +28,30 @@
1722 import os
1723 import sys
1724
1725-from bzrlib import (
1726+from breezy import (
1727 config,
1728 trace,
1729 )
1730-from bzrlib.errors import (
1731+from breezy.branch import UnstackableBranchFormat
1732+from breezy.bzr.remote import (
1733+ RemoteBranch,
1734+ RemoteBzrDir,
1735+ RemoteRepository,
1736+ )
1737+from breezy.errors import (
1738 AppendRevisionsOnlyViolation,
1739 ConnectionTimeout,
1740 GhostRevisionsHaveNoRevno,
1741 NotStacked,
1742- UnstackableBranchFormat,
1743 UnstackableRepositoryFormat,
1744 UnsupportedProtocol,
1745 )
1746-from bzrlib.remote import (
1747- RemoteBranch,
1748- RemoteBzrDir,
1749- RemoteRepository,
1750- )
1751-from bzrlib.transport import (
1752+from breezy.transport import (
1753 get_transport,
1754 register_transport,
1755 unregister_transport,
1756 )
1757-from bzrlib.transport.local import LocalTransport
1758+from breezy.transport.local import LocalTransport
1759 from lazr.uri import URI
1760
1761 from lp.services.webapp.errorlog import (
1762@@ -221,7 +221,7 @@
1763 """A LocalTransport that works using http URLs.
1764
1765 We have this because the Launchpad database has constraints on URLs for
1766- branches, disallowing file:/// URLs. bzrlib itself disallows
1767+ branches, disallowing file:/// URLs. breezy itself disallows
1768 file://localhost/ URLs.
1769 """
1770
1771@@ -287,7 +287,7 @@
1772 if isinstance(repository, RemoteRepository):
1773 repository._ensure_real()
1774 repository = repository._real_repository
1775- bzrdir = branch.bzrdir
1776+ bzrdir = branch.controldir
1777 if isinstance(bzrdir, RemoteBzrDir):
1778 bzrdir._ensure_real()
1779 bzrdir = bzrdir._real_bzrdir
1780@@ -325,7 +325,7 @@
1781 # XXX: Aaron Bentley 2008-06-13
1782 # Bazaar does not provide a public API for learning about
1783 # format markers. Fix this in Bazaar, then here.
1784- info['control_string'] = branch.bzrdir._format.get_format_string()
1785+ info['control_string'] = branch.controldir._format.get_format_string()
1786 info['branch_string'] = branch._format.get_format_string()
1787 info['repository_string'] = branch.repository._format.get_format_string()
1788 return info
1789
1790=== modified file 'lib/lp/codehosting/codeimport/tests/test_worker.py'
1791--- lib/lp/codehosting/codeimport/tests/test_worker.py 2019-07-09 11:42:39 +0000
1792+++ lib/lp/codehosting/codeimport/tests/test_worker.py 2019-09-19 21:35:23 +0000
1793@@ -438,7 +438,7 @@
1794 remote_name = '%08x.tar.gz' % (source_details.target_id,)
1795 local_name = '%s.tar.gz' % (self.factory.getUniqueString(),)
1796 transport = self.get_transport()
1797- transport.put_bytes(remote_name, '')
1798+ transport.put_bytes(remote_name, b'')
1799 store = ImportDataStore(transport, source_details)
1800 ret = store.fetch(local_name)
1801 self.assertTrue(ret)
1802@@ -496,7 +496,7 @@
1803 local_name = '%s.tar.gz' % (self.factory.getUniqueString(),)
1804 subdir_name = self.factory.getUniqueString()
1805 source_details = self.factory.makeCodeImportSourceDetails()
1806- get_transport('.').put_bytes(local_name, '')
1807+ get_transport('.').put_bytes(local_name, b'')
1808 transport = self.get_transport()
1809 store = ImportDataStore(transport.clone(subdir_name), source_details)
1810 store.put(local_name)
1811
1812=== modified file 'lib/lp/codehosting/inmemory.py'
1813--- lib/lp/codehosting/inmemory.py 2018-12-10 13:54:34 +0000
1814+++ lib/lp/codehosting/inmemory.py 2019-09-19 21:35:23 +0000
1815@@ -12,7 +12,7 @@
1816 import operator
1817 from xmlrpclib import Fault
1818
1819-from bzrlib.urlutils import (
1820+from breezy.urlutils import (
1821 escape,
1822 unescape,
1823 )
1824
1825=== modified file 'lib/lp/codehosting/puller/scheduler.py'
1826--- lib/lp/codehosting/puller/scheduler.py 2013-01-07 02:40:55 +0000
1827+++ lib/lp/codehosting/puller/scheduler.py 2019-09-19 21:35:23 +0000
1828@@ -320,7 +320,7 @@
1829 self.default_stacked_on_url]
1830 self.logger.debug("executing %s", command)
1831 env = os.environ.copy()
1832- env['BZR_EMAIL'] = get_lock_id_for_branch_id(self.branch_id)
1833+ env['BRZ_EMAIL'] = get_lock_id_for_branch_id(self.branch_id)
1834 reactor.spawnProcess(protocol, interpreter, command, env=env)
1835 return deferred
1836
1837
1838=== modified file 'lib/lp/codehosting/puller/tests/__init__.py'
1839--- lib/lp/codehosting/puller/tests/__init__.py 2012-06-28 09:50:36 +0000
1840+++ lib/lp/codehosting/puller/tests/__init__.py 2019-09-19 21:35:23 +0000
1841@@ -10,13 +10,13 @@
1842 import socket
1843 from StringIO import StringIO
1844
1845-from bzrlib.tests import TestCaseWithTransport
1846-from bzrlib.tests.http_server import (
1847+from breezy.tests import TestCaseWithTransport
1848+from breezy.tests.http_server import (
1849 HttpServer,
1850 TestingHTTPServer,
1851 TestingThreadingHTTPServer,
1852 )
1853-from bzrlib.url_policy_open import AcceptAnythingPolicy
1854+from breezy.url_policy_open import AcceptAnythingPolicy
1855
1856 from lp.codehosting.puller.worker import (
1857 BranchMirrorer,
1858
1859=== modified file 'lib/lp/codehosting/puller/tests/test_acceptance.py'
1860--- lib/lp/codehosting/puller/tests/test_acceptance.py 2017-12-19 17:22:23 +0000
1861+++ lib/lp/codehosting/puller/tests/test_acceptance.py 2019-09-19 21:35:23 +0000
1862@@ -13,15 +13,15 @@
1863 Popen,
1864 )
1865
1866-from bzrlib import errors
1867-from bzrlib.branch import Branch
1868-from bzrlib.bzrdir import BzrDir
1869-from bzrlib.upgrade import upgrade
1870-from bzrlib.urlutils import (
1871+from breezy import errors
1872+from breezy.branch import Branch
1873+from breezy.bzr.bzrdir import BzrDir
1874+from breezy.upgrade import upgrade
1875+from breezy.urlutils import (
1876 join as urljoin,
1877 local_path_from_url,
1878 )
1879-from bzrlib.workingtree import WorkingTree
1880+from breezy.workingtree import WorkingTree
1881 from fixtures import TempDir
1882 import transaction
1883 from zope.component import getUtility
1884@@ -284,7 +284,7 @@
1885 branch_url = urljoin(
1886 config.launchpad.bzr_imports_root_url, '%08x' % db_branch.id)
1887 branch = BzrDir.create_branch_convenience(branch_url)
1888- tree = branch.bzrdir.open_workingtree()
1889+ tree = branch.controldir.open_workingtree()
1890 tree.commit('rev1')
1891
1892 transaction.commit()
1893
1894=== modified file 'lib/lp/codehosting/puller/tests/test_errors.py'
1895--- lib/lp/codehosting/puller/tests/test_errors.py 2019-06-08 05:06:08 +0000
1896+++ lib/lp/codehosting/puller/tests/test_errors.py 2019-09-19 21:35:23 +0000
1897@@ -11,14 +11,14 @@
1898 import tempfile
1899 import urllib2
1900
1901-from bzrlib.errors import (
1902+from breezy.errors import (
1903 BzrError,
1904 NotBranchError,
1905 ParamikoNotPresent,
1906 UnknownFormatError,
1907 UnsupportedFormatError,
1908 )
1909-from bzrlib.url_policy_open import (
1910+from breezy.url_policy_open import (
1911 BranchLoopError,
1912 BranchReferenceForbidden,
1913 )
1914
1915=== modified file 'lib/lp/codehosting/puller/tests/test_scheduler.py'
1916--- lib/lp/codehosting/puller/tests/test_scheduler.py 2018-02-14 11:13:47 +0000
1917+++ lib/lp/codehosting/puller/tests/test_scheduler.py 2019-09-19 21:35:23 +0000
1918@@ -7,12 +7,10 @@
1919 import os
1920 import textwrap
1921
1922-from bzrlib.branch import Branch
1923-from bzrlib.bzrdir import (
1924- BzrDir,
1925- format_registry,
1926- )
1927-from bzrlib.urlutils import join as urljoin
1928+from breezy.branch import Branch
1929+from breezy.bzr.bzrdir import BzrDir
1930+from breezy.controldir import format_registry
1931+from breezy.urlutils import join as urljoin
1932 from testtools.twistedsupport import (
1933 assert_fails_with,
1934 AsynchronousDeferredRunTest,
1935@@ -545,7 +543,7 @@
1936 (options, arguments) = parser.parse_args()
1937 (source_url, destination_url, branch_id, unique_name,
1938 branch_type_name, default_stacked_on_url) = arguments
1939-from bzrlib import branch
1940+from breezy import branch
1941 branch = branch.Branch.open(destination_url)
1942 protocol = PullerWorkerProtocol(sys.stdout)
1943 """
1944@@ -865,7 +863,7 @@
1945 # We have to use a custom worker script to lower the time we wait for
1946 # the lock for (the default is five minutes, too long for a test!)
1947 lower_timeout_script = """
1948- from bzrlib import lockdir
1949+ from breezy import lockdir
1950 lockdir._DEFAULT_TIMEOUT_SECONDS = 2.0
1951 from lp.code.enums import BranchType
1952 from lp.codehosting.puller.worker import (
1953
1954=== modified file 'lib/lp/codehosting/puller/tests/test_worker.py'
1955--- lib/lp/codehosting/puller/tests/test_worker.py 2019-07-09 11:42:39 +0000
1956+++ lib/lp/codehosting/puller/tests/test_worker.py 2019-09-19 21:35:23 +0000
1957@@ -8,21 +8,21 @@
1958 import gc
1959 from StringIO import StringIO
1960
1961-import bzrlib.branch
1962-from bzrlib.branch import BranchReferenceFormat
1963-from bzrlib.bzrdir import BzrDir
1964-from bzrlib.errors import (
1965+import breezy.branch
1966+from breezy.bzr.branch import BranchReferenceFormat
1967+from breezy.bzr.bzrdir import BzrDir
1968+from breezy.errors import (
1969 IncompatibleRepositories,
1970 NotBranchError,
1971 NotStacked,
1972 )
1973-from bzrlib.revision import NULL_REVISION
1974-from bzrlib.tests import (
1975+from breezy.revision import NULL_REVISION
1976+from breezy.tests import (
1977 TestCaseInTempDir,
1978 TestCaseWithTransport,
1979 )
1980-from bzrlib.transport import get_transport
1981-from bzrlib.url_policy_open import (
1982+from breezy.transport import get_transport
1983+from breezy.url_policy_open import (
1984 AcceptAnythingPolicy,
1985 BadUrl,
1986 BranchOpener,
1987@@ -124,7 +124,7 @@
1988 source_tree.branch.base, self.get_url('dest'))
1989 source_tree.commit('commit message')
1990 to_mirror.mirrorWithoutChecks()
1991- mirrored_branch = bzrlib.branch.Branch.open(to_mirror.dest)
1992+ mirrored_branch = breezy.branch.Branch.open(to_mirror.dest)
1993 self.assertEqual(
1994 source_tree.last_revision(), mirrored_branch.last_revision())
1995
1996@@ -134,7 +134,7 @@
1997 to_mirror = self.makePullerWorker(
1998 source_branch.base, self.get_url('dest'))
1999 to_mirror.mirrorWithoutChecks()
2000- mirrored_branch = bzrlib.branch.Branch.open(to_mirror.dest)
2001+ mirrored_branch = breezy.branch.Branch.open(to_mirror.dest)
2002 self.assertEqual(NULL_REVISION, mirrored_branch.last_revision())
2003
2004 def testCanMirrorWhenDestDirExists(self):
2005@@ -150,9 +150,9 @@
2006 dest.mkdir('.bzr')
2007 # 'dest' is not a branch.
2008 self.assertRaises(
2009- NotBranchError, bzrlib.branch.Branch.open, to_mirror.dest)
2010+ NotBranchError, breezy.branch.Branch.open, to_mirror.dest)
2011 to_mirror.mirrorWithoutChecks()
2012- mirrored_branch = bzrlib.branch.Branch.open(to_mirror.dest)
2013+ mirrored_branch = breezy.branch.Branch.open(to_mirror.dest)
2014 self.assertEqual(
2015 source_tree.last_revision(), mirrored_branch.last_revision())
2016
2017@@ -179,7 +179,7 @@
2018 source_branch.base, self.get_url('destdir'),
2019 policy=PrearrangedStackedBranchPolicy(stack_on.base))
2020 to_mirror.mirrorWithoutChecks()
2021- dest = bzrlib.branch.Branch.open(self.get_url('destdir'))
2022+ dest = breezy.branch.Branch.open(self.get_url('destdir'))
2023 self.assertFalse(dest._format.supports_stacking())
2024
2025 def test_defaultStackedOnBranchIncompatibleMirrorsOK(self):
2026@@ -192,7 +192,7 @@
2027 source_branch.base, self.get_url('destdir'),
2028 policy=PrearrangedStackedBranchPolicy(stack_on.base))
2029 to_mirror.mirrorWithoutChecks()
2030- dest = bzrlib.branch.Branch.open(self.get_url('destdir'))
2031+ dest = breezy.branch.Branch.open(self.get_url('destdir'))
2032 self.assertRaises(NotStacked, dest.get_stacked_on_url)
2033
2034 def testCanMirrorWithIncompatibleRepos(self):
2035@@ -212,7 +212,7 @@
2036 # IncompatibleRepositories.
2037 self.assertRaises(
2038 IncompatibleRepositories,
2039- bzrlib.branch.Branch.open, 'dest/stacked')
2040+ breezy.branch.Branch.open, 'dest/stacked')
2041 source_branch = self.make_branch(
2042 'source-branch', format='2a')
2043 to_mirror = self.makePullerWorker(
2044@@ -220,7 +220,7 @@
2045 # The branch can be mirrored without errors and the destionation
2046 # location is upgraded to match the source format.
2047 to_mirror.mirrorWithoutChecks()
2048- mirrored_branch = bzrlib.branch.Branch.open(to_mirror.dest)
2049+ mirrored_branch = breezy.branch.Branch.open(to_mirror.dest)
2050 self.assertEqual(
2051 source_branch.repository._format,
2052 mirrored_branch.repository._format)
2053@@ -286,7 +286,7 @@
2054 :return: file url to the created pure branch reference.
2055 """
2056 # XXX DavidAllouche 2007-09-12 bug=139109:
2057- # We do this manually because the bzrlib API does not support creating
2058+ # We do this manually because the breezy API does not support creating
2059 # a branch reference without opening it.
2060 t = get_transport(self.get_url('.'))
2061 t.mkdir('reference')
2062@@ -314,7 +314,7 @@
2063
2064 # Open the branch reference and check that the result is indeed the
2065 # branch we wanted it to point at.
2066- opened_branch = bzrlib.branch.Branch.open(reference_url)
2067+ opened_branch = breezy.branch.Branch.open(reference_url)
2068 self.assertEqual(opened_branch.base, target_branch.base)
2069
2070 def testFollowReferenceValue(self):
2071@@ -496,9 +496,9 @@
2072 def setUp(self):
2073 super(TestWorkerProgressReporting, self).setUp()
2074 BranchOpener.install_hook()
2075- self.saved_factory = bzrlib.ui.ui_factory
2076+ self.saved_factory = breezy.ui.ui_factory
2077 self.disable_directory_isolation()
2078- self.addCleanup(setattr, bzrlib.ui, 'ui_factory', self.saved_factory)
2079+ self.addCleanup(setattr, breezy.ui, 'ui_factory', self.saved_factory)
2080
2081 def getHttpServerForCwd(self):
2082 """Get an `HttpServer` instance that serves from '.'."""
2083@@ -530,7 +530,7 @@
2084
2085 p = self.StubProtocol()
2086 install_worker_ui_factory(p)
2087- b2_http = bzrlib.branch.Branch.open(
2088+ b2_http = breezy.branch.Branch.open(
2089 http_server.get_url() + 'some-other-branch')
2090 b1.pull(b2_http)
2091 self.assertSubset([WORKER_ACTIVITY_NETWORK], p.calls)
2092
2093=== modified file 'lib/lp/codehosting/puller/tests/test_worker_formats.py'
2094--- lib/lp/codehosting/puller/tests/test_worker_formats.py 2019-06-08 05:06:08 +0000
2095+++ lib/lp/codehosting/puller/tests/test_worker_formats.py 2019-09-19 21:35:23 +0000
2096@@ -5,19 +5,19 @@
2097
2098 __metaclass__ = type
2099
2100-from bzrlib.branch import Branch
2101-from bzrlib.bzrdir import BzrDirMetaFormat1
2102-from bzrlib.plugins.weave_fmt.bzrdir import BzrDirFormat6
2103-from bzrlib.plugins.weave_fmt.repository import (
2104+from breezy.branch import Branch
2105+from breezy.bzr.bzrdir import BzrDirMetaFormat1
2106+from breezy.bzr.knitpack_repo import RepositoryFormatKnitPack5
2107+from breezy.bzr.knitrepo import RepositoryFormatKnit1
2108+from breezy.plugins.weave_fmt.bzrdir import BzrDirFormat6
2109+from breezy.plugins.weave_fmt.repository import (
2110 RepositoryFormat6,
2111 RepositoryFormat7,
2112 )
2113-from bzrlib.repofmt.knitpack_repo import RepositoryFormatKnitPack5
2114-from bzrlib.repofmt.knitrepo import RepositoryFormatKnit1
2115-from bzrlib.tests.per_repository import TestCaseWithRepository
2116-from bzrlib.url_policy_open import BranchOpener
2117+from breezy.tests.per_repository import TestCaseWithRepository
2118+from breezy.url_policy_open import BranchOpener
2119
2120-import lp.codehosting # For bzr plugins.
2121+import lp.codehosting # For brz plugins.
2122 from lp.codehosting.puller.tests import PullerWorkerMixin
2123 from lp.codehosting.tests.helpers import LoomTestMixin
2124
2125@@ -27,7 +27,7 @@
2126
2127 def setUp(self):
2128 TestCaseWithRepository.setUp(self)
2129- # make_bzrdir relies on this being a relative filesystem path.
2130+ # make_controldir relies on this being a relative filesystem path.
2131 self._source_branch_path = 'source-branch'
2132 BranchOpener.install_hook()
2133 self.worker = self.makePullerWorker(
2134@@ -39,7 +39,8 @@
2135 """Make a source branch with the given formats."""
2136 if branch_format is not None:
2137 bzrdir_format.set_branch_format(branch_format)
2138- bd = self.make_bzrdir(self._source_branch_path, format=bzrdir_format)
2139+ bd = self.make_controldir(
2140+ self._source_branch_path, format=bzrdir_format)
2141 repository_format.initialize(bd)
2142 branch = bd.create_branch()
2143 tree = branch.create_checkout('source-checkout')
2144@@ -58,8 +59,8 @@
2145 source_branch.repository._format.get_format_description(),
2146 dest_branch.repository._format.get_format_description())
2147 self.assertEqual(
2148- source_branch.bzrdir._format.get_format_description(),
2149- dest_branch.bzrdir._format.get_format_description())
2150+ source_branch.controldir._format.get_format_description(),
2151+ dest_branch.controldir._format.get_format_description())
2152
2153 def _testMirrorWithFormats(self, repository_format, bzrdir_format):
2154 """Make a branch with certain formats, mirror it and check the mirror.
2155@@ -85,9 +86,8 @@
2156 self.assertMirrored(branch, mirrored_branch)
2157
2158 # XXX: JonathanLange 2008-06-25: These next three tests should be
2159- # implemented against all supported repository formats using bzrlib's test
2160- # adaptation APIs. Unfortunately, this API changes between 1.5 and 1.6, so
2161- # it'd be a bit silly to do the work now.
2162+ # implemented against all supported repository formats using breezy's test
2163+ # adaptation APIs.
2164 def testMirrorKnitAsKnit(self):
2165 # Create a source branch in knit format, and check that the mirror is
2166 # in knit format.
2167
2168=== modified file 'lib/lp/codehosting/puller/worker.py'
2169--- lib/lp/codehosting/puller/worker.py 2019-07-25 15:00:18 +0000
2170+++ lib/lp/codehosting/puller/worker.py 2019-09-19 21:35:23 +0000
2171@@ -12,22 +12,25 @@
2172 # line below this comment.
2173 import lp.codehosting
2174
2175-from bzrlib import (
2176+from breezy import (
2177 errors,
2178 urlutils,
2179 )
2180-from bzrlib.branch import Branch
2181-from bzrlib.plugins.loom.branch import LoomSupport
2182-from bzrlib.plugins.weave_fmt.branch import BzrBranchFormat4
2183-from bzrlib.plugins.weave_fmt.repository import (
2184+from breezy.branch import (
2185+ Branch,
2186+ UnstackableBranchFormat,
2187+ )
2188+from breezy.plugins.loom.branch import LoomSupport
2189+from breezy.plugins.weave_fmt.branch import BzrBranchFormat4
2190+from breezy.plugins.weave_fmt.repository import (
2191 RepositoryFormat4,
2192 RepositoryFormat5,
2193 RepositoryFormat6,
2194 )
2195-from bzrlib.transport import get_transport
2196-import bzrlib.ui
2197-from bzrlib.ui import SilentUIFactory
2198-from bzrlib.url_policy_open import (
2199+from breezy.transport import get_transport
2200+import breezy.ui
2201+from breezy.ui import SilentUIFactory
2202+from breezy.url_policy_open import (
2203 BadUrl,
2204 BranchLoopError,
2205 BranchOpener,
2206@@ -158,7 +161,7 @@
2207 revision_id = None
2208 else:
2209 revision_id = 'null:'
2210- source_branch.bzrdir.clone_on_transport(
2211+ source_branch.controldir.clone_on_transport(
2212 dest_transport, revision_id=revision_id)
2213 return Branch.open(destination_url)
2214
2215@@ -251,7 +254,7 @@
2216 try:
2217 dest_branch.set_stacked_on_url(stacked_on_url)
2218 except (errors.UnstackableRepositoryFormat,
2219- errors.UnstackableBranchFormat,
2220+ UnstackableBranchFormat,
2221 errors.IncompatibleRepositories):
2222 stacked_on_url = None
2223 if stacked_on_url is None:
2224@@ -448,7 +451,7 @@
2225 # XXX: Aaron Bentley 2008-06-13
2226 # Bazaar does not provide a public API for learning about
2227 # format markers. Fix this in Bazaar, then here.
2228- control_string = dest_branch.bzrdir._format.get_format_string()
2229+ control_string = dest_branch.controldir._format.get_format_string()
2230 if dest_branch._format.__class__ is BzrBranchFormat4:
2231 branch_string = BranchFormat.BZR_BRANCH_4.title
2232 else:
2233@@ -488,8 +491,10 @@
2234 def confirm_action(self, prompt, confirmation_id, args):
2235 """If we're asked to break a lock like a stale lock of ours, say yes.
2236 """
2237- assert confirmation_id == 'bzrlib.lockdir.break', \
2238- "Didn't expect confirmation id %r" % (confirmation_id,)
2239+ if confirmation_id not in (
2240+ 'bzrlib.lockdir.break', 'breezy.lockdir.break'):
2241+ raise AssertionError(
2242+ "Didn't expect confirmation id %r" % (confirmation_id,))
2243 branch_id = self.puller_worker_protocol.branch_id
2244 prompt = prompt % args
2245 if get_lock_id_for_branch_id(branch_id) in prompt:
2246@@ -518,7 +523,7 @@
2247 2) Break locks if and only if they appear to be stale locks
2248 created by another puller worker process.
2249 """
2250- bzrlib.ui.ui_factory = PullerWorkerUIFactory(puller_worker_protocol)
2251+ breezy.ui.ui_factory = PullerWorkerUIFactory(puller_worker_protocol)
2252
2253
2254 class MirroredBranchPolicy(BranchMirrorerPolicy):
2255@@ -600,7 +605,7 @@
2256 Because we control the process that creates import branches, a
2257 vfs-level copy is safe and more efficient than a bzr fetch.
2258 """
2259- source_transport = source_branch.bzrdir.root_transport
2260+ source_transport = source_branch.controldir.root_transport
2261 dest_transport = get_transport(destination_url)
2262 while True:
2263 # We loop until the remote file list before and after the copy is
2264
2265=== modified file 'lib/lp/codehosting/rewrite.py'
2266--- lib/lp/codehosting/rewrite.py 2012-07-03 17:52:05 +0000
2267+++ lib/lp/codehosting/rewrite.py 2019-09-19 21:35:23 +0000
2268@@ -6,7 +6,7 @@
2269
2270 import time
2271
2272-from bzrlib import urlutils
2273+from breezy import urlutils
2274 from zope.component import getUtility
2275 from zope.security.interfaces import Unauthorized
2276
2277
2278=== modified file 'lib/lp/codehosting/scanner/buglinks.py'
2279--- lib/lp/codehosting/scanner/buglinks.py 2012-02-09 16:13:00 +0000
2280+++ lib/lp/codehosting/scanner/buglinks.py 2019-09-19 21:35:23 +0000
2281@@ -10,7 +10,7 @@
2282
2283 import urlparse
2284
2285-from bzrlib.errors import InvalidBugStatus
2286+from breezy.bugtracker import InvalidBugStatus
2287 from zope.component import getUtility
2288
2289 from lp.app.errors import NotFoundError
2290
2291=== modified file 'lib/lp/codehosting/scanner/bzrsync.py'
2292--- lib/lp/codehosting/scanner/bzrsync.py 2018-04-17 09:41:46 +0000
2293+++ lib/lp/codehosting/scanner/bzrsync.py 2019-09-19 21:35:23 +0000
2294@@ -16,8 +16,8 @@
2295
2296 import logging
2297
2298-from bzrlib.graph import DictParentsProvider
2299-from bzrlib.revision import NULL_REVISION
2300+from breezy.graph import DictParentsProvider
2301+from breezy.revision import NULL_REVISION
2302 import pytz
2303 import six
2304 from storm.locals import Store
2305@@ -91,7 +91,7 @@
2306 self.logger.info(" from %s", bzr_branch.base)
2307 # Get the history and ancestry from the branch first, to fail early
2308 # if something is wrong with the branch.
2309- self.logger.info("Retrieving history from bzrlib.")
2310+ self.logger.info("Retrieving history from breezy.")
2311 bzr_history = branch_revision_history(bzr_branch)
2312 # The BranchRevision, Revision and RevisionParent tables are only
2313 # written to by the branch-scanner, so they are not subject to
2314@@ -197,7 +197,7 @@
2315
2316 def planDatabaseChanges(self, bzr_branch, bzr_history, db_ancestry,
2317 db_history):
2318- """Plan database changes to synchronize with bzrlib data.
2319+ """Plan database changes to synchronize with breezy data.
2320
2321 Use the data retrieved by `retrieveDatabaseAncestry` and
2322 `retrieveBranchDetails` to plan the changes to apply to the database.
2323@@ -240,7 +240,7 @@
2324 def getBazaarRevisions(self, bzr_branch, revisions):
2325 """Like ``get_revisions(revisions)`` but filter out ghosts first.
2326
2327- :param revisions: the set of Bazaar revision IDs to return bzrlib
2328+ :param revisions: the set of Breezy revision IDs to return breezy
2329 Revision objects for.
2330 """
2331 revisions = bzr_branch.repository.get_parent_map(revisions)
2332@@ -249,9 +249,9 @@
2333 def syncRevisions(self, bzr_branch, bzr_revisions, revids_to_insert):
2334 """Import the supplied revisions.
2335
2336- :param bzr_branch: The Bazaar branch that's being scanned.
2337+ :param bzr_branch: The Breezy branch that's being scanned.
2338 :param bzr_revisions: the revisions to import
2339- :type bzr_revision: bzrlib.revision.Revision
2340+ :type bzr_revision: breezy.revision.Revision
2341 :param revids_to_insert: a dict of revision ids to integer
2342 revno. Non-mainline revisions will be mapped to None.
2343 """
2344
2345=== modified file 'lib/lp/codehosting/scanner/mergedetection.py'
2346--- lib/lp/codehosting/scanner/mergedetection.py 2018-10-21 17:32:46 +0000
2347+++ lib/lp/codehosting/scanner/mergedetection.py 2019-09-19 21:35:23 +0000
2348@@ -9,7 +9,7 @@
2349 'auto_merge_proposals',
2350 ]
2351
2352-from bzrlib.revision import NULL_REVISION
2353+from breezy.revision import NULL_REVISION
2354 from zope.component import getUtility
2355
2356 from lp.code.adapters.branch import BranchMergeProposalNoPreviewDiffDelta
2357
2358=== modified file 'lib/lp/codehosting/scanner/tests/test_buglinks.py'
2359--- lib/lp/codehosting/scanner/tests/test_buglinks.py 2019-05-22 14:57:45 +0000
2360+++ lib/lp/codehosting/scanner/tests/test_buglinks.py 2019-09-19 21:35:23 +0000
2361@@ -1,11 +1,11 @@
2362 # Copyright 2009 Canonical Ltd. This software is licensed under the
2363 # GNU Affero General Public License version 3 (see the file LICENSE).
2364
2365-"""Tests for creating BugBranch items based on Bazaar revisions."""
2366+"""Tests for creating BugBranch items based on Breezy revisions."""
2367
2368 __metaclass__ = type
2369
2370-from bzrlib.revision import Revision
2371+from breezy.revision import Revision
2372 from zope.component import getUtility
2373 from zope.event import notify
2374
2375@@ -192,7 +192,7 @@
2376 author = self.factory.getUniqueString()
2377 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
2378 # required to generate the revision-id.
2379- with override_environ(BZR_EMAIL='me@example.com'):
2380+ with override_environ(BRZ_EMAIL='me@example.com'):
2381 self.bzr_tree.commit(
2382 u'common parent', committer=author, rev_id='r1',
2383 allow_pointless=True)
2384@@ -253,7 +253,7 @@
2385 switch_dbuser("branchscanner")
2386 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
2387 # required to generate the revision-id.
2388- with override_environ(BZR_EMAIL='me@example.com'):
2389+ with override_environ(BRZ_EMAIL='me@example.com'):
2390 revision_id = tree.commit('fix revision',
2391 revprops={
2392 'bugs': 'https://launchpad.net/bugs/%d fixed' % bug.id})
2393
2394=== modified file 'lib/lp/codehosting/scanner/tests/test_bzrsync.py'
2395--- lib/lp/codehosting/scanner/tests/test_bzrsync.py 2019-07-09 12:32:22 +0000
2396+++ lib/lp/codehosting/scanner/tests/test_bzrsync.py 2019-09-19 21:35:23 +0000
2397@@ -8,13 +8,13 @@
2398 import random
2399 import time
2400
2401-from bzrlib.revision import (
2402+from breezy.revision import (
2403 NULL_REVISION,
2404 Revision as BzrRevision,
2405 )
2406-from bzrlib.tests import TestCaseWithTransport
2407-from bzrlib.uncommit import uncommit
2408-from bzrlib.url_policy_open import BranchOpener
2409+from breezy.tests import TestCaseWithTransport
2410+from breezy.uncommit import uncommit
2411+from breezy.url_policy_open import BranchOpener
2412 from fixtures import (
2413 FakeLogger,
2414 TempDir,
2415@@ -191,7 +191,7 @@
2416 self.bzr_tree.add_pending_merge(*extra_parents)
2417 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
2418 # required to generate the revision-id.
2419- with override_environ(BZR_EMAIL='me@example.com'):
2420+ with override_environ(BRZ_EMAIL='me@example.com'):
2421 return self.bzr_tree.commit(
2422 message, committer=committer, rev_id=rev_id,
2423 timestamp=timestamp, timezone=timezone, allow_pointless=True,
2424@@ -240,7 +240,7 @@
2425 db_branch=db_branch)
2426 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
2427 # required to generate the revision-id.
2428- with override_environ(BZR_EMAIL='me@example.com'):
2429+ with override_environ(BRZ_EMAIL='me@example.com'):
2430 trunk_tree.commit(u'base revision', rev_id=base_rev_id)
2431
2432 # Branch from the base revision.
2433@@ -572,7 +572,8 @@
2434 # deletion anyway.
2435 rev1_id = self.bzr_tree.commit(
2436 'initial commit', committer='me@example.org')
2437- merge_tree = self.bzr_tree.bzrdir.sprout('merge').open_workingtree()
2438+ merge_tree = self.bzr_tree.controldir.sprout(
2439+ 'merge').open_workingtree()
2440 merge_id = merge_tree.commit(
2441 'mergeable commit', committer='me@example.org')
2442 self.bzr_tree.merge_from_branch(merge_tree.branch)
2443
2444=== modified file 'lib/lp/codehosting/scanner/tests/test_email.py'
2445--- lib/lp/codehosting/scanner/tests/test_email.py 2018-01-02 10:54:31 +0000
2446+++ lib/lp/codehosting/scanner/tests/test_email.py 2019-09-19 21:35:23 +0000
2447@@ -8,7 +8,7 @@
2448 import email
2449 import os
2450
2451-from bzrlib.uncommit import uncommit
2452+from breezy.uncommit import uncommit
2453 from zope.component import getUtility
2454 from zope.event import notify
2455
2456
2457=== modified file 'lib/lp/codehosting/scanner/tests/test_mergedetection.py'
2458--- lib/lp/codehosting/scanner/tests/test_mergedetection.py 2018-04-10 21:41:45 +0000
2459+++ lib/lp/codehosting/scanner/tests/test_mergedetection.py 2019-09-19 21:35:23 +0000
2460@@ -7,7 +7,7 @@
2461
2462 import logging
2463
2464-from bzrlib.revision import NULL_REVISION
2465+from breezy.revision import NULL_REVISION
2466 from lazr.lifecycle.event import ObjectModifiedEvent
2467 import transaction
2468 from zope.component import getUtility
2469@@ -143,7 +143,7 @@
2470
2471 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
2472 # required to generate the revision-id.
2473- with override_environ(BZR_EMAIL='me@example.com'):
2474+ with override_environ(BRZ_EMAIL='me@example.com'):
2475 branch_tree.commit(u'another revision', rev_id='another-rev')
2476 current_proposal_status = proposal.queue_status
2477 self.assertNotEqual(
2478@@ -164,7 +164,7 @@
2479
2480 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
2481 # required to generate the revision-id.
2482- with override_environ(BZR_EMAIL='me@example.com'):
2483+ with override_environ(BRZ_EMAIL='me@example.com'):
2484 branch_tree.commit(u'another revision', rev_id='another-rev')
2485 current_proposal_status = proposal.queue_status
2486 self.assertNotEqual(
2487
2488=== modified file 'lib/lp/codehosting/scripts/tests/test_upgrade_all_branches.py'
2489--- lib/lp/codehosting/scripts/tests/test_upgrade_all_branches.py 2012-03-26 22:45:24 +0000
2490+++ lib/lp/codehosting/scripts/tests/test_upgrade_all_branches.py 2019-09-19 21:35:23 +0000
2491@@ -8,7 +8,7 @@
2492 import os
2493 from os.path import dirname
2494
2495-from bzrlib.repofmt.groupcompress_repo import RepositoryFormat2a
2496+from breezy.bzr.groupcompress_repo import RepositoryFormat2a
2497 from fixtures import TempDir
2498 import transaction
2499
2500
2501=== modified file 'lib/lp/codehosting/sftp.py'
2502--- lib/lp/codehosting/sftp.py 2015-10-19 10:56:16 +0000
2503+++ lib/lp/codehosting/sftp.py 2019-09-19 21:35:23 +0000
2504@@ -24,12 +24,12 @@
2505 import os
2506 import stat
2507
2508-from bzrlib import (
2509+from breezy import (
2510 errors as bzr_errors,
2511 osutils,
2512 urlutils,
2513 )
2514-from bzrlib.transport.local import LocalTransport
2515+from breezy.transport.local import LocalTransport
2516 from lazr.sshserver.sftp import FileIsADirectory
2517 from twisted.conch.interfaces import (
2518 ISFTPFile,
2519@@ -160,7 +160,7 @@
2520 def _truncateFile(self):
2521 """Truncate this file."""
2522 self._written = True
2523- return self.transport.put_bytes(self._escaped_path, '')
2524+ return self.transport.put_bytes(self._escaped_path, b'')
2525
2526 @with_sftp_error
2527 def writeChunk(self, offset, data):
2528@@ -198,7 +198,7 @@
2529
2530 Doing things this way around, by trying to read all the data
2531 requested and then handling the short read error, might be a bit
2532- inefficient, but the bzrlib sftp transport doesn't read past the
2533+ inefficient, but the breezy sftp transport doesn't read past the
2534 end of files, so we don't need to worry too much about performance
2535 here.
2536 """
2537
2538=== modified file 'lib/lp/codehosting/sshserver/session.py'
2539--- lib/lp/codehosting/sshserver/session.py 2016-12-22 16:32:38 +0000
2540+++ lib/lp/codehosting/sshserver/session.py 2019-09-19 21:35:23 +0000
2541@@ -26,7 +26,7 @@
2542 from zope.event import notify
2543 from zope.interface import implementer
2544
2545-from lp.codehosting import get_bzr_path
2546+from lp.codehosting import get_brz_path
2547 from lp.services.config import config
2548
2549
2550@@ -141,16 +141,17 @@
2551
2552 :return: The pid, communication directory, and request socket.
2553 """
2554- assert executable == 'bzr', executable # Maybe .endswith()
2555- assert args[0] == 'bzr', args[0]
2556+ assert executable == 'brz', executable # Maybe .endswith()
2557+ assert args[0] == 'brz', args[0]
2558 message = ['fork-env %s\n' % (' '.join(args[1:]),)]
2559 for key, value in environment.iteritems():
2560- # XXX: Currently we only pass BZR_EMAIL, should we be passing
2561+ # XXX: Currently we only pass BRZ_EMAIL, should we be passing
2562 # everything else? Note that many won't be handled properly,
2563 # since the process is already running.
2564- if key != 'BZR_EMAIL':
2565- continue
2566- message.append('%s: %s\n' % (key, value))
2567+ if key in ('BZR_EMAIL', 'BRZ_EMAIL'):
2568+ # Map both of these to BRZ_EMAIL, since we run brz on the
2569+ # server.
2570+ message.append('BRZ_EMAIL: %s\n' % (value,))
2571 message.append('end\n')
2572 message = ''.join(message)
2573 response, sock = self._sendMessageToService(message)
2574@@ -418,7 +419,7 @@
2575 def _simplifyEnvironment(self, env):
2576 """Pull out the bits of the environment we want to pass along."""
2577 env = {}
2578- for env_var in ['BZR_EMAIL']:
2579+ for env_var in ['BRZ_EMAIL']:
2580 if env_var in self.environment:
2581 env[env_var] = self.environment[env_var]
2582 return env
2583@@ -426,15 +427,15 @@
2584 def getCommandToFork(self, executable, arguments, env):
2585 assert executable.endswith('/bin/py')
2586 assert arguments[0] == executable
2587- assert arguments[1].endswith('/bzr')
2588- executable = 'bzr'
2589+ assert arguments[1].endswith('/brz')
2590+ executable = 'brz'
2591 arguments = arguments[1:]
2592- arguments[0] = 'bzr'
2593+ arguments[0] = 'brz'
2594 env = self._simplifyEnvironment(env)
2595 return executable, arguments, env
2596
2597 def _spawn(self, protocol, executable, arguments, env):
2598- # When spawning, adapt the idea of "bin/py .../bzr" to just using "bzr"
2599+ # When spawning, adapt the idea of "bin/py .../brz" to just using "brz"
2600 # and the executable
2601 executable, arguments, env = self.getCommandToFork(executable,
2602 arguments, env)
2603@@ -449,16 +450,18 @@
2604 :return: Command template
2605 :raise ForbiddenCommand: Raised when command isn't allowed
2606 """
2607- python_command = "%(root)s/bin/py %(bzr)s" % {
2608+ python_command = "%(root)s/bin/py %(brz)s" % {
2609 'root': config.root,
2610- 'bzr': get_bzr_path(),
2611+ 'brz': get_brz_path(),
2612 }
2613 args = " lp-serve --inet %(user_id)s"
2614 command_template = python_command + args
2615
2616- if command == 'bzr serve --inet --directory=/ --allow-writes':
2617+ if command in (
2618+ 'bzr serve --inet --directory=/ --allow-writes',
2619+ 'brz serve --inet --directory=/ --allow-writes'):
2620 return command_template
2621- # At the moment, only bzr branch serving is allowed.
2622+ # At the moment, only bzr/brz branch serving is allowed.
2623 raise ForbiddenCommand("Not allowed to execute %r." % (command,))
2624
2625
2626@@ -469,7 +472,7 @@
2627
2628 # Extract the hostname from the supermirror root config.
2629 hostname = urlparse.urlparse(config.codehosting.supermirror_root)[1]
2630- environment['BZR_EMAIL'] = '%s@%s' % (avatar.username, hostname)
2631+ environment['BRZ_EMAIL'] = '%s@%s' % (avatar.username, hostname)
2632 # TODO: Use a FeatureFlag to enable this in a more fine-grained approach.
2633 # If the forking daemon has been spawned, then we can use it if the
2634 # feature is set to true for the given user, etc.
2635
2636=== modified file 'lib/lp/codehosting/sshserver/tests/test_session.py'
2637--- lib/lp/codehosting/sshserver/tests/test_session.py 2019-05-22 14:57:45 +0000
2638+++ lib/lp/codehosting/sshserver/tests/test_session.py 2019-09-19 21:35:23 +0000
2639@@ -13,8 +13,8 @@
2640 from twisted.internet.protocol import ProcessProtocol
2641
2642 from lp.codehosting import (
2643- get_bzr_path,
2644- get_BZR_PLUGIN_PATH_for_subprocess,
2645+ get_brz_path,
2646+ get_BRZ_PLUGIN_PATH_for_subprocess,
2647 )
2648 from lp.codehosting.sshserver.daemon import CodehostingAvatar
2649 from lp.codehosting.sshserver.session import (
2650@@ -382,18 +382,18 @@
2651 "ISession(avatar) doesn't adapt to ExecOnlySession. "
2652 "Got %r instead." % (session,))
2653 self.assertEqual(
2654- get_BZR_PLUGIN_PATH_for_subprocess(),
2655- session.environment['BZR_PLUGIN_PATH'])
2656+ get_BRZ_PLUGIN_PATH_for_subprocess(),
2657+ session.environment['BRZ_PLUGIN_PATH'])
2658 self.assertEqual(
2659 '%s@bazaar.launchpad.test' % self.avatar.username,
2660- session.environment['BZR_EMAIL'])
2661+ session.environment['BRZ_EMAIL'])
2662
2663 executable, arguments = session.getCommandToRun(
2664 'bzr serve --inet --directory=/ --allow-writes')
2665 interpreter = '%s/bin/py' % config.root
2666 self.assertEqual(interpreter, executable)
2667 self.assertEqual(
2668- [interpreter, get_bzr_path(), 'lp-serve',
2669+ [interpreter, get_brz_path(), 'lp-serve',
2670 '--inet', str(self.avatar.user_id)],
2671 list(arguments))
2672 self.assertRaises(
2673@@ -422,9 +422,9 @@
2674 'bzr serve --inet --directory=/ --allow-writes')
2675 executable, arguments, env = session.getCommandToFork(
2676 executable, arguments, session.environment)
2677- self.assertEqual('bzr', executable)
2678+ self.assertEqual('brz', executable)
2679 self.assertEqual(
2680- ['bzr', 'lp-serve',
2681+ ['brz', 'lp-serve',
2682 '--inet', str(self.avatar.user_id)],
2683 list(arguments))
2684
2685@@ -436,7 +436,14 @@
2686
2687 def test_bzr(self):
2688 self.assertEqual(
2689- config.root + '/bin/py ' + get_bzr_path() +
2690+ config.root + '/bin/py ' + get_brz_path() +
2691 ' lp-serve --inet %(user_id)s',
2692 lookup_command_template(
2693 'bzr serve --inet --directory=/ --allow-writes'))
2694+
2695+ def test_brz(self):
2696+ self.assertEqual(
2697+ config.root + '/bin/py ' + get_brz_path() +
2698+ ' lp-serve --inet %(user_id)s',
2699+ lookup_command_template(
2700+ 'brz serve --inet --directory=/ --allow-writes'))
2701
2702=== modified file 'lib/lp/codehosting/tests/helpers.py'
2703--- lib/lp/codehosting/tests/helpers.py 2017-12-19 17:22:44 +0000
2704+++ lib/lp/codehosting/tests/helpers.py 2019-09-19 21:35:23 +0000
2705@@ -15,10 +15,9 @@
2706
2707 import os
2708
2709-from bzrlib.bzrdir import BzrDir
2710-from bzrlib.errors import FileExists
2711-from bzrlib.plugins.loom import branch as loom_branch
2712-from bzrlib.tests import (
2713+from breezy.errors import FileExists
2714+from breezy.plugins.loom import branch as loom_branch
2715+from breezy.tests import (
2716 TestNotApplicable,
2717 TestSkipped,
2718 )
2719@@ -60,7 +59,7 @@
2720 loom_branch.loomify(tree.branch)
2721 finally:
2722 tree.unlock()
2723- loom_tree = tree.bzrdir.open_workingtree()
2724+ loom_tree = tree.controldir.open_workingtree()
2725 loom_tree.lock_write()
2726 loom_tree.branch.new_thread('bottom-thread')
2727 loom_tree.commit('this is a commit', rev_id='commit-1')
2728@@ -78,7 +77,7 @@
2729 loom_branch.loomify(tree.branch)
2730 finally:
2731 tree.unlock()
2732- loom_tree = tree.bzrdir.open_workingtree()
2733+ loom_tree = tree.controldir.open_workingtree()
2734 loom_tree.lock_write()
2735 loom_tree.branch.new_thread('bottom-thread')
2736 loom_tree.commit('this is a commit', rev_id='commit-1')
2737@@ -100,6 +99,9 @@
2738
2739 def create_branch_with_one_revision(branch_dir, format=None):
2740 """Create a dummy Bazaar branch at the given directory."""
2741+ # XXX cjwatson 2019-06-13: This still uses bzrlib until such time as the
2742+ # code import workers are ported to Breezy.
2743+ from bzrlib.bzrdir import BzrDir
2744 if not os.path.exists(branch_dir):
2745 os.makedirs(branch_dir)
2746 try:
2747@@ -124,7 +126,7 @@
2748
2749
2750 class TestResultWrapper:
2751- """A wrapper for `TestResult` that knows about bzrlib's `TestSkipped`."""
2752+ """A wrapper for `TestResult` that knows about breezy's `TestSkipped`."""
2753
2754 def __init__(self, result):
2755 self.result = result
2756
2757=== modified file 'lib/lp/codehosting/tests/servers.py'
2758--- lib/lp/codehosting/tests/servers.py 2019-05-22 14:57:45 +0000
2759+++ lib/lp/codehosting/tests/servers.py 2019-09-19 21:35:23 +0000
2760@@ -15,7 +15,7 @@
2761 import shutil
2762 import tempfile
2763
2764-from bzrlib.transport import (
2765+from breezy.transport import (
2766 get_transport,
2767 Server,
2768 )
2769
2770=== modified file 'lib/lp/codehosting/tests/test_acceptance.py'
2771--- lib/lp/codehosting/tests/test_acceptance.py 2017-12-21 17:25:35 +0000
2772+++ lib/lp/codehosting/tests/test_acceptance.py 2019-09-19 21:35:23 +0000
2773@@ -14,11 +14,11 @@
2774 import urllib2
2775 import xmlrpclib
2776
2777-import bzrlib.branch
2778-from bzrlib.tests import TestCaseWithTransport
2779-from bzrlib.tests.per_repository import all_repository_format_scenarios
2780-from bzrlib.urlutils import local_path_from_url
2781-from bzrlib.workingtree import WorkingTree
2782+import breezy.branch
2783+from breezy.tests import TestCaseWithTransport
2784+from breezy.tests.per_repository import all_repository_format_scenarios
2785+from breezy.urlutils import local_path_from_url
2786+from breezy.workingtree import WorkingTree
2787 from testscenarios import (
2788 load_tests_apply_scenarios,
2789 WithScenarios,
2790@@ -37,8 +37,8 @@
2791 get_non_existant_source_package_branch_unique_name,
2792 )
2793 from lp.codehosting import (
2794- get_bzr_path,
2795- get_BZR_PLUGIN_PATH_for_subprocess,
2796+ get_brz_path,
2797+ get_BRZ_PLUGIN_PATH_for_subprocess,
2798 )
2799 from lp.codehosting.bzrutils import DenyingServer
2800 from lp.codehosting.tests.helpers import LoomTestMixin
2801@@ -64,10 +64,10 @@
2802 self.socket_path = None
2803
2804 def setUp(self):
2805- bzr_path = get_bzr_path()
2806- BZR_PLUGIN_PATH = get_BZR_PLUGIN_PATH_for_subprocess()
2807+ brz_path = get_brz_path()
2808+ BRZ_PLUGIN_PATH = get_BRZ_PLUGIN_PATH_for_subprocess()
2809 env = os.environ.copy()
2810- env['BZR_PLUGIN_PATH'] = BZR_PLUGIN_PATH
2811+ env['BRZ_PLUGIN_PATH'] = BRZ_PLUGIN_PATH
2812 # TODO: We probably want to use a random disk path for
2813 # forking_daemon_socket, but we need to update config so that
2814 # the CodeHosting service can find it.
2815@@ -77,7 +77,7 @@
2816 # settings, we have to somehow pass it a new config-on-disk to
2817 # use.
2818 self.socket_path = config.codehosting.forking_daemon_socket
2819- command = [sys.executable, bzr_path, 'launchpad-forking-service',
2820+ command = [sys.executable, brz_path, 'launchpad-forking-service',
2821 '--path', self.socket_path, '-Derror']
2822 process = subprocess.Popen(
2823 command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env)
2824@@ -110,12 +110,12 @@
2825 print process.stderr.read()
2826 print "-" * 70
2827 raise RuntimeError(
2828- 'Bzr server did not start correctly. See stdout and stderr '
2829- 'reported above. Command was "%s". PYTHONPATH was "%s". '
2830- 'BZR_PLUGIN_PATH was "%s".' %
2831+ 'Breezy server did not start correctly. See stdout and '
2832+ 'stderr reported above. Command was "%s". PYTHONPATH was '
2833+ '"%s". BRZ_PLUGIN_PATH was "%s".' %
2834 (' '.join(command),
2835 env.get('PYTHONPATH'),
2836- env.get('BZR_PLUGIN_PATH')))
2837+ env.get('BRZ_PLUGIN_PATH')))
2838
2839 def tearDown(self):
2840 # SIGTERM is the graceful exit request, potentially we could wait a
2841@@ -234,8 +234,8 @@
2842 """
2843 return self.run_bzr_subprocess(
2844 args, env_changes={
2845- 'BZR_SSH': 'paramiko',
2846- 'BZR_PLUGIN_PATH': get_BZR_PLUGIN_PATH_for_subprocess()
2847+ 'BRZ_SSH': 'paramiko',
2848+ 'BRZ_PLUGIN_PATH': get_BRZ_PLUGIN_PATH_for_subprocess()
2849 },
2850 allow_plugins=True, retcode=retcode)
2851
2852@@ -244,7 +244,7 @@
2853 """
2854 output, error = self._run_bzr(args, retcode=3)
2855 for line in error.splitlines():
2856- if line.startswith("bzr: ERROR"):
2857+ if line.startswith("brz: ERROR"):
2858 return line
2859 raise AssertionError(
2860 "Didn't find error line in output:\n\n%s\n" % error)
2861@@ -253,12 +253,12 @@
2862 """Branch from the given URL to a local directory."""
2863 self._run_bzr(['branch', remote_url, local_directory])
2864
2865- def get_bzr_path(self):
2866- """See `bzrlib.tests.TestCase.get_bzr_path`.
2867+ def get_brz_path(self):
2868+ """See `breezy.tests.TestCase.get_brz_path`.
2869
2870- We override this to return the 'bzr' executable from sourcecode.
2871+ We override this to return our own 'brz' executable.
2872 """
2873- return get_bzr_path()
2874+ return get_brz_path()
2875
2876 def push(self, local_directory, remote_url, extra_args=None):
2877 """Push the local branch to the given URL."""
2878@@ -271,19 +271,19 @@
2879 """Check that we cannot push from 'local_directory' to 'remote_url'.
2880
2881 In addition, if a list of messages is supplied as the error_messages
2882- argument, check that the bzr client printed one of these messages
2883- which shouldn't include the 'bzr: ERROR:' part of the message.
2884+ argument, check that the brz client printed one of these messages
2885+ which shouldn't include the 'brz: ERROR:' part of the message.
2886
2887 :return: The last line of the stderr from the subprocess, which will
2888- be the 'bzr: ERROR: <repr of Exception>' line.
2889+ be the 'brz: ERROR: <repr of Exception>' line.
2890 """
2891 error_line = self._run_bzr_error(
2892 ['push', '-d', local_directory, remote_url])
2893- # This will be the will be the 'bzr: ERROR: <repr of Exception>' line.
2894+ # This will be the 'brz: ERROR: <repr of Exception>' line.
2895 if not error_messages:
2896 return error_line
2897 for msg in error_messages:
2898- if error_line.startswith('bzr: ERROR: ' + msg):
2899+ if error_line.startswith('brz: ERROR: ' + msg):
2900 return error_line
2901 self.fail(
2902 "Error message %r didn't match any of those supplied."
2903@@ -340,11 +340,11 @@
2904 """Smoke test for repository support."""
2905
2906 excluded_scenarios = [
2907- # RepositoryFormat4 is not initializable (bzrlib raises TestSkipped
2908+ # RepositoryFormat4 is not initializable (breezy raises TestSkipped
2909 # when you try).
2910 'RepositoryFormat4',
2911 # Fetching weave formats from the smart server is known to be broken.
2912- # See bug 173807 and bzrlib.tests.test_repository.
2913+ # See bug 173807 and breezy.tests.test_repository.
2914 'RepositoryFormat5',
2915 'RepositoryFormat6',
2916 'RepositoryFormat7',
2917@@ -364,14 +364,14 @@
2918 self.second_tree = 'second'
2919
2920 def make_branch_specifying_repo_format(self, relpath, repo_format):
2921- bd = self.make_bzrdir(relpath, format=self.bzrdir_format)
2922+ bd = self.make_controldir(relpath, format=self.bzrdir_format)
2923 repo_format.initialize(bd)
2924 return bd.create_branch()
2925
2926 def make_branch_and_tree(self, relpath):
2927 b = self.make_branch_specifying_repo_format(
2928 relpath, self.repository_format)
2929- return b.bzrdir.create_workingtree()
2930+ return b.controldir.create_workingtree()
2931
2932 def test_smoke(self):
2933 # Make a new branch
2934@@ -411,7 +411,7 @@
2935 error_line = self._run_bzr_error(
2936 ['cat-revision', '-r', 'branch:' + url])
2937 self.assertTrue(
2938- error_line.startswith('bzr: ERROR: Not a branch:'),
2939+ error_line.startswith('brz: ERROR: Not a branch:'),
2940 'Expected "Not a branch", found %r' % error_line)
2941
2942 def makeDatabaseBranch(self, owner_name, product_name, branch_name,
2943@@ -693,7 +693,7 @@
2944 # We can get information from a read-only branch.
2945 ro_branch_url = self.createBazaarBranch(
2946 'mark', '+junk', 'ro-branch')
2947- revision = bzrlib.branch.Branch.open(ro_branch_url).last_revision()
2948+ revision = breezy.branch.Branch.open(ro_branch_url).last_revision()
2949 remote_revision = self.getLastRevision(
2950 self.getTransportURL('~mark/+junk/ro-branch'))
2951 self.assertEqual(revision, remote_revision)
2952@@ -715,7 +715,7 @@
2953 # Added to catch bug 126245.
2954 ro_branch_url = self.makeMirroredBranch(
2955 'testuser', 'firefox', 'mirror')
2956- revision = bzrlib.branch.Branch.open(ro_branch_url).last_revision()
2957+ revision = breezy.branch.Branch.open(ro_branch_url).last_revision()
2958 remote_revision = self.getLastRevision(
2959 self.getTransportURL('~testuser/firefox/mirror'))
2960 self.assertEqual(revision, remote_revision)
2961@@ -724,7 +724,7 @@
2962 # Users should be able to read mirrored branches even if they don't
2963 # own those branches.
2964 ro_branch_url = self.makeMirroredBranch('mark', 'firefox', 'mirror')
2965- revision = bzrlib.branch.Branch.open(ro_branch_url).last_revision()
2966+ revision = breezy.branch.Branch.open(ro_branch_url).last_revision()
2967 remote_revision = self.getLastRevision(
2968 self.getTransportURL('~mark/firefox/mirror'))
2969 self.assertEqual(revision, remote_revision)
2970
2971=== renamed file 'lib/lp/codehosting/tests/test_bzrlib.py' => 'lib/lp/codehosting/tests/test_breezy.py'
2972--- lib/lp/codehosting/tests/test_bzrlib.py 2014-01-30 15:04:06 +0000
2973+++ lib/lp/codehosting/tests/test_breezy.py 2019-09-19 21:35:23 +0000
2974@@ -1,17 +1,17 @@
2975 # Copyright 2009 Canonical Ltd. This software is licensed under the
2976 # GNU Affero General Public License version 3 (see the file LICENSE).
2977
2978-"""Launchpad specific tests of bzrlib behaviour."""
2979+"""Launchpad-specific tests of Breezy behaviour."""
2980
2981 __metaclass__ = type
2982
2983 from lp.testing import TestCase
2984
2985
2986-class TestBzrlib(TestCase):
2987+class TestBreezy(TestCase):
2988 def test_has_cextensions(self):
2989- """Ensure Bazaar C extensions are being used."""
2990+ """Ensure Breezy C extensions are being used."""
2991 try:
2992- import bzrlib._dirstate_helpers_pyx
2993+ import breezy.bzr._dirstate_helpers_pyx
2994 except ImportError:
2995- self.fail("Bzr not built with C extensions.")
2996+ self.fail("Breezy not built with C extensions.")
2997
2998=== modified file 'lib/lp/codehosting/tests/test_bzrutils.py'
2999--- lib/lp/codehosting/tests/test_bzrutils.py 2018-01-02 10:54:31 +0000
3000+++ lib/lp/codehosting/tests/test_bzrutils.py 2019-09-19 21:35:23 +0000
3001@@ -8,20 +8,23 @@
3002 import gc
3003 import sys
3004
3005-from bzrlib import (
3006+from breezy import (
3007 errors,
3008 trace,
3009 )
3010-from bzrlib.branch import Branch
3011-from bzrlib.bzrdir import format_registry
3012-from bzrlib.errors import AppendRevisionsOnlyViolation
3013-from bzrlib.remote import RemoteBranch
3014-from bzrlib.tests import (
3015+from breezy.branch import (
3016+ Branch,
3017+ UnstackableBranchFormat,
3018+ )
3019+from breezy.bzr.remote import RemoteBranch
3020+from breezy.controldir import format_registry
3021+from breezy.errors import AppendRevisionsOnlyViolation
3022+from breezy.tests import (
3023 test_server,
3024 TestCaseWithTransport,
3025 TestNotApplicable,
3026 )
3027-from bzrlib.tests.per_branch import (
3028+from breezy.tests.per_branch import (
3029 branch_scenarios,
3030 TestCaseWithControlDir,
3031 )
3032@@ -80,14 +83,14 @@
3033 stacked_branch = self.make_branch('stacked')
3034 try:
3035 stacked_branch.set_stacked_on_url('../stacked-on')
3036- except errors.UnstackableBranchFormat:
3037+ except UnstackableBranchFormat:
3038 raise TestNotApplicable('This format does not support stacking.')
3039 # Deleting the stacked-on branch ensures that Bazaar will raise an
3040 # error if it tries to open the stacked-on branch.
3041 self.get_transport('.').delete_tree('stacked-on')
3042 self.assertEqual(
3043 '../stacked-on',
3044- get_branch_stacked_on_url(stacked_branch.bzrdir))
3045+ get_branch_stacked_on_url(stacked_branch.controldir))
3046
3047 def testGetBranchStackedOnUrlUnstackable(self):
3048 # get_branch_stacked_on_url raises UnstackableBranchFormat if it's
3049@@ -97,11 +100,11 @@
3050 branch.get_stacked_on_url()
3051 except errors.NotStacked:
3052 raise TestNotApplicable('This format supports stacked branches.')
3053- except errors.UnstackableBranchFormat:
3054+ except UnstackableBranchFormat:
3055 pass
3056 self.assertRaises(
3057- errors.UnstackableBranchFormat,
3058- get_branch_stacked_on_url, branch.bzrdir)
3059+ UnstackableBranchFormat,
3060+ get_branch_stacked_on_url, branch.controldir)
3061
3062 def testGetBranchStackedOnUrlNotStacked(self):
3063 # get_branch_stacked_on_url raises NotStacked if it's called on the
3064@@ -111,16 +114,16 @@
3065 branch.get_stacked_on_url()
3066 except errors.NotStacked:
3067 pass
3068- except errors.UnstackableBranchFormat:
3069+ except UnstackableBranchFormat:
3070 raise TestNotApplicable(
3071 'This format does not support stacked branches')
3072 self.assertRaises(
3073- errors.NotStacked, get_branch_stacked_on_url, branch.bzrdir)
3074+ errors.NotStacked, get_branch_stacked_on_url, branch.controldir)
3075
3076 def testGetBranchStackedOnUrlNoBranch(self):
3077 # get_branch_stacked_on_url raises a NotBranchError if it's called on
3078 # a bzrdir that's not got a branch.
3079- a_bzrdir = self.make_bzrdir('source')
3080+ a_bzrdir = self.make_controldir('source')
3081 if a_bzrdir.has_branch():
3082 raise TestNotApplicable(
3083 'This format does not support branchless bzrdirs.')
3084
3085=== modified file 'lib/lp/codehosting/tests/test_format_comparison.py'
3086--- lib/lp/codehosting/tests/test_format_comparison.py 2018-01-02 10:54:31 +0000
3087+++ lib/lp/codehosting/tests/test_format_comparison.py 2019-09-19 21:35:23 +0000
3088@@ -45,7 +45,7 @@
3089 class StubBranch:
3090 """A stub branch object that just has formats."""
3091 def __init__(self, bzrdir_format, repo_format, branch_format):
3092- self.bzrdir = StubObjectWithFormat(bzrdir_format)
3093+ self.controldir = StubObjectWithFormat(bzrdir_format)
3094 self.repository = StubObjectWithFormat(repo_format)
3095 self._format = branch_format
3096
3097
3098=== modified file 'lib/lp/codehosting/tests/test_lpserve.py'
3099--- lib/lp/codehosting/tests/test_lpserve.py 2012-01-01 02:58:52 +0000
3100+++ lib/lp/codehosting/tests/test_lpserve.py 2019-09-19 21:35:23 +0000
3101@@ -5,10 +5,10 @@
3102
3103 __metaclass__ = type
3104
3105-from bzrlib import errors
3106-from bzrlib.plugins.lpserve.test_lpserve import TestCaseWithSubprocess
3107-from bzrlib.smart import medium
3108-from bzrlib.transport import remote
3109+from breezy import errors
3110+from breezy.bzr.smart import medium
3111+from breezy.plugins.lpserve.test_lpserve import TestCaseWithSubprocess
3112+from breezy.transport import remote
3113
3114 from lp.testing.fixture import CaptureOops
3115 from lp.testing.layers import LaunchpadLayer
3116@@ -112,8 +112,8 @@
3117
3118
3119 def test_suite():
3120- from bzrlib import tests
3121- from bzrlib.plugins import lpserve
3122+ from breezy import tests
3123+ from breezy.plugins import lpserve
3124
3125 loader = tests.TestLoader()
3126 suite = loader.loadTestsFromName(__name__)
3127
3128=== modified file 'lib/lp/codehosting/tests/test_sftp.py'
3129--- lib/lp/codehosting/tests/test_sftp.py 2017-12-19 17:22:44 +0000
3130+++ lib/lp/codehosting/tests/test_sftp.py 2019-09-19 21:35:23 +0000
3131@@ -6,13 +6,13 @@
3132 from contextlib import closing
3133 import os
3134
3135-from bzrlib import (
3136+from breezy import (
3137 errors as bzr_errors,
3138 urlutils,
3139 )
3140-from bzrlib.tests import TestCaseInTempDir
3141-from bzrlib.transport import get_transport
3142-from bzrlib.transport.memory import MemoryTransport
3143+from breezy.tests import TestCaseInTempDir
3144+from breezy.transport import get_transport
3145+from breezy.transport.memory import MemoryTransport
3146 from lazr.sshserver.sftp import FileIsADirectory
3147 from testtools.twistedsupport import (
3148 assert_fails_with,
3149@@ -70,7 +70,7 @@
3150 def test_writeChunk(self):
3151 # writeChunk writes a chunk of data to a file at a given offset.
3152 filename = 'foo'
3153- self.transport.put_bytes(filename, 'content')
3154+ self.transport.put_bytes(filename, b'content')
3155 self.transport.writeChunk(filename, 1, 'razy')
3156 self.assertEqual('crazynt', self.transport.get_bytes(filename))
3157
3158@@ -612,7 +612,7 @@
3159 def test_openDirectoryMemory(self):
3160 """openDirectory works on MemoryTransport."""
3161 transport = MemoryTransport()
3162- transport.put_bytes('hello', 'hello')
3163+ transport.put_bytes('hello', b'hello')
3164 sftp_server = TransportSFTPServer(AsyncTransport(transport))
3165 deferred = sftp_server.openDirectory('.')
3166
3167
3168=== modified file 'lib/lp/codehosting/tests/test_upgrade.py'
3169--- lib/lp/codehosting/tests/test_upgrade.py 2012-09-06 00:01:38 +0000
3170+++ lib/lp/codehosting/tests/test_upgrade.py 2019-09-19 21:35:23 +0000
3171@@ -7,18 +7,16 @@
3172 import logging
3173 from os.path import dirname
3174
3175-from bzrlib.branch import Branch
3176-from bzrlib.bzrdir import (
3177- BzrDir,
3178- format_registry,
3179- )
3180-from bzrlib.plugins.loom.branch import loomify
3181-from bzrlib.repofmt.groupcompress_repo import (
3182+from breezy.branch import Branch
3183+from breezy.bzr.bzrdir import BzrDir
3184+from breezy.bzr.groupcompress_repo import (
3185 RepositoryFormat2a,
3186 RepositoryFormat2aSubtree,
3187 )
3188-from bzrlib.revision import NULL_REVISION
3189-from bzrlib.transport import get_transport
3190+from breezy.controldir import format_registry
3191+from breezy.plugins.loom.branch import loomify
3192+from breezy.revision import NULL_REVISION
3193+from breezy.transport import get_transport
3194 from fixtures import TempDir
3195
3196 from lp.code.bzr import (
3197@@ -51,7 +49,7 @@
3198 'foo', rev_id='prepare-commit', committer='jrandom@example.com')
3199 if loomify_branch:
3200 loomify(tree.branch)
3201- bzr_branch = tree.bzrdir.open_branch()
3202+ bzr_branch = tree.controldir.open_branch()
3203 else:
3204 bzr_branch = tree.branch
3205 return self.getUpgrader(bzr_branch, branch)
3206@@ -76,8 +74,8 @@
3207 :param tree: A Bazaar WorkingTree to add a tree to.
3208 """
3209 sub_branch = BzrDir.create_branch_convenience(
3210- tree.bzrdir.root_transport.clone('sub').base)
3211- tree.add_reference(sub_branch.bzrdir.open_workingtree())
3212+ tree.controldir.root_transport.clone('sub').base)
3213+ tree.add_reference(sub_branch.controldir.open_workingtree())
3214 tree.commit('added tree reference', committer='jrandom@example.com')
3215
3216 def check_branch(self, upgraded, branch_format=BranchFormat.BZR_BRANCH_7,
3217@@ -128,7 +126,7 @@
3218 def test_subtree_format_repo_format(self):
3219 """Even subtree formats use 2a if they don't have tree references."""
3220 self.useBzrBranches(direct_database=True)
3221- format = format_registry.make_bzrdir('pack-0.92-subtree')
3222+ format = format_registry.make_controldir('pack-0.92-subtree')
3223 branch, tree = self.create_branch_and_tree(format=format)
3224 upgrader = self.getUpgrader(tree.branch, branch)
3225 with read_locked(upgrader.bzr_branch):
3226@@ -139,7 +137,7 @@
3227 def test_tree_reference_repo_format(self):
3228 """Repos with tree references get 2aSubtree."""
3229 self.useBzrBranches(direct_database=True)
3230- format = format_registry.make_bzrdir('pack-0.92-subtree')
3231+ format = format_registry.make_controldir('pack-0.92-subtree')
3232 branch, tree = self.create_branch_and_tree(format=format)
3233 upgrader = self.getUpgrader(tree.branch, branch)
3234 self.addTreeReference(tree)
3235@@ -186,7 +184,7 @@
3236 def test_has_tree_references(self):
3237 """Detects whether repo contains actual tree references."""
3238 self.useBzrBranches(direct_database=True)
3239- format = format_registry.make_bzrdir('pack-0.92-subtree')
3240+ format = format_registry.make_controldir('pack-0.92-subtree')
3241 branch, tree = self.create_branch_and_tree(format=format)
3242 upgrader = self.getUpgrader(tree.branch, branch)
3243 with read_locked(tree.branch.repository):
3244@@ -198,11 +196,11 @@
3245 def test_use_subtree_format_for_tree_references(self):
3246 """Subtree references cause RepositoryFormat2aSubtree to be used."""
3247 self.useBzrBranches(direct_database=True)
3248- format = format_registry.make_bzrdir('pack-0.92-subtree')
3249+ format = format_registry.make_controldir('pack-0.92-subtree')
3250 branch, tree = self.create_branch_and_tree(format=format)
3251 sub_branch = BzrDir.create_branch_convenience(
3252- tree.bzrdir.root_transport.clone('sub').base, format=format)
3253- tree.add_reference(sub_branch.bzrdir.open_workingtree())
3254+ tree.controldir.root_transport.clone('sub').base, format=format)
3255+ tree.add_reference(sub_branch.controldir.open_workingtree())
3256 tree.commit('added tree reference', committer='jrandom@example.org')
3257 upgrader = self.getUpgrader(tree.branch, branch)
3258 with read_locked(tree.branch):
3259
3260=== modified file 'lib/lp/codehosting/upgrade.py'
3261--- lib/lp/codehosting/upgrade.py 2019-06-13 08:53:02 +0000
3262+++ lib/lp/codehosting/upgrade.py 2019-09-19 21:35:23 +0000
3263@@ -18,18 +18,16 @@
3264 from shutil import rmtree
3265 from tempfile import mkdtemp
3266
3267-from bzrlib.bzrdir import (
3268- BzrDir,
3269- format_registry,
3270- )
3271-from bzrlib.errors import UpToDateFormat
3272-from bzrlib.plugins.loom import (
3273+from breezy.bzr.bzrdir import BzrDir
3274+from breezy.bzr.groupcompress_repo import RepositoryFormat2aSubtree
3275+from breezy.controldir import format_registry
3276+from breezy.errors import UpToDateFormat
3277+from breezy.plugins.loom import (
3278 NotALoom,
3279 require_loom_branch,
3280 )
3281-from bzrlib.repofmt.groupcompress_repo import RepositoryFormat2aSubtree
3282-from bzrlib.upgrade import upgrade
3283-from bzrlib.url_policy_open import (
3284+from breezy.upgrade import upgrade
3285+from breezy.url_policy_open import (
3286 BranchOpener,
3287 SingleSchemePolicy,
3288 )
3289@@ -75,7 +73,7 @@
3290 :param branch: The bzr branch to upgrade
3291 :return: A Metadir format instance.
3292 """
3293- format = format_registry.make_bzrdir('2a')
3294+ format = format_registry.make_controldir('2a')
3295 try:
3296 require_loom_branch(self.bzr_branch)
3297 except NotALoom:
3298@@ -205,5 +203,5 @@
3299 def mirror_branch(self, bzr_branch, target_bd):
3300 """Mirror the actual branch from a bzr_branch to a target bzrdir."""
3301 target = target_bd.get_branch_transport(bzr_branch._format)
3302- source = bzr_branch.bzrdir.get_branch_transport(bzr_branch._format)
3303+ source = bzr_branch.controldir.get_branch_transport(bzr_branch._format)
3304 source.copy_tree_to_transport(target)
3305
3306=== modified file 'lib/lp/codehosting/vfs/branchfs.py'
3307--- lib/lp/codehosting/vfs/branchfs.py 2019-05-22 14:57:45 +0000
3308+++ lib/lp/codehosting/vfs/branchfs.py 2019-09-19 21:35:23 +0000
3309@@ -29,7 +29,7 @@
3310 `ITransportDispatch` object.
3311
3312 We hook the `LaunchpadServer` into Bazaar by implementing a
3313-`AsyncVirtualTransport`, a `bzrlib.transport.Transport` that wraps all of its
3314+`AsyncVirtualTransport`, a `breezy.transport.Transport` that wraps all of its
3315 operations so that they are translated by an object that implements
3316 `translateVirtualPath`. See transport.py for more information.
3317
3318@@ -58,20 +58,18 @@
3319 import sys
3320 import xmlrpclib
3321
3322-from bzrlib import urlutils
3323-from bzrlib.bzrdir import (
3324- BzrDir,
3325- BzrDirFormat,
3326- )
3327-from bzrlib.config import TransportConfig
3328-from bzrlib.errors import (
3329+from breezy import urlutils
3330+from breezy.bzr.bzrdir import BzrDir
3331+from breezy.bzr.smart.request import jail_info
3332+from breezy.config import TransportConfig
3333+from breezy.controldir import ControlDirFormat
3334+from breezy.errors import (
3335 NoSuchFile,
3336 PermissionDenied,
3337 TransportNotPossible,
3338 )
3339-from bzrlib.smart.request import jail_info
3340-from bzrlib.transport import get_transport
3341-from bzrlib.transport.memory import MemoryServer
3342+from breezy.transport import get_transport
3343+from breezy.transport.memory import MemoryServer
3344 from lazr.uri import URI
3345 import six
3346 from twisted.internet import (
3347@@ -224,7 +222,7 @@
3348
3349 :return: A transport and a path on that transport that point to a
3350 place that matches the one described in transport_tuple.
3351- :rtype: (`bzrlib.transport.Transport`, str)
3352+ :rtype: (`breezy.transport.Transport`, str)
3353 """
3354
3355
3356@@ -333,7 +331,7 @@
3357 transport = get_transport(memory_server.get_url())
3358 if default_stack_on == '':
3359 return transport
3360- format = BzrDirFormat.get_default_format()
3361+ format = ControlDirFormat.get_default_format()
3362 bzrdir = format.initialize_on_transport(transport)
3363 bzrdir.get_config().set_default_stack_on(
3364 urlutils.unescape(default_stack_on))
3365
3366=== modified file 'lib/lp/codehosting/vfs/tests/test_branchfs.py'
3367--- lib/lp/codehosting/vfs/tests/test_branchfs.py 2019-05-22 14:57:45 +0000
3368+++ lib/lp/codehosting/vfs/tests/test_branchfs.py 2019-09-19 21:35:23 +0000
3369@@ -12,29 +12,27 @@
3370 import sys
3371 import xmlrpclib
3372
3373-from bzrlib import errors
3374-from bzrlib.bzrdir import (
3375- BzrDir,
3376- format_registry,
3377- )
3378-from bzrlib.tests import (
3379+from breezy import errors
3380+from breezy.bzr.bzrdir import BzrDir
3381+from breezy.controldir import format_registry
3382+from breezy.tests import (
3383 TestCase as BzrTestCase,
3384 TestCaseInTempDir,
3385 TestCaseWithTransport,
3386 )
3387-from bzrlib.transport import (
3388+from breezy.transport import (
3389 _get_protocol_handlers,
3390 get_transport,
3391 register_transport,
3392 Server,
3393 unregister_transport,
3394 )
3395-from bzrlib.transport.chroot import ChrootTransport
3396-from bzrlib.transport.memory import (
3397+from breezy.transport.chroot import ChrootTransport
3398+from breezy.transport.memory import (
3399 MemoryServer,
3400 MemoryTransport,
3401 )
3402-from bzrlib.urlutils import (
3403+from breezy.urlutils import (
3404 escape,
3405 local_path_to_url,
3406 )
3407@@ -142,7 +140,7 @@
3408 default_stack_on='/~foo/bar/baz')
3409 self.assertRaises(
3410 errors.TransportNotPossible,
3411- transport.put_bytes, '.bzr/control.conf', 'data')
3412+ transport.put_bytes, '.bzr/control.conf', b'data')
3413
3414 def test_control_conf_with_stacking(self):
3415 transport = self.factory._makeControlTransport(
3416@@ -159,7 +157,7 @@
3417 transport = self.factory._makeBranchTransport(id=5, writable=False)
3418 self.assertRaises(
3419 errors.TransportNotPossible, transport.put_bytes,
3420- '.bzr/README', 'data')
3421+ '.bzr/README', b'data')
3422
3423 def test_writable_implies_writable(self):
3424 transport = self.factory._makeBranchTransport(id=5, writable=True)
3425@@ -559,7 +557,7 @@
3426 transport.put_bytes,
3427 '~%s/%s/.bzr/control.conf' % (
3428 branch.owner.name, branch.product.name),
3429- 'hello nurse!')
3430+ b'hello nurse!')
3431
3432 def _makeOnBackingTransport(self, branch):
3433 """Make directories for 'branch' on the backing transport.
3434@@ -578,7 +576,7 @@
3435 branch = self.factory.makeAnyBranch(
3436 branch_type=BranchType.HOSTED, owner=self.requester)
3437 backing_transport = self._makeOnBackingTransport(branch)
3438- backing_transport.put_bytes('hello.txt', 'Hello World!')
3439+ backing_transport.put_bytes('hello.txt', b'Hello World!')
3440 deferred = self._ensureDeferred(
3441 transport.get_bytes, '%s/.bzr/hello.txt' % branch.unique_name)
3442 return deferred.addCallback(self.assertEqual, 'Hello World!')
3443@@ -589,7 +587,7 @@
3444 branch = self.factory.makeAnyBranch(
3445 branch_type=BranchType.HOSTED, owner=self.requester)
3446 backing_transport = self._makeOnBackingTransport(branch)
3447- backing_transport.put_bytes('hello.txt', 'Hello World!')
3448+ backing_transport.put_bytes('hello.txt', b'Hello World!')
3449 url = escape('%s/.bzr/hello.txt' % branch.unique_name)
3450 transport = self.getTransport()
3451 deferred = self._ensureDeferred(transport.get_bytes, url)
3452@@ -601,7 +599,7 @@
3453 branch = self.factory.makeAnyBranch(
3454 branch_type=BranchType.HOSTED, owner=self.requester)
3455 backing_transport = self._makeOnBackingTransport(branch)
3456- data = 'Hello World!'
3457+ data = b'Hello World!'
3458 backing_transport.put_bytes('hello.txt', data)
3459 transport = self.getTransport()
3460 deferred = self._ensureDeferred(
3461@@ -622,7 +620,7 @@
3462 backing_transport = self._makeOnBackingTransport(branch)
3463 deferred = self._ensureDeferred(
3464 transport.put_bytes,
3465- '%s/.bzr/goodbye.txt' % branch.unique_name, "Goodbye")
3466+ '%s/.bzr/goodbye.txt' % branch.unique_name, b"Goodbye")
3467
3468 def check_bytes_written(ignored):
3469 self.assertEqual(
3470@@ -659,7 +657,7 @@
3471 branch = self.factory.makeAnyBranch(
3472 branch_type=BranchType.HOSTED, owner=self.requester)
3473 backing_transport = self._makeOnBackingTransport(branch)
3474- backing_transport.put_bytes('hello.txt', 'Hello World!')
3475+ backing_transport.put_bytes('hello.txt', b'Hello World!')
3476 transport = transport.clone('~%s' % branch.owner.name)
3477 deferred = self._ensureDeferred(
3478 transport.get_bytes,
3479@@ -696,7 +694,7 @@
3480 branch = self.factory.makeAnyBranch(
3481 branch_type=BranchType.HOSTED, owner=self.requester)
3482 backing_transport = self._makeOnBackingTransport(branch)
3483- backing_transport.put_bytes('hello.txt', 'Hello World!')
3484+ backing_transport.put_bytes('hello.txt', b'Hello World!')
3485
3486 transport = self.getTransport().clone(branch.unique_name)
3487
3488@@ -735,7 +733,7 @@
3489 branch = self.factory.makeAnyBranch(
3490 branch_type=BranchType.HOSTED, owner=self.requester)
3491 backing_transport = self._makeOnBackingTransport(branch)
3492- backing_transport.put_bytes('hello.txt', 'Hello World!')
3493+ backing_transport.put_bytes('hello.txt', b'Hello World!')
3494 transport = self.getTransport().clone(branch.unique_name)
3495 backing_transport = self.backing_transport.clone(
3496 branch_to_path(branch))
3497@@ -985,7 +983,7 @@
3498
3499 def assertFormatStringsPassed(self, branch):
3500 self.assertEqual(1, len(self._branch_changed_log))
3501- control_string = branch.bzrdir._format.get_format_string()
3502+ control_string = branch.controldir._format.get_format_string()
3503 branch_string = branch._format.get_format_string()
3504 repository_string = branch.repository._format.get_format_string()
3505 self.assertEqual(
3506@@ -1130,7 +1128,7 @@
3507 self.requester.id, codehosting_api, backing_transport)
3508 self.lp_transport = get_transport(self.lp_server.get_url())
3509 self.lp_transport.mkdir(os.path.dirname(self.writable_file))
3510- self.lp_transport.put_bytes(self.writable_file, 'Hello World!')
3511+ self.lp_transport.put_bytes(self.writable_file, b'Hello World!')
3512
3513 def _setUpMemoryServer(self):
3514 memory_server = MemoryServer()
3515
3516=== modified file 'lib/lp/codehosting/vfs/tests/test_filesystem.py'
3517--- lib/lp/codehosting/vfs/tests/test_filesystem.py 2018-01-02 10:54:31 +0000
3518+++ lib/lp/codehosting/vfs/tests/test_filesystem.py 2019-09-19 21:35:23 +0000
3519@@ -7,12 +7,12 @@
3520
3521 import stat
3522
3523-from bzrlib import errors
3524-from bzrlib.bzrdir import BzrDir
3525-from bzrlib.tests import TestCaseWithTransport
3526-from bzrlib.transport import get_transport
3527-from bzrlib.transport.memory import MemoryTransport
3528-from bzrlib.urlutils import escape
3529+from breezy import errors
3530+from breezy.bzr.bzrdir import BzrDir
3531+from breezy.tests import TestCaseWithTransport
3532+from breezy.transport import get_transport
3533+from breezy.transport.memory import MemoryTransport
3534+from breezy.urlutils import escape
3535
3536 from lp.code.interfaces.branchtarget import IBranchTarget
3537 from lp.code.interfaces.codehosting import branch_id_alias
3538@@ -218,7 +218,7 @@
3539 transport.mkdir(branch_path)
3540 self.assertRaises(
3541 errors.PermissionDenied,
3542- transport.put_bytes, '%s/README' % branch_path, 'Hello!')
3543+ transport.put_bytes, '%s/README' % branch_path, b'Hello!')
3544
3545 def test_rename_to_non_bzr_directory_fails(self):
3546 # Users cannot create an allowed directory (e.g. '.bzr' or
3547@@ -296,7 +296,7 @@
3548 # unescape(path).encode('utf-8') != path.
3549 path = '%41%42%43'
3550 escaped_path = escape(path)
3551- content = 'content'
3552+ content = b'content'
3553 transport.put_bytes(escaped_path, content)
3554
3555 # We can use the escaped path to reach the file.
3556
3557=== modified file 'lib/lp/codehosting/vfs/tests/test_transport.py'
3558--- lib/lp/codehosting/vfs/tests/test_transport.py 2011-08-12 11:37:08 +0000
3559+++ lib/lp/codehosting/vfs/tests/test_transport.py 2019-09-19 21:35:23 +0000
3560@@ -5,14 +5,14 @@
3561
3562 __metaclass__ = type
3563
3564-from bzrlib.tests import per_transport
3565-from bzrlib.transport import (
3566+from breezy.tests import per_transport
3567+from breezy.transport import (
3568 chroot,
3569 get_transport,
3570 Transport,
3571 )
3572-from bzrlib.transport.local import LocalTransport
3573-from bzrlib.urlutils import local_path_to_url
3574+from breezy.transport.local import LocalTransport
3575+from breezy.urlutils import local_path_to_url
3576
3577 from lp.codehosting.inmemory import InMemoryFrontend
3578 from lp.codehosting.tests.helpers import TestResultWrapper
3579
3580=== modified file 'lib/lp/codehosting/vfs/tests/test_transport_extensions.py'
3581--- lib/lp/codehosting/vfs/tests/test_transport_extensions.py 2011-08-12 11:37:08 +0000
3582+++ lib/lp/codehosting/vfs/tests/test_transport_extensions.py 2019-09-19 21:35:23 +0000
3583@@ -5,7 +5,7 @@
3584
3585 __metaclass__ = type
3586
3587-from bzrlib.transport.memory import MemoryTransport
3588+from breezy.transport.memory import MemoryTransport
3589
3590 from lp.codehosting.vfs.transport import get_readonly_transport
3591 from lp.testing import TestCase
3592
3593=== modified file 'lib/lp/codehosting/vfs/transport.py'
3594--- lib/lp/codehosting/vfs/transport.py 2019-06-08 05:06:08 +0000
3595+++ lib/lp/codehosting/vfs/transport.py 2019-09-19 21:35:23 +0000
3596@@ -5,7 +5,7 @@
3597
3598 The code hosting filesystem is implemented using Bazaar transports. This
3599 module contains utilities for implementing virtual filesystems using
3600-bzrlib.transport classes.
3601+breezy.transport classes.
3602 """
3603
3604 __metaclass__ = type
3605@@ -19,14 +19,14 @@
3606 ]
3607
3608
3609-from bzrlib import urlutils
3610-from bzrlib.errors import (
3611+from breezy import urlutils
3612+from breezy.errors import (
3613 BzrError,
3614 InProcessTransport,
3615 NoSuchFile,
3616 TransportNotPossible,
3617 )
3618-from bzrlib.transport import (
3619+from breezy.transport import (
3620 chroot,
3621 get_transport,
3622 register_transport,
3623@@ -113,7 +113,7 @@
3624 This method is called as an errback by `_call`. Use it to translate
3625 errors from the server into something that users of the transport
3626 might expect. This could include translating vfs-specific errors into
3627- bzrlib errors (e.g. "couldn\'t translate" into `NoSuchFile`) or
3628+ breezy errors (e.g. "couldn\'t translate" into `NoSuchFile`) or
3629 translating underlying paths into virtual paths.
3630
3631 :param failure: A `twisted.python.failure.Failure`.
3632@@ -276,105 +276,105 @@
3633 return self._async_transport.set_segment_parameter(name, value)
3634
3635 def clone(self, offset=None):
3636- """See `bzrlib.transport.Transport`."""
3637+ """See `breezy.transport.Transport`."""
3638 cloned_async = self._async_transport.clone(offset)
3639 return SynchronousAdapter(cloned_async)
3640
3641 def external_url(self):
3642- """See `bzrlib.transport.Transport`."""
3643+ """See `breezy.transport.Transport`."""
3644 raise InProcessTransport(self)
3645
3646 def abspath(self, relpath):
3647- """See `bzrlib.transport.Transport`."""
3648+ """See `breezy.transport.Transport`."""
3649 return self._async_transport.abspath(relpath)
3650
3651 def append_file(self, relpath, f, mode=None):
3652- """See `bzrlib.transport.Transport`."""
3653+ """See `breezy.transport.Transport`."""
3654 return extract_result(
3655 self._async_transport.append_file(relpath, f, mode))
3656
3657 def delete(self, relpath):
3658- """See `bzrlib.transport.Transport`."""
3659+ """See `breezy.transport.Transport`."""
3660 return extract_result(self._async_transport.delete(relpath))
3661
3662 def delete_tree(self, relpath):
3663- """See `bzrlib.transport.Transport`."""
3664+ """See `breezy.transport.Transport`."""
3665 return extract_result(self._async_transport.delete_tree(relpath))
3666
3667 def get(self, relpath):
3668- """See `bzrlib.transport.Transport`."""
3669+ """See `breezy.transport.Transport`."""
3670 return extract_result(self._async_transport.get(relpath))
3671
3672 def get_bytes(self, relpath):
3673- """See `bzrlib.transport.Transport`."""
3674+ """See `breezy.transport.Transport`."""
3675 return extract_result(self._async_transport.get_bytes(relpath))
3676
3677 def has(self, relpath):
3678- """See `bzrlib.transport.Transport`."""
3679+ """See `breezy.transport.Transport`."""
3680 return extract_result(self._async_transport.has(relpath))
3681
3682 def iter_files_recursive(self):
3683- """See `bzrlib.transport.Transport`."""
3684+ """See `breezy.transport.Transport`."""
3685 return extract_result(
3686 self._async_transport.iter_files_recursive())
3687
3688 def listable(self):
3689- """See `bzrlib.transport.Transport`."""
3690+ """See `breezy.transport.Transport`."""
3691 return extract_result(self._async_transport.listable())
3692
3693 def list_dir(self, relpath):
3694- """See `bzrlib.transport.Transport`."""
3695+ """See `breezy.transport.Transport`."""
3696 return extract_result(self._async_transport.list_dir(relpath))
3697
3698 def lock_read(self, relpath):
3699- """See `bzrlib.transport.Transport`."""
3700+ """See `breezy.transport.Transport`."""
3701 return extract_result(self._async_transport.lock_read(relpath))
3702
3703 def lock_write(self, relpath):
3704- """See `bzrlib.transport.Transport`."""
3705+ """See `breezy.transport.Transport`."""
3706 return extract_result(self._async_transport.lock_write(relpath))
3707
3708 def mkdir(self, relpath, mode=None):
3709- """See `bzrlib.transport.Transport`."""
3710+ """See `breezy.transport.Transport`."""
3711 return extract_result(self._async_transport.mkdir(relpath, mode))
3712
3713 def open_write_stream(self, relpath, mode=None):
3714- """See `bzrlib.transport.Transport`."""
3715+ """See `breezy.transport.Transport`."""
3716 return extract_result(
3717 self._async_transport.open_write_stream(relpath, mode))
3718
3719 def put_file(self, relpath, f, mode=None):
3720- """See `bzrlib.transport.Transport`."""
3721+ """See `breezy.transport.Transport`."""
3722 return extract_result(
3723 self._async_transport.put_file(relpath, f, mode))
3724
3725 def local_realPath(self, relpath):
3726- """See `bzrlib.transport.Transport`."""
3727+ """See `lp.codehosting.sftp.FatLocalTransport`."""
3728 return extract_result(
3729 self._async_transport.local_realPath(relpath))
3730
3731 def readv(self, relpath, offsets, adjust_for_latency=False,
3732 upper_limit=None):
3733- """See `bzrlib.transport.Transport`."""
3734+ """See `breezy.transport.Transport`."""
3735 return extract_result(
3736 self._async_transport.readv(
3737 relpath, offsets, adjust_for_latency, upper_limit))
3738
3739 def rename(self, rel_from, rel_to):
3740- """See `bzrlib.transport.Transport`."""
3741+ """See `breezy.transport.Transport`."""
3742 return extract_result(
3743 self._async_transport.rename(rel_from, rel_to))
3744
3745 def rmdir(self, relpath):
3746- """See `bzrlib.transport.Transport`."""
3747+ """See `breezy.transport.Transport`."""
3748 return extract_result(self._async_transport.rmdir(relpath))
3749
3750 def stat(self, relpath):
3751- """See `bzrlib.transport.Transport`."""
3752+ """See `breezy.transport.Transport`."""
3753 return extract_result(self._async_transport.stat(relpath))
3754
3755 def writeChunk(self, relpath, offset, data):
3756- """See `bzrlib.transport.Transport`."""
3757+ """See `lp.codehosting.sftp.FatLocalTransport`."""
3758 return extract_result(
3759 self._async_transport.writeChunk(relpath, offset, data))
3760
3761@@ -394,7 +394,7 @@
3762
3763 :param scheme: The URL scheme to use.
3764 """
3765- # bzrlib's Server class does not have a constructor, so we cannot
3766+ # breezy's Server class does not have a constructor, so we cannot
3767 # safely upcall it.
3768 self._scheme = scheme
3769 self._is_started = False
3770
3771=== modified file 'lib/lp/scripts/runlaunchpad.py'
3772--- lib/lp/scripts/runlaunchpad.py 2019-04-16 14:30:40 +0000
3773+++ lib/lp/scripts/runlaunchpad.py 2019-09-19 21:35:23 +0000
3774@@ -202,13 +202,13 @@
3775 # service.
3776 if not self.should_launch:
3777 return
3778- from lp.codehosting import get_bzr_path
3779- command = [config.root + '/bin/py', get_bzr_path(),
3780+ from lp.codehosting import get_brz_path
3781+ command = [config.root + '/bin/py', get_brz_path(),
3782 'launchpad-forking-service',
3783 '--path', config.codehosting.forking_daemon_socket,
3784 ]
3785 env = dict(os.environ)
3786- env['BZR_PLUGIN_PATH'] = config.root + '/bzrplugins'
3787+ env['BRZ_PLUGIN_PATH'] = config.root + '/brzplugins'
3788 logfile = self.logfile
3789 if logfile == '-':
3790 # This process uses a different logging infrastructure from the
3791@@ -216,7 +216,7 @@
3792 # as the logfile. So we just ignore this setting.
3793 pass
3794 else:
3795- env['BZR_LOG'] = logfile
3796+ env['BRZ_LOG'] = logfile
3797 process = subprocess.Popen(command, env=env, stdin=subprocess.PIPE)
3798 self.addCleanup(stop_process, process)
3799 process.stdin.close()
3800
3801=== modified file 'lib/lp/testing/__init__.py'
3802--- lib/lp/testing/__init__.py 2018-06-25 15:13:32 +0000
3803+++ lib/lp/testing/__init__.py 2019-09-19 21:35:23 +0000
3804@@ -81,12 +81,13 @@
3805 import time
3806 import unittest
3807
3808-from bzrlib import trace
3809-from bzrlib.bzrdir import (
3810- BzrDir,
3811+from breezy import trace
3812+from breezy.controldir import (
3813+ ControlDir,
3814 format_registry,
3815 )
3816-from bzrlib.transport import get_transport
3817+from breezy.transport import get_transport
3818+from bzrlib import trace as bzr_trace
3819 import fixtures
3820 from lazr.restful.testing.tales import test_tales
3821 from lazr.restful.testing.webservice import FakeRequest
3822@@ -832,11 +833,12 @@
3823 self._use_bzr_branch_called = False
3824 # XXX: JonathanLange 2010-12-24 bug=694140: Because of Launchpad's
3825 # messing with global log state (see
3826- # lp.services.scripts.logger), trace._bzr_logger does not
3827- # necessarily equal logging.getLogger('bzr'), so we have to explicitly
3828- # make it so in order to avoid "No handlers for "bzr" logger'
3829+ # lp.services.scripts.logger), trace._brz_logger does not
3830+ # necessarily equal logging.getLogger('brz'), so we have to explicitly
3831+ # make it so in order to avoid "No handlers for "brz" logger'
3832 # messages.
3833- trace._bzr_logger = logging.getLogger('bzr')
3834+ trace._brz_logger = logging.getLogger('brz')
3835+ bzr_trace._bzr_logger = logging.getLogger('bzr')
3836
3837 def getUserBrowser(self, url=None, user=None):
3838 """Return a Browser logged in as a fresh user, maybe opened at `url`.
3839@@ -874,8 +876,7 @@
3840 """
3841 if format is not None and isinstance(format, basestring):
3842 format = format_registry.get(format)()
3843- return BzrDir.create_branch_convenience(
3844- branch_url, format=format)
3845+ return ControlDir.create_branch_convenience(branch_url, format=format)
3846
3847 def create_branch_and_tree(self, tree_location=None, product=None,
3848 db_branch=None, format=None,
3849@@ -935,6 +936,7 @@
3850 self.useTempDir()
3851 # Avoid leaking local user configuration into tests.
3852 self.useContext(override_environ(
3853+ BRZ_HOME=os.getcwd(), BRZ_EMAIL=None,
3854 BZR_HOME=os.getcwd(), BZR_EMAIL=None, EMAIL=None,
3855 ))
3856
3857@@ -1392,7 +1394,7 @@
3858 for entry in entries:
3859 file_path, file_name, file_type = entry[:3]
3860 if file_type == 'file':
3861- stored_file = tree.get_file_by_path(file_path)
3862+ stored_file = tree.get_file(file_path)
3863 contents[file_path] = stored_file.read()
3864 finally:
3865 tree.unlock()
3866
3867=== modified file 'lib/lp/testing/factory.py'
3868--- lib/lp/testing/factory.py 2019-09-05 13:23:34 +0000
3869+++ lib/lp/testing/factory.py 2019-09-19 21:35:23 +0000
3870@@ -46,8 +46,8 @@
3871 import uuid
3872 import warnings
3873
3874-from bzrlib.plugins.builder.recipe import BaseRecipeBranch
3875-from bzrlib.revision import Revision as BzrRevision
3876+from breezy.plugins.builder.recipe import BaseRecipeBranch
3877+from breezy.revision import Revision as BzrRevision
3878 from cryptography.utils import int_to_bytes
3879 from lazr.jobrunner.jobrunner import SuspendJobException
3880 import pytz
3881@@ -3033,7 +3033,7 @@
3882 If no branches are passed, return a recipe text that references an
3883 arbitrary branch.
3884 """
3885- from bzrlib.plugins.builder.recipe import RecipeParser
3886+ from breezy.plugins.builder.recipe import RecipeParser
3887 parser = RecipeParser(self.makeRecipeText(*branches))
3888 return parser.parse()
3889
3890
3891=== modified file 'lib/lp/translations/browser/productseries.py'
3892--- lib/lp/translations/browser/productseries.py 2018-07-16 00:51:23 +0000
3893+++ lib/lp/translations/browser/productseries.py 2019-09-19 21:35:23 +0000
3894@@ -18,7 +18,7 @@
3895
3896 import os.path
3897
3898-from bzrlib.revision import NULL_REVISION
3899+from breezy.revision import NULL_REVISION
3900 from zope.component import getUtility
3901 from zope.publisher.browser import FileUpload
3902
3903
3904=== modified file 'lib/lp/translations/pottery/detect_intltool.py'
3905--- lib/lp/translations/pottery/detect_intltool.py 2010-10-26 15:47:24 +0000
3906+++ lib/lp/translations/pottery/detect_intltool.py 2019-09-19 21:35:23 +0000
3907@@ -26,7 +26,7 @@
3908
3909 Currently this just checks for the existence of POTFILES.in.
3910
3911- :param tree: A bzrlib.Tree object to search for the intltool structure.
3912+ :param tree: A breezy.Tree object to search for the intltool structure.
3913 :returns: True if signs of an intltool structure were found.
3914 """
3915 with read_lock_tree(tree):
3916
3917=== modified file 'lib/lp/translations/pottery/tests/test_detect_intltool.py'
3918--- lib/lp/translations/pottery/tests/test_detect_intltool.py 2017-05-10 12:43:40 +0000
3919+++ lib/lp/translations/pottery/tests/test_detect_intltool.py 2019-09-19 21:35:23 +0000
3920@@ -7,7 +7,7 @@
3921 import os
3922 import tarfile
3923
3924-from bzrlib.bzrdir import BzrDir
3925+from breezy.controldir import ControlDir
3926
3927 from lp.testing import TestCase
3928 from lp.translations.pottery.detect_intltool import is_intltool_structure
3929@@ -56,7 +56,7 @@
3930 class TestDetectIntltoolInBzrTree(TestCase, SetupTestPackageMixin):
3931
3932 def prepare_tree(self):
3933- return BzrDir.create_standalone_workingtree(".")
3934+ return ControlDir.create_standalone_workingtree(".")
3935
3936 def test_detect_intltool_structure(self):
3937 # Detect a simple intltool structure.
3938
3939=== modified file 'lib/lp/translations/scripts/tests/test_translations_to_branch.py'
3940--- lib/lp/translations/scripts/tests/test_translations_to_branch.py 2018-01-02 16:10:26 +0000
3941+++ lib/lp/translations/scripts/tests/test_translations_to_branch.py 2019-09-19 21:35:23 +0000
3942@@ -7,7 +7,7 @@
3943 import re
3944 from textwrap import dedent
3945
3946-from bzrlib.errors import NotBranchError
3947+from breezy.errors import NotBranchError
3948 import pytz
3949 from testtools.matchers import MatchesRegex
3950 import transaction
3951@@ -193,7 +193,7 @@
3952 self.assertTrue("GruesomeException" in message)
3953
3954 def test_exportToBranches_handles_unpushed_branches(self):
3955- # bzrlib raises NotBranchError when accessing a nonexistent
3956+ # breezy raises NotBranchError when accessing a nonexistent
3957 # branch. The exporter deals with that by calling
3958 # _handleUnpushedBranch.
3959 exporter = ExportTranslationsToBranch(test_args=[])
3960
3961=== modified file 'lib/lp/translations/scripts/translations_to_branch.py'
3962--- lib/lp/translations/scripts/translations_to_branch.py 2019-07-25 15:00:18 +0000
3963+++ lib/lp/translations/scripts/translations_to_branch.py 2019-09-19 21:35:23 +0000
3964@@ -17,8 +17,8 @@
3965 # line below this comment.
3966 import lp.codehosting
3967
3968-from bzrlib.errors import NotBranchError
3969-from bzrlib.revision import NULL_REVISION
3970+from breezy.errors import NotBranchError
3971+from breezy.revision import NULL_REVISION
3972 import pytz
3973 from storm.expr import (
3974 And,
3975
3976=== modified file 'lib/lp/translations/tests/test_rosetta_branches_script.py'
3977--- lib/lp/translations/tests/test_rosetta_branches_script.py 2013-07-04 06:28:58 +0000
3978+++ lib/lp/translations/tests/test_rosetta_branches_script.py 2019-09-19 21:35:23 +0000
3979@@ -9,7 +9,7 @@
3980
3981 __metaclass__ = type
3982
3983-from bzrlib.revision import NULL_REVISION
3984+from breezy.revision import NULL_REVISION
3985 import transaction
3986 from zope.component import getUtility
3987
3988@@ -43,11 +43,11 @@
3989 self.useBzrBranches()
3990 pot_content = self.factory.getUniqueString()
3991 branch, tree = self.create_branch_and_tree()
3992- tree.bzrdir.root_transport.put_bytes(pot_path, pot_content)
3993+ tree.controldir.root_transport.put_bytes(pot_path, pot_content)
3994 tree.add(pot_path)
3995 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
3996 # required to generate the revision-id.
3997- with override_environ(BZR_EMAIL='me@example.com'):
3998+ with override_environ(BRZ_EMAIL='me@example.com'):
3999 revision_id = tree.commit("first commit")
4000 branch.last_scanned_id = revision_id
4001 branch.last_mirrored_id = revision_id
4002
4003=== modified file 'lib/lp_sitecustomize.py'
4004--- lib/lp_sitecustomize.py 2019-03-09 09:26:01 +0000
4005+++ lib/lp_sitecustomize.py 2019-09-19 21:35:23 +0000
4006@@ -77,11 +77,12 @@
4007 amqp_logger.propagate = False
4008
4009
4010-def silence_bzr_logger():
4011- """Install the NullHandler on the bzr logger to silence logs."""
4012- bzr_logger = logging.getLogger('bzr')
4013- bzr_logger.addHandler(logging.NullHandler())
4014- bzr_logger.propagate = False
4015+def silence_bzr_loggers():
4016+ """Install the NullHandler on the bzr/brz loggers to silence logs."""
4017+ for logger_name in ('bzr', 'brz'):
4018+ logger = logging.getLogger(logger_name)
4019+ logger.addHandler(logging.NullHandler())
4020+ logger.propagate = False
4021
4022
4023 def silence_swiftclient_logger():
4024@@ -154,7 +155,7 @@
4025 logging between tests.
4026 """
4027 silence_amqp_logger()
4028- silence_bzr_logger()
4029+ silence_bzr_loggers()
4030 silence_zcml_logger()
4031 silence_transaction_logger()
4032 silence_swiftclient_logger()
4033@@ -185,3 +186,9 @@
4034 # through actually using itertools.groupby.
4035 grouper = type(list(itertools.groupby([0]))[0][1])
4036 checker.BasicTypes[grouper] = checker._iteratorChecker
4037+
4038+ # XXX 2019-09-17: git must be disabled until codeimport is upgraded,
4039+ # since the required dulwich versions for our current version of bzr-git
4040+ # and for Breezy are incompatible in both directions.
4041+ import types
4042+ sys.modules['breezy.git'] = types.ModuleType('breezy.git')
4043
4044=== modified file 'scripts/mirror-branch.py'
4045--- scripts/mirror-branch.py 2013-01-07 02:40:55 +0000
4046+++ scripts/mirror-branch.py 2019-09-19 21:35:23 +0000
4047@@ -33,7 +33,7 @@
4048 import resource
4049 import sys
4050
4051-import bzrlib.repository
4052+import breezy.repository
4053
4054 from lp.code.enums import BranchType
4055 from lp.codehosting.puller.worker import (
4056@@ -54,24 +54,7 @@
4057 # XXX DavidAllouche 2006-01-29:
4058 # Quick hack to disable the deprecation warning for old repository
4059 # formats.
4060- bzrlib.repository._deprecation_warning_done = True
4061-
4062-
4063-def force_bzr_to_use_urllib():
4064- # These lines prevent bzr from using pycurl to connect to http: urls. We
4065- # want this for two reasons:
4066- # 1) pycurl rejects self signed certificates, which prevents a significant
4067- # number of mirror branchs from updating, and
4068- # 2) the script sometimes hangs inside pycurl, preventing all mirrors from
4069- # being updated until the script is restarted.
4070- # There is no test for this (it would involve a great number of moving
4071- # parts) but it has been verified to work on production. Also see
4072- # https://bugs.launchpad.net/bzr/+bug/82086
4073- from bzrlib.transport import register_lazy_transport
4074- register_lazy_transport('http://', 'bzrlib.transport.http._urllib',
4075- 'HttpTransport_urllib')
4076- register_lazy_transport('https://', 'bzrlib.transport.http._urllib',
4077- 'HttpTransport_urllib')
4078+ breezy.repository._deprecation_warning_done = True
4079
4080
4081 if __name__ == '__main__':
4082@@ -86,7 +69,6 @@
4083 section_name = 'supermirror_%s_puller' % branch_type_map[branch_type]
4084 globalErrorUtility.configure(section_name)
4085 shut_up_deprecation_warning()
4086- force_bzr_to_use_urllib()
4087
4088 resource.setrlimit(resource.RLIMIT_AS, (1500000000, 1500000000))
4089
4090
4091=== modified file 'scripts/update-stacked-on.py'
4092--- scripts/update-stacked-on.py 2013-01-07 02:40:55 +0000
4093+++ scripts/update-stacked-on.py 2019-09-19 21:35:23 +0000
4094@@ -23,9 +23,10 @@
4095 from collections import namedtuple
4096 import sys
4097
4098-from bzrlib import errors
4099-from bzrlib.bzrdir import BzrDir
4100-from bzrlib.config import TransportConfig
4101+from breezy import errors
4102+from breezy.branch import UnstackableBranchFormat
4103+from breezy.bzr.bzrdir import BzrDir
4104+from breezy.config import TransportConfig
4105
4106 from lp.code.interfaces.codehosting import branch_id_alias
4107 from lp.codehosting.bzrutils import get_branch_stacked_on_url
4108@@ -109,7 +110,7 @@
4109 self.logger.warn(
4110 "Branch for %r at %r is not stacked at all. Giving up."
4111 % (branch_id, bzr_branch_url))
4112- except errors.UnstackableBranchFormat:
4113+ except UnstackableBranchFormat:
4114 self.logger.error(
4115 "Branch for %r at %r is unstackable. Giving up."
4116 % (branch_id, bzr_branch_url))
4117
4118=== modified file 'setup.py'
4119--- setup.py 2019-08-23 10:06:34 +0000
4120+++ setup.py 2019-09-19 21:35:23 +0000
4121@@ -149,6 +149,7 @@
4122 'backports.lzma',
4123 'BeautifulSoup',
4124 'beautifulsoup4[lxml]',
4125+ 'breezy',
4126 'bzr',
4127 'celery',
4128 'cssselect',
4129@@ -277,6 +278,7 @@
4130 'zope.vocabularyregistry',
4131 # Loggerhead dependencies. These should be removed once
4132 # bug 383360 is fixed and we include it as a source dist.
4133+ 'bleach',
4134 'Paste',
4135 'PasteDeploy',
4136 'SimpleTAL',
4137
4138=== modified file 'utilities/create-lp-wadl-and-apidoc.py'
4139--- utilities/create-lp-wadl-and-apidoc.py 2016-09-14 11:13:06 +0000
4140+++ utilities/create-lp-wadl-and-apidoc.py 2019-09-19 21:35:23 +0000
4141@@ -18,8 +18,8 @@
4142 import subprocess
4143 import sys
4144
4145-import bzrlib
4146-from bzrlib.branch import Branch
4147+import breezy
4148+from breezy.branch import Branch
4149 from lazr.restful.interfaces import IWebServiceConfiguration
4150 from z3c.ptcompat import PageTemplateFile
4151 from zope.component import getUtility
4152@@ -144,7 +144,7 @@
4153 ["git", "log", "-1", "--format=%ct", "HEAD"],
4154 universal_newlines=True))
4155 else:
4156- with bzrlib.initialize():
4157+ with breezy.get_global_state():
4158 branch = Branch.open(top)
4159 timestamp = branch.repository.get_revision(
4160 branch.last_revision()).timestamp
4161
4162=== modified file 'utilities/sourcedeps.cache'
4163--- utilities/sourcedeps.cache 2019-07-09 12:32:22 +0000
4164+++ utilities/sourcedeps.cache 2019-09-19 21:35:23 +0000
4165@@ -1,16 +1,16 @@
4166 {
4167- "bzr-builder": [
4168- 70,
4169- "launchpad@pqm.canonical.com-20111114140506-6bmt9isw6lcud7yt"
4170+ "brz-builder": [
4171+ 180,
4172+ "jelmer@jelmer.uk-20180624153632-1f0weftl0pawz6wj"
4173+ ],
4174+ "brz-loom": [
4175+ 164,
4176+ "jelmer@jelmer.uk-20190613193059-rmsz6mcj33cj1rod"
4177 ],
4178 "bzr-git": [
4179 280,
4180 "launchpad@pqm.canonical.com-20171222005919-u98ut0f5z2g618um"
4181 ],
4182- "bzr-loom": [
4183- 55,
4184- "launchpad@pqm.canonical.com-20120830090804-cg49kky93htwax7s"
4185- ],
4186 "bzr-svn": [
4187 2725,
4188 "launchpad@pqm.canonical.com-20130816045016-wzr810hu2z459t4y"
4189@@ -24,8 +24,8 @@
4190 "cjwatson@canonical.com-20190614154330-091l9edcnubsjmsx"
4191 ],
4192 "loggerhead": [
4193- 493,
4194- "cjwatson@canonical.com-20190621112125-3aaxj3hrmty19lr6"
4195+ 494,
4196+ "cjwatson@canonical.com-20190919081036-q1symc2h2iedtlh3"
4197 ],
4198 "mailman": [
4199 977,
4200
4201=== modified file 'utilities/sourcedeps.conf'
4202--- utilities/sourcedeps.conf 2019-07-09 12:32:22 +0000
4203+++ utilities/sourcedeps.conf 2019-09-19 21:35:23 +0000
4204@@ -7,13 +7,13 @@
4205 #### DEPRECATED. NO NEW ITEMS. NO NO NO NO NO NONONONONO
4206 #########################################################
4207
4208-bzr-builder lp:~launchpad-pqm/bzr-builder/trunk;revno=70
4209+brz-builder lp:~jelmer/brz-builder/trunk;revno=180
4210+brz-loom lp:~jelmer/brz-loom/trunk;revno=164
4211 bzr-git lp:~launchpad-pqm/bzr-git/devel;revno=280
4212-bzr-loom lp:~launchpad-pqm/bzr-loom/trunk;revno=55
4213 bzr-svn lp:~launchpad-pqm/bzr-svn/devel;revno=2725
4214 cscvs lp:~launchpad-pqm/launchpad-cscvs/devel;revno=433
4215 difftacular lp:~launchpad/difftacular/trunk;revno=11
4216-loggerhead lp:~loggerhead-team/loggerhead/trunk-rich;revno=493
4217+loggerhead lp:~loggerhead-team/loggerhead/trunk-rich;revno=494
4218 mailman lp:~launchpad-pqm/mailman/2.1;revno=977
4219 old_xmlplus lp:~launchpad-pqm/dtdparser/trunk;revno=4
4220 pygettextpo lp:~launchpad-pqm/pygettextpo/trunk;revno=25