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