Merge lp:~jelmer/brz/move-registration into lp:brz
- move-registration
- Merge into trunk
Proposed by
Jelmer Vernooij
Status: | Merged |
---|---|
Approved by: | Jelmer Vernooij |
Approved revision: | no longer in the source branch. |
Merge reported by: | The Breezy Bot |
Merged at revision: | not available |
Proposed branch: | lp:~jelmer/brz/move-registration |
Merge into: | lp:brz |
Diff against target: |
1025 lines (+377/-366) 13 files modified
breezy/builtins.py (+1/-1) breezy/bzr/__init__.py (+336/-0) breezy/bzr/bzrdir.py (+1/-328) breezy/bzr/remote.py (+2/-1) breezy/bzr/smart/bzrdir.py (+3/-1) breezy/plugins/weave_fmt/__init__.py (+1/-1) breezy/tests/blackbox/test_exceptions.py (+2/-4) breezy/tests/blackbox/test_upgrade.py (+3/-2) breezy/tests/test_bzrdir.py (+10/-9) breezy/tests/test_options.py (+11/-13) breezy/tests/test_remote.py (+3/-1) breezy/tests/test_url_policy_open.py (+1/-1) tools/generate_docs.py (+3/-4) |
To merge this branch: | bzr merge lp:~jelmer/brz/move-registration |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Packman | Approve | ||
Review via email: mp+325703@code.launchpad.net |
Commit message
Move bzr format probing to breezy.bzr.
Description of the change
Move bzr format probing to breezy.bzr.
(This is to limit the amount of bzr-related code that needs to be imported when e.g. accessing non-bzr formats like git).
I'm planning to mirror this for the git support
To post a comment you must log in.
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote : | # |
Running landing tests failed
http://
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote : | # |
Running landing tests failed
http://
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote : | # |
Running landing tests failed
http://
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'breezy/builtins.py' | |||
2 | --- breezy/builtins.py 2017-06-15 22:34:55 +0000 | |||
3 | +++ breezy/builtins.py 2017-06-15 23:39:05 +0000 | |||
4 | @@ -22,7 +22,7 @@ | |||
5 | 22 | import os | 22 | import os |
6 | 23 | import sys | 23 | import sys |
7 | 24 | 24 | ||
9 | 25 | import breezy.bzr.bzrdir | 25 | import breezy.bzr |
10 | 26 | 26 | ||
11 | 27 | from . import lazy_import | 27 | from . import lazy_import |
12 | 28 | lazy_import.lazy_import(globals(), """ | 28 | lazy_import.lazy_import(globals(), """ |
13 | 29 | 29 | ||
14 | === modified file 'breezy/bzr/__init__.py' | |||
15 | --- breezy/bzr/__init__.py 2017-06-10 01:39:46 +0000 | |||
16 | +++ breezy/bzr/__init__.py 2017-06-15 23:39:05 +0000 | |||
17 | @@ -15,3 +15,339 @@ | |||
18 | 15 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 15 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
19 | 16 | 16 | ||
20 | 17 | from __future__ import absolute_import | 17 | from __future__ import absolute_import |
21 | 18 | |||
22 | 19 | from .. import ( | ||
23 | 20 | config, | ||
24 | 21 | errors, | ||
25 | 22 | controldir, | ||
26 | 23 | pyutils, | ||
27 | 24 | registry, | ||
28 | 25 | ) | ||
29 | 26 | |||
30 | 27 | class BzrProber(controldir.Prober): | ||
31 | 28 | """Prober for formats that use a .bzr/ control directory.""" | ||
32 | 29 | |||
33 | 30 | formats = registry.FormatRegistry(controldir.network_format_registry) | ||
34 | 31 | """The known .bzr formats.""" | ||
35 | 32 | |||
36 | 33 | @classmethod | ||
37 | 34 | def probe_transport(klass, transport): | ||
38 | 35 | """Return the .bzrdir style format present in a directory.""" | ||
39 | 36 | try: | ||
40 | 37 | format_string = transport.get_bytes(".bzr/branch-format") | ||
41 | 38 | # GZ 2017-06-09: Where should format strings get decoded... | ||
42 | 39 | format_text = format_string.decode("ascii") | ||
43 | 40 | except errors.NoSuchFile: | ||
44 | 41 | raise errors.NotBranchError(path=transport.base) | ||
45 | 42 | try: | ||
46 | 43 | first_line = format_text[:format_text.index("\n")+1] | ||
47 | 44 | except ValueError: | ||
48 | 45 | first_line = format_text | ||
49 | 46 | try: | ||
50 | 47 | cls = klass.formats.get(first_line) | ||
51 | 48 | except KeyError: | ||
52 | 49 | raise errors.UnknownFormatError(format=first_line, kind='bzrdir') | ||
53 | 50 | return cls.from_string(format_text) | ||
54 | 51 | |||
55 | 52 | @classmethod | ||
56 | 53 | def known_formats(cls): | ||
57 | 54 | result = set() | ||
58 | 55 | for name, format in cls.formats.items(): | ||
59 | 56 | if callable(format): | ||
60 | 57 | format = format() | ||
61 | 58 | result.add(format) | ||
62 | 59 | return result | ||
63 | 60 | |||
64 | 61 | |||
65 | 62 | controldir.ControlDirFormat.register_prober(BzrProber) | ||
66 | 63 | |||
67 | 64 | |||
68 | 65 | class RemoteBzrProber(controldir.Prober): | ||
69 | 66 | """Prober for remote servers that provide a Bazaar smart server.""" | ||
70 | 67 | |||
71 | 68 | @classmethod | ||
72 | 69 | def probe_transport(klass, transport): | ||
73 | 70 | """Return a RemoteBzrDirFormat object if it looks possible.""" | ||
74 | 71 | try: | ||
75 | 72 | medium = transport.get_smart_medium() | ||
76 | 73 | except (NotImplementedError, AttributeError, | ||
77 | 74 | errors.TransportNotPossible, errors.NoSmartMedium, | ||
78 | 75 | errors.SmartProtocolError): | ||
79 | 76 | # no smart server, so not a branch for this format type. | ||
80 | 77 | raise errors.NotBranchError(path=transport.base) | ||
81 | 78 | else: | ||
82 | 79 | # Decline to open it if the server doesn't support our required | ||
83 | 80 | # version (3) so that the VFS-based transport will do it. | ||
84 | 81 | if medium.should_probe(): | ||
85 | 82 | try: | ||
86 | 83 | server_version = medium.protocol_version() | ||
87 | 84 | except errors.SmartProtocolError: | ||
88 | 85 | # Apparently there's no usable smart server there, even though | ||
89 | 86 | # the medium supports the smart protocol. | ||
90 | 87 | raise errors.NotBranchError(path=transport.base) | ||
91 | 88 | if server_version != '2': | ||
92 | 89 | raise errors.NotBranchError(path=transport.base) | ||
93 | 90 | from .remote import RemoteBzrDirFormat | ||
94 | 91 | return RemoteBzrDirFormat() | ||
95 | 92 | |||
96 | 93 | @classmethod | ||
97 | 94 | def known_formats(cls): | ||
98 | 95 | from .remote import RemoteBzrDirFormat | ||
99 | 96 | return {RemoteBzrDirFormat()} | ||
100 | 97 | |||
101 | 98 | |||
102 | 99 | controldir.ControlDirFormat.register_server_prober(RemoteBzrProber) | ||
103 | 100 | |||
104 | 101 | # Register bzr formats | ||
105 | 102 | BzrProber.formats.register_lazy( | ||
106 | 103 | "Bazaar-NG meta directory, format 1\n", | ||
107 | 104 | __name__ + '.bzrdir', 'BzrDirMetaFormat1') | ||
108 | 105 | BzrProber.formats.register_lazy( | ||
109 | 106 | "Bazaar meta directory, format 1 (with colocated branches)\n", | ||
110 | 107 | __name__ + '.bzrdir', 'BzrDirMetaFormat1Colo') | ||
111 | 108 | |||
112 | 109 | |||
113 | 110 | def register_metadir(registry, key, | ||
114 | 111 | repository_format, help, native=True, deprecated=False, | ||
115 | 112 | branch_format=None, | ||
116 | 113 | tree_format=None, | ||
117 | 114 | hidden=False, | ||
118 | 115 | experimental=False, | ||
119 | 116 | alias=False, bzrdir_format=None): | ||
120 | 117 | """Register a metadir subformat. | ||
121 | 118 | |||
122 | 119 | These all use a meta bzrdir, but can be parameterized by the | ||
123 | 120 | Repository/Branch/WorkingTreeformats. | ||
124 | 121 | |||
125 | 122 | :param repository_format: The fully-qualified repository format class | ||
126 | 123 | name as a string. | ||
127 | 124 | :param branch_format: Fully-qualified branch format class name as | ||
128 | 125 | a string. | ||
129 | 126 | :param tree_format: Fully-qualified tree format class name as | ||
130 | 127 | a string. | ||
131 | 128 | """ | ||
132 | 129 | if bzrdir_format is None: | ||
133 | 130 | bzrdir_format = 'breezy.bzr.bzrdir.BzrDirMetaFormat1' | ||
134 | 131 | # This should be expanded to support setting WorkingTree and Branch | ||
135 | 132 | # formats, once the API supports that. | ||
136 | 133 | def _load(full_name): | ||
137 | 134 | mod_name, factory_name = full_name.rsplit('.', 1) | ||
138 | 135 | try: | ||
139 | 136 | factory = pyutils.get_named_object(mod_name, factory_name) | ||
140 | 137 | except ImportError as e: | ||
141 | 138 | raise ImportError('failed to load %s: %s' % (full_name, e)) | ||
142 | 139 | except AttributeError: | ||
143 | 140 | raise AttributeError('no factory %s in module %r' | ||
144 | 141 | % (full_name, sys.modules[mod_name])) | ||
145 | 142 | return factory() | ||
146 | 143 | |||
147 | 144 | def helper(): | ||
148 | 145 | bd = _load(bzrdir_format) | ||
149 | 146 | if branch_format is not None: | ||
150 | 147 | bd.set_branch_format(_load(branch_format)) | ||
151 | 148 | if tree_format is not None: | ||
152 | 149 | bd.workingtree_format = _load(tree_format) | ||
153 | 150 | if repository_format is not None: | ||
154 | 151 | bd.repository_format = _load(repository_format) | ||
155 | 152 | return bd | ||
156 | 153 | registry.register(key, helper, help, native, deprecated, hidden, | ||
157 | 154 | experimental, alias) | ||
158 | 155 | |||
159 | 156 | register_metadir(controldir.format_registry, 'knit', | ||
160 | 157 | 'breezy.bzr.knitrepo.RepositoryFormatKnit1', | ||
161 | 158 | 'Format using knits. Recommended for interoperation with bzr <= 0.14.', | ||
162 | 159 | branch_format='breezy.bzr.fullhistory.BzrBranchFormat5', | ||
163 | 160 | tree_format='breezy.bzr.workingtree_3.WorkingTreeFormat3', | ||
164 | 161 | hidden=True, | ||
165 | 162 | deprecated=True) | ||
166 | 163 | register_metadir(controldir.format_registry, 'dirstate', | ||
167 | 164 | 'breezy.bzr.knitrepo.RepositoryFormatKnit1', | ||
168 | 165 | help='Format using dirstate for working trees. ' | ||
169 | 166 | 'Compatible with bzr 0.8 and ' | ||
170 | 167 | 'above when accessed over the network. Introduced in bzr 0.15.', | ||
171 | 168 | branch_format='breezy.bzr.fullhistory.BzrBranchFormat5', | ||
172 | 169 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4', | ||
173 | 170 | hidden=True, | ||
174 | 171 | deprecated=True) | ||
175 | 172 | register_metadir(controldir.format_registry, 'dirstate-tags', | ||
176 | 173 | 'breezy.bzr.knitrepo.RepositoryFormatKnit1', | ||
177 | 174 | help='Variant of dirstate with support for tags. ' | ||
178 | 175 | 'Introduced in bzr 0.15.', | ||
179 | 176 | branch_format='breezy.bzr.branch.BzrBranchFormat6', | ||
180 | 177 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4', | ||
181 | 178 | hidden=True, | ||
182 | 179 | deprecated=True) | ||
183 | 180 | register_metadir(controldir.format_registry, 'rich-root', | ||
184 | 181 | 'breezy.bzr.knitrepo.RepositoryFormatKnit4', | ||
185 | 182 | help='Variant of dirstate with better handling of tree roots. ' | ||
186 | 183 | 'Introduced in bzr 1.0', | ||
187 | 184 | branch_format='breezy.bzr.branch.BzrBranchFormat6', | ||
188 | 185 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4', | ||
189 | 186 | hidden=True, | ||
190 | 187 | deprecated=True) | ||
191 | 188 | register_metadir(controldir.format_registry, 'dirstate-with-subtree', | ||
192 | 189 | 'breezy.bzr.knitrepo.RepositoryFormatKnit3', | ||
193 | 190 | help='Variant of dirstate with support for nested trees. ' | ||
194 | 191 | 'Introduced in 0.15.', | ||
195 | 192 | branch_format='breezy.bzr.branch.BzrBranchFormat6', | ||
196 | 193 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4', | ||
197 | 194 | experimental=True, | ||
198 | 195 | hidden=True, | ||
199 | 196 | ) | ||
200 | 197 | register_metadir(controldir.format_registry, 'pack-0.92', | ||
201 | 198 | 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack1', | ||
202 | 199 | help='Pack-based format used in 1.x series. Introduced in 0.92. ' | ||
203 | 200 | 'Interoperates with bzr repositories before 0.92 but cannot be ' | ||
204 | 201 | 'read by bzr < 0.92. ' | ||
205 | 202 | , | ||
206 | 203 | branch_format='breezy.bzr.branch.BzrBranchFormat6', | ||
207 | 204 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4', | ||
208 | 205 | deprecated=True, | ||
209 | 206 | ) | ||
210 | 207 | register_metadir(controldir.format_registry, 'pack-0.92-subtree', | ||
211 | 208 | 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack3', | ||
212 | 209 | help='Pack-based format used in 1.x series, with subtree support. ' | ||
213 | 210 | 'Introduced in 0.92. Interoperates with ' | ||
214 | 211 | 'bzr repositories before 0.92 but cannot be read by bzr < 0.92. ' | ||
215 | 212 | , | ||
216 | 213 | branch_format='breezy.bzr.branch.BzrBranchFormat6', | ||
217 | 214 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4', | ||
218 | 215 | hidden=True, | ||
219 | 216 | deprecated=True, | ||
220 | 217 | experimental=True, | ||
221 | 218 | ) | ||
222 | 219 | register_metadir(controldir.format_registry, 'rich-root-pack', | ||
223 | 220 | 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack4', | ||
224 | 221 | help='A variant of pack-0.92 that supports rich-root data ' | ||
225 | 222 | '(needed for bzr-svn and bzr-git). Introduced in 1.0.', | ||
226 | 223 | branch_format='breezy.bzr.branch.BzrBranchFormat6', | ||
227 | 224 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4', | ||
228 | 225 | hidden=True, | ||
229 | 226 | deprecated=True, | ||
230 | 227 | ) | ||
231 | 228 | register_metadir(controldir.format_registry, '1.6', | ||
232 | 229 | 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack5', | ||
233 | 230 | help='A format that allows a branch to indicate that there is another ' | ||
234 | 231 | '(stacked) repository that should be used to access data that is ' | ||
235 | 232 | 'not present locally.', | ||
236 | 233 | branch_format='breezy.bzr.branch.BzrBranchFormat7', | ||
237 | 234 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4', | ||
238 | 235 | hidden=True, | ||
239 | 236 | deprecated=True, | ||
240 | 237 | ) | ||
241 | 238 | register_metadir(controldir.format_registry, '1.6.1-rich-root', | ||
242 | 239 | 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack5RichRoot', | ||
243 | 240 | help='A variant of 1.6 that supports rich-root data ' | ||
244 | 241 | '(needed for bzr-svn and bzr-git).', | ||
245 | 242 | branch_format='breezy.bzr.branch.BzrBranchFormat7', | ||
246 | 243 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4', | ||
247 | 244 | hidden=True, | ||
248 | 245 | deprecated=True, | ||
249 | 246 | ) | ||
250 | 247 | register_metadir(controldir.format_registry, '1.9', | ||
251 | 248 | 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack6', | ||
252 | 249 | help='A repository format using B+tree indexes. These indexes ' | ||
253 | 250 | 'are smaller in size, have smarter caching and provide faster ' | ||
254 | 251 | 'performance for most operations.', | ||
255 | 252 | branch_format='breezy.bzr.branch.BzrBranchFormat7', | ||
256 | 253 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4', | ||
257 | 254 | hidden=True, | ||
258 | 255 | deprecated=True, | ||
259 | 256 | ) | ||
260 | 257 | register_metadir(controldir.format_registry, '1.9-rich-root', | ||
261 | 258 | 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack6RichRoot', | ||
262 | 259 | help='A variant of 1.9 that supports rich-root data ' | ||
263 | 260 | '(needed for bzr-svn and bzr-git).', | ||
264 | 261 | branch_format='breezy.bzr.branch.BzrBranchFormat7', | ||
265 | 262 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4', | ||
266 | 263 | hidden=True, | ||
267 | 264 | deprecated=True, | ||
268 | 265 | ) | ||
269 | 266 | register_metadir(controldir.format_registry, '1.14', | ||
270 | 267 | 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack6', | ||
271 | 268 | help='A working-tree format that supports content filtering.', | ||
272 | 269 | branch_format='breezy.bzr.branch.BzrBranchFormat7', | ||
273 | 270 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat5', | ||
274 | 271 | hidden=True, | ||
275 | 272 | deprecated=True, | ||
276 | 273 | ) | ||
277 | 274 | register_metadir(controldir.format_registry, '1.14-rich-root', | ||
278 | 275 | 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack6RichRoot', | ||
279 | 276 | help='A variant of 1.14 that supports rich-root data ' | ||
280 | 277 | '(needed for bzr-svn and bzr-git).', | ||
281 | 278 | branch_format='breezy.bzr.branch.BzrBranchFormat7', | ||
282 | 279 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat5', | ||
283 | 280 | hidden=True, | ||
284 | 281 | deprecated=True, | ||
285 | 282 | ) | ||
286 | 283 | # The following un-numbered 'development' formats should always just be aliases. | ||
287 | 284 | register_metadir(controldir.format_registry, 'development-subtree', | ||
288 | 285 | 'breezy.bzr.groupcompress_repo.RepositoryFormat2aSubtree', | ||
289 | 286 | help='Current development format, subtree variant. Can convert data to and ' | ||
290 | 287 | 'from pack-0.92-subtree (and anything compatible with ' | ||
291 | 288 | 'pack-0.92-subtree) format repositories. Repositories and branches in ' | ||
292 | 289 | 'this format can only be read by bzr.dev. Please read ' | ||
293 | 290 | 'http://doc.bazaar.canonical.com/latest/developers/development-repo.html ' | ||
294 | 291 | 'before use.', | ||
295 | 292 | branch_format='breezy.bzr.branch.BzrBranchFormat7', | ||
296 | 293 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat6', | ||
297 | 294 | experimental=True, | ||
298 | 295 | hidden=True, | ||
299 | 296 | alias=False, # Restore to being an alias when an actual development subtree format is added | ||
300 | 297 | # This current non-alias status is simply because we did not introduce a | ||
301 | 298 | # chk based subtree format. | ||
302 | 299 | ) | ||
303 | 300 | register_metadir(controldir.format_registry, 'development5-subtree', | ||
304 | 301 | 'breezy.bzr.knitpack_repo.RepositoryFormatPackDevelopment2Subtree', | ||
305 | 302 | help='Development format, subtree variant. Can convert data to and ' | ||
306 | 303 | 'from pack-0.92-subtree (and anything compatible with ' | ||
307 | 304 | 'pack-0.92-subtree) format repositories. Repositories and branches in ' | ||
308 | 305 | 'this format can only be read by bzr.dev. Please read ' | ||
309 | 306 | 'http://doc.bazaar.canonical.com/latest/developers/development-repo.html ' | ||
310 | 307 | 'before use.', | ||
311 | 308 | branch_format='breezy.bzr.branch.BzrBranchFormat7', | ||
312 | 309 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat6', | ||
313 | 310 | experimental=True, | ||
314 | 311 | hidden=True, | ||
315 | 312 | alias=False, | ||
316 | 313 | ) | ||
317 | 314 | |||
318 | 315 | register_metadir(controldir.format_registry, 'development-colo', | ||
319 | 316 | 'breezy.bzr.groupcompress_repo.RepositoryFormat2a', | ||
320 | 317 | help='The 2a format with experimental support for colocated branches.\n', | ||
321 | 318 | branch_format='breezy.bzr.branch.BzrBranchFormat7', | ||
322 | 319 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat6', | ||
323 | 320 | experimental=True, | ||
324 | 321 | bzrdir_format='breezy.bzr.bzrdir.BzrDirMetaFormat1Colo', | ||
325 | 322 | ) | ||
326 | 323 | |||
327 | 324 | |||
328 | 325 | # And the development formats above will have aliased one of the following: | ||
329 | 326 | |||
330 | 327 | # Finally, the current format. | ||
331 | 328 | register_metadir(controldir.format_registry, '2a', | ||
332 | 329 | 'breezy.bzr.groupcompress_repo.RepositoryFormat2a', | ||
333 | 330 | help='Format for the bzr 2.0 series.\n' | ||
334 | 331 | 'Uses group-compress storage.\n' | ||
335 | 332 | 'Provides rich roots which are a one-way transition.\n', | ||
336 | 333 | # 'storage in packs, 255-way hashed CHK inventory, bencode revision, group compress, ' | ||
337 | 334 | # 'rich roots. Supported by bzr 1.16 and later.', | ||
338 | 335 | branch_format='breezy.bzr.branch.BzrBranchFormat7', | ||
339 | 336 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat6', | ||
340 | 337 | experimental=False, | ||
341 | 338 | ) | ||
342 | 339 | |||
343 | 340 | # The following format should be an alias for the rich root equivalent | ||
344 | 341 | # of the default format | ||
345 | 342 | register_metadir(controldir.format_registry, 'default-rich-root', | ||
346 | 343 | 'breezy.bzr.groupcompress_repo.RepositoryFormat2a', | ||
347 | 344 | branch_format='breezy.bzr.branch.BzrBranchFormat7', | ||
348 | 345 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat6', | ||
349 | 346 | alias=True, | ||
350 | 347 | hidden=True, | ||
351 | 348 | help='Same as 2a.') | ||
352 | 349 | |||
353 | 350 | |||
354 | 351 | # The current format that is made on 'bzr init'. | ||
355 | 352 | format_name = config.GlobalStack().get('default_format') | ||
356 | 353 | controldir.format_registry.set_default(format_name) | ||
357 | 18 | 354 | ||
358 | === modified file 'breezy/bzr/bzrdir.py' | |||
359 | --- breezy/bzr/bzrdir.py 2017-06-11 14:07:05 +0000 | |||
360 | +++ breezy/bzr/bzrdir.py 2017-06-15 23:39:05 +0000 | |||
361 | @@ -1223,78 +1223,6 @@ | |||
362 | 1223 | self.features[name] = necessity | 1223 | self.features[name] = necessity |
363 | 1224 | 1224 | ||
364 | 1225 | 1225 | ||
365 | 1226 | class BzrProber(controldir.Prober): | ||
366 | 1227 | """Prober for formats that use a .bzr/ control directory.""" | ||
367 | 1228 | |||
368 | 1229 | formats = registry.FormatRegistry(controldir.network_format_registry) | ||
369 | 1230 | """The known .bzr formats.""" | ||
370 | 1231 | |||
371 | 1232 | @classmethod | ||
372 | 1233 | def probe_transport(klass, transport): | ||
373 | 1234 | """Return the .bzrdir style format present in a directory.""" | ||
374 | 1235 | try: | ||
375 | 1236 | format_string = transport.get_bytes(".bzr/branch-format") | ||
376 | 1237 | # GZ 2017-06-09: Where should format strings get decoded... | ||
377 | 1238 | format_text = format_string.decode("ascii") | ||
378 | 1239 | except errors.NoSuchFile: | ||
379 | 1240 | raise errors.NotBranchError(path=transport.base) | ||
380 | 1241 | try: | ||
381 | 1242 | first_line = format_text[:format_text.index("\n")+1] | ||
382 | 1243 | except ValueError: | ||
383 | 1244 | first_line = format_text | ||
384 | 1245 | try: | ||
385 | 1246 | cls = klass.formats.get(first_line) | ||
386 | 1247 | except KeyError: | ||
387 | 1248 | raise errors.UnknownFormatError(format=first_line, kind='bzrdir') | ||
388 | 1249 | return cls.from_string(format_text) | ||
389 | 1250 | |||
390 | 1251 | @classmethod | ||
391 | 1252 | def known_formats(cls): | ||
392 | 1253 | result = set() | ||
393 | 1254 | for name, format in cls.formats.items(): | ||
394 | 1255 | if callable(format): | ||
395 | 1256 | format = format() | ||
396 | 1257 | result.add(format) | ||
397 | 1258 | return result | ||
398 | 1259 | |||
399 | 1260 | |||
400 | 1261 | controldir.ControlDirFormat.register_prober(BzrProber) | ||
401 | 1262 | |||
402 | 1263 | |||
403 | 1264 | class RemoteBzrProber(controldir.Prober): | ||
404 | 1265 | """Prober for remote servers that provide a Bazaar smart server.""" | ||
405 | 1266 | |||
406 | 1267 | @classmethod | ||
407 | 1268 | def probe_transport(klass, transport): | ||
408 | 1269 | """Return a RemoteBzrDirFormat object if it looks possible.""" | ||
409 | 1270 | try: | ||
410 | 1271 | medium = transport.get_smart_medium() | ||
411 | 1272 | except (NotImplementedError, AttributeError, | ||
412 | 1273 | errors.TransportNotPossible, errors.NoSmartMedium, | ||
413 | 1274 | errors.SmartProtocolError): | ||
414 | 1275 | # no smart server, so not a branch for this format type. | ||
415 | 1276 | raise errors.NotBranchError(path=transport.base) | ||
416 | 1277 | else: | ||
417 | 1278 | # Decline to open it if the server doesn't support our required | ||
418 | 1279 | # version (3) so that the VFS-based transport will do it. | ||
419 | 1280 | if medium.should_probe(): | ||
420 | 1281 | try: | ||
421 | 1282 | server_version = medium.protocol_version() | ||
422 | 1283 | except errors.SmartProtocolError: | ||
423 | 1284 | # Apparently there's no usable smart server there, even though | ||
424 | 1285 | # the medium supports the smart protocol. | ||
425 | 1286 | raise errors.NotBranchError(path=transport.base) | ||
426 | 1287 | if server_version != '2': | ||
427 | 1288 | raise errors.NotBranchError(path=transport.base) | ||
428 | 1289 | from .remote import RemoteBzrDirFormat | ||
429 | 1290 | return RemoteBzrDirFormat() | ||
430 | 1291 | |||
431 | 1292 | @classmethod | ||
432 | 1293 | def known_formats(cls): | ||
433 | 1294 | from .remote import RemoteBzrDirFormat | ||
434 | 1295 | return {RemoteBzrDirFormat()} | ||
435 | 1296 | |||
436 | 1297 | |||
437 | 1298 | class BzrDirFormat(BzrFormat, controldir.ControlDirFormat): | 1226 | class BzrDirFormat(BzrFormat, controldir.ControlDirFormat): |
438 | 1299 | """ControlDirFormat base class for .bzr/ directories. | 1227 | """ControlDirFormat base class for .bzr/ directories. |
439 | 1300 | 1228 | ||
440 | @@ -1745,12 +1673,6 @@ | |||
441 | 1745 | __set_workingtree_format) | 1673 | __set_workingtree_format) |
442 | 1746 | 1674 | ||
443 | 1747 | 1675 | ||
444 | 1748 | # Register bzr formats | ||
445 | 1749 | BzrProber.formats.register(BzrDirMetaFormat1.get_format_string(), | ||
446 | 1750 | BzrDirMetaFormat1) | ||
447 | 1751 | controldir.ControlDirFormat._default_format = BzrDirMetaFormat1() | ||
448 | 1752 | |||
449 | 1753 | |||
450 | 1754 | class BzrDirMetaFormat1Colo(BzrDirMetaFormat1): | 1676 | class BzrDirMetaFormat1Colo(BzrDirMetaFormat1): |
451 | 1755 | """BzrDirMeta1 format with support for colocated branches.""" | 1677 | """BzrDirMeta1 format with support for colocated branches.""" |
452 | 1756 | 1678 | ||
453 | @@ -1775,10 +1697,6 @@ | |||
454 | 1775 | return BzrDirMeta1(transport, format) | 1697 | return BzrDirMeta1(transport, format) |
455 | 1776 | 1698 | ||
456 | 1777 | 1699 | ||
457 | 1778 | BzrProber.formats.register(BzrDirMetaFormat1Colo.get_format_string(), | ||
458 | 1779 | BzrDirMetaFormat1Colo) | ||
459 | 1780 | |||
460 | 1781 | |||
461 | 1782 | class ConvertMetaToMeta(controldir.Converter): | 1700 | class ConvertMetaToMeta(controldir.Converter): |
462 | 1783 | """Converts the components of metadirs.""" | 1701 | """Converts the components of metadirs.""" |
463 | 1784 | 1702 | ||
464 | @@ -1892,9 +1810,6 @@ | |||
465 | 1892 | return BzrDir.open_from_transport(to_convert.root_transport) | 1810 | return BzrDir.open_from_transport(to_convert.root_transport) |
466 | 1893 | 1811 | ||
467 | 1894 | 1812 | ||
468 | 1895 | controldir.ControlDirFormat.register_server_prober(RemoteBzrProber) | ||
469 | 1896 | |||
470 | 1897 | |||
471 | 1898 | class RepositoryAcquisitionPolicy(object): | 1813 | class RepositoryAcquisitionPolicy(object): |
472 | 1899 | """Abstract base class for repository acquisition policies. | 1814 | """Abstract base class for repository acquisition policies. |
473 | 1900 | 1815 | ||
474 | @@ -2066,246 +1981,4 @@ | |||
475 | 2066 | return self._repository, False | 1981 | return self._repository, False |
476 | 2067 | 1982 | ||
477 | 2068 | 1983 | ||
721 | 2069 | def register_metadir(registry, key, | 1984 | controldir.ControlDirFormat._default_format = BzrDirMetaFormat1() |
479 | 2070 | repository_format, help, native=True, deprecated=False, | ||
480 | 2071 | branch_format=None, | ||
481 | 2072 | tree_format=None, | ||
482 | 2073 | hidden=False, | ||
483 | 2074 | experimental=False, | ||
484 | 2075 | alias=False, bzrdir_format=None): | ||
485 | 2076 | """Register a metadir subformat. | ||
486 | 2077 | |||
487 | 2078 | These all use a meta bzrdir, but can be parameterized by the | ||
488 | 2079 | Repository/Branch/WorkingTreeformats. | ||
489 | 2080 | |||
490 | 2081 | :param repository_format: The fully-qualified repository format class | ||
491 | 2082 | name as a string. | ||
492 | 2083 | :param branch_format: Fully-qualified branch format class name as | ||
493 | 2084 | a string. | ||
494 | 2085 | :param tree_format: Fully-qualified tree format class name as | ||
495 | 2086 | a string. | ||
496 | 2087 | """ | ||
497 | 2088 | if bzrdir_format is None: | ||
498 | 2089 | bzrdir_format = BzrDirMetaFormat1 | ||
499 | 2090 | # This should be expanded to support setting WorkingTree and Branch | ||
500 | 2091 | # formats, once the API supports that. | ||
501 | 2092 | def _load(full_name): | ||
502 | 2093 | mod_name, factory_name = full_name.rsplit('.', 1) | ||
503 | 2094 | try: | ||
504 | 2095 | factory = pyutils.get_named_object(mod_name, factory_name) | ||
505 | 2096 | except ImportError as e: | ||
506 | 2097 | raise ImportError('failed to load %s: %s' % (full_name, e)) | ||
507 | 2098 | except AttributeError: | ||
508 | 2099 | raise AttributeError('no factory %s in module %r' | ||
509 | 2100 | % (full_name, sys.modules[mod_name])) | ||
510 | 2101 | return factory() | ||
511 | 2102 | |||
512 | 2103 | def helper(): | ||
513 | 2104 | bd = bzrdir_format() | ||
514 | 2105 | if branch_format is not None: | ||
515 | 2106 | bd.set_branch_format(_load(branch_format)) | ||
516 | 2107 | if tree_format is not None: | ||
517 | 2108 | bd.workingtree_format = _load(tree_format) | ||
518 | 2109 | if repository_format is not None: | ||
519 | 2110 | bd.repository_format = _load(repository_format) | ||
520 | 2111 | return bd | ||
521 | 2112 | registry.register(key, helper, help, native, deprecated, hidden, | ||
522 | 2113 | experimental, alias) | ||
523 | 2114 | |||
524 | 2115 | register_metadir(controldir.format_registry, 'knit', | ||
525 | 2116 | 'breezy.bzr.knitrepo.RepositoryFormatKnit1', | ||
526 | 2117 | 'Format using knits. Recommended for interoperation with bzr <= 0.14.', | ||
527 | 2118 | branch_format='breezy.bzr.fullhistory.BzrBranchFormat5', | ||
528 | 2119 | tree_format='breezy.bzr.workingtree_3.WorkingTreeFormat3', | ||
529 | 2120 | hidden=True, | ||
530 | 2121 | deprecated=True) | ||
531 | 2122 | register_metadir(controldir.format_registry, 'dirstate', | ||
532 | 2123 | 'breezy.bzr.knitrepo.RepositoryFormatKnit1', | ||
533 | 2124 | help='Format using dirstate for working trees. ' | ||
534 | 2125 | 'Compatible with bzr 0.8 and ' | ||
535 | 2126 | 'above when accessed over the network. Introduced in bzr 0.15.', | ||
536 | 2127 | branch_format='breezy.bzr.fullhistory.BzrBranchFormat5', | ||
537 | 2128 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4', | ||
538 | 2129 | hidden=True, | ||
539 | 2130 | deprecated=True) | ||
540 | 2131 | register_metadir(controldir.format_registry, 'dirstate-tags', | ||
541 | 2132 | 'breezy.bzr.knitrepo.RepositoryFormatKnit1', | ||
542 | 2133 | help='Variant of dirstate with support for tags. ' | ||
543 | 2134 | 'Introduced in bzr 0.15.', | ||
544 | 2135 | branch_format='breezy.bzr.branch.BzrBranchFormat6', | ||
545 | 2136 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4', | ||
546 | 2137 | hidden=True, | ||
547 | 2138 | deprecated=True) | ||
548 | 2139 | register_metadir(controldir.format_registry, 'rich-root', | ||
549 | 2140 | 'breezy.bzr.knitrepo.RepositoryFormatKnit4', | ||
550 | 2141 | help='Variant of dirstate with better handling of tree roots. ' | ||
551 | 2142 | 'Introduced in bzr 1.0', | ||
552 | 2143 | branch_format='breezy.bzr.branch.BzrBranchFormat6', | ||
553 | 2144 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4', | ||
554 | 2145 | hidden=True, | ||
555 | 2146 | deprecated=True) | ||
556 | 2147 | register_metadir(controldir.format_registry, 'dirstate-with-subtree', | ||
557 | 2148 | 'breezy.bzr.knitrepo.RepositoryFormatKnit3', | ||
558 | 2149 | help='Variant of dirstate with support for nested trees. ' | ||
559 | 2150 | 'Introduced in 0.15.', | ||
560 | 2151 | branch_format='breezy.bzr.branch.BzrBranchFormat6', | ||
561 | 2152 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4', | ||
562 | 2153 | experimental=True, | ||
563 | 2154 | hidden=True, | ||
564 | 2155 | ) | ||
565 | 2156 | register_metadir(controldir.format_registry, 'pack-0.92', | ||
566 | 2157 | 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack1', | ||
567 | 2158 | help='Pack-based format used in 1.x series. Introduced in 0.92. ' | ||
568 | 2159 | 'Interoperates with bzr repositories before 0.92 but cannot be ' | ||
569 | 2160 | 'read by bzr < 0.92. ' | ||
570 | 2161 | , | ||
571 | 2162 | branch_format='breezy.bzr.branch.BzrBranchFormat6', | ||
572 | 2163 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4', | ||
573 | 2164 | deprecated=True, | ||
574 | 2165 | ) | ||
575 | 2166 | register_metadir(controldir.format_registry, 'pack-0.92-subtree', | ||
576 | 2167 | 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack3', | ||
577 | 2168 | help='Pack-based format used in 1.x series, with subtree support. ' | ||
578 | 2169 | 'Introduced in 0.92. Interoperates with ' | ||
579 | 2170 | 'bzr repositories before 0.92 but cannot be read by bzr < 0.92. ' | ||
580 | 2171 | , | ||
581 | 2172 | branch_format='breezy.bzr.branch.BzrBranchFormat6', | ||
582 | 2173 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4', | ||
583 | 2174 | hidden=True, | ||
584 | 2175 | deprecated=True, | ||
585 | 2176 | experimental=True, | ||
586 | 2177 | ) | ||
587 | 2178 | register_metadir(controldir.format_registry, 'rich-root-pack', | ||
588 | 2179 | 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack4', | ||
589 | 2180 | help='A variant of pack-0.92 that supports rich-root data ' | ||
590 | 2181 | '(needed for bzr-svn and bzr-git). Introduced in 1.0.', | ||
591 | 2182 | branch_format='breezy.bzr.branch.BzrBranchFormat6', | ||
592 | 2183 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4', | ||
593 | 2184 | hidden=True, | ||
594 | 2185 | deprecated=True, | ||
595 | 2186 | ) | ||
596 | 2187 | register_metadir(controldir.format_registry, '1.6', | ||
597 | 2188 | 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack5', | ||
598 | 2189 | help='A format that allows a branch to indicate that there is another ' | ||
599 | 2190 | '(stacked) repository that should be used to access data that is ' | ||
600 | 2191 | 'not present locally.', | ||
601 | 2192 | branch_format='breezy.bzr.branch.BzrBranchFormat7', | ||
602 | 2193 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4', | ||
603 | 2194 | hidden=True, | ||
604 | 2195 | deprecated=True, | ||
605 | 2196 | ) | ||
606 | 2197 | register_metadir(controldir.format_registry, '1.6.1-rich-root', | ||
607 | 2198 | 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack5RichRoot', | ||
608 | 2199 | help='A variant of 1.6 that supports rich-root data ' | ||
609 | 2200 | '(needed for bzr-svn and bzr-git).', | ||
610 | 2201 | branch_format='breezy.bzr.branch.BzrBranchFormat7', | ||
611 | 2202 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4', | ||
612 | 2203 | hidden=True, | ||
613 | 2204 | deprecated=True, | ||
614 | 2205 | ) | ||
615 | 2206 | register_metadir(controldir.format_registry, '1.9', | ||
616 | 2207 | 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack6', | ||
617 | 2208 | help='A repository format using B+tree indexes. These indexes ' | ||
618 | 2209 | 'are smaller in size, have smarter caching and provide faster ' | ||
619 | 2210 | 'performance for most operations.', | ||
620 | 2211 | branch_format='breezy.bzr.branch.BzrBranchFormat7', | ||
621 | 2212 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4', | ||
622 | 2213 | hidden=True, | ||
623 | 2214 | deprecated=True, | ||
624 | 2215 | ) | ||
625 | 2216 | register_metadir(controldir.format_registry, '1.9-rich-root', | ||
626 | 2217 | 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack6RichRoot', | ||
627 | 2218 | help='A variant of 1.9 that supports rich-root data ' | ||
628 | 2219 | '(needed for bzr-svn and bzr-git).', | ||
629 | 2220 | branch_format='breezy.bzr.branch.BzrBranchFormat7', | ||
630 | 2221 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4', | ||
631 | 2222 | hidden=True, | ||
632 | 2223 | deprecated=True, | ||
633 | 2224 | ) | ||
634 | 2225 | register_metadir(controldir.format_registry, '1.14', | ||
635 | 2226 | 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack6', | ||
636 | 2227 | help='A working-tree format that supports content filtering.', | ||
637 | 2228 | branch_format='breezy.bzr.branch.BzrBranchFormat7', | ||
638 | 2229 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat5', | ||
639 | 2230 | hidden=True, | ||
640 | 2231 | deprecated=True, | ||
641 | 2232 | ) | ||
642 | 2233 | register_metadir(controldir.format_registry, '1.14-rich-root', | ||
643 | 2234 | 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack6RichRoot', | ||
644 | 2235 | help='A variant of 1.14 that supports rich-root data ' | ||
645 | 2236 | '(needed for bzr-svn and bzr-git).', | ||
646 | 2237 | branch_format='breezy.bzr.branch.BzrBranchFormat7', | ||
647 | 2238 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat5', | ||
648 | 2239 | hidden=True, | ||
649 | 2240 | deprecated=True, | ||
650 | 2241 | ) | ||
651 | 2242 | # The following un-numbered 'development' formats should always just be aliases. | ||
652 | 2243 | register_metadir(controldir.format_registry, 'development-subtree', | ||
653 | 2244 | 'breezy.bzr.groupcompress_repo.RepositoryFormat2aSubtree', | ||
654 | 2245 | help='Current development format, subtree variant. Can convert data to and ' | ||
655 | 2246 | 'from pack-0.92-subtree (and anything compatible with ' | ||
656 | 2247 | 'pack-0.92-subtree) format repositories. Repositories and branches in ' | ||
657 | 2248 | 'this format can only be read by bzr.dev. Please read ' | ||
658 | 2249 | 'http://doc.bazaar.canonical.com/latest/developers/development-repo.html ' | ||
659 | 2250 | 'before use.', | ||
660 | 2251 | branch_format='breezy.bzr.branch.BzrBranchFormat7', | ||
661 | 2252 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat6', | ||
662 | 2253 | experimental=True, | ||
663 | 2254 | hidden=True, | ||
664 | 2255 | alias=False, # Restore to being an alias when an actual development subtree format is added | ||
665 | 2256 | # This current non-alias status is simply because we did not introduce a | ||
666 | 2257 | # chk based subtree format. | ||
667 | 2258 | ) | ||
668 | 2259 | register_metadir(controldir.format_registry, 'development5-subtree', | ||
669 | 2260 | 'breezy.bzr.knitpack_repo.RepositoryFormatPackDevelopment2Subtree', | ||
670 | 2261 | help='Development format, subtree variant. Can convert data to and ' | ||
671 | 2262 | 'from pack-0.92-subtree (and anything compatible with ' | ||
672 | 2263 | 'pack-0.92-subtree) format repositories. Repositories and branches in ' | ||
673 | 2264 | 'this format can only be read by bzr.dev. Please read ' | ||
674 | 2265 | 'http://doc.bazaar.canonical.com/latest/developers/development-repo.html ' | ||
675 | 2266 | 'before use.', | ||
676 | 2267 | branch_format='breezy.bzr.branch.BzrBranchFormat7', | ||
677 | 2268 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat6', | ||
678 | 2269 | experimental=True, | ||
679 | 2270 | hidden=True, | ||
680 | 2271 | alias=False, | ||
681 | 2272 | ) | ||
682 | 2273 | |||
683 | 2274 | register_metadir(controldir.format_registry, 'development-colo', | ||
684 | 2275 | 'breezy.bzr.groupcompress_repo.RepositoryFormat2a', | ||
685 | 2276 | help='The 2a format with experimental support for colocated branches.\n', | ||
686 | 2277 | branch_format='breezy.bzr.branch.BzrBranchFormat7', | ||
687 | 2278 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat6', | ||
688 | 2279 | experimental=True, | ||
689 | 2280 | bzrdir_format=BzrDirMetaFormat1Colo, | ||
690 | 2281 | ) | ||
691 | 2282 | |||
692 | 2283 | |||
693 | 2284 | # And the development formats above will have aliased one of the following: | ||
694 | 2285 | |||
695 | 2286 | # Finally, the current format. | ||
696 | 2287 | register_metadir(controldir.format_registry, '2a', | ||
697 | 2288 | 'breezy.bzr.groupcompress_repo.RepositoryFormat2a', | ||
698 | 2289 | help='Format for the bzr 2.0 series.\n' | ||
699 | 2290 | 'Uses group-compress storage.\n' | ||
700 | 2291 | 'Provides rich roots which are a one-way transition.\n', | ||
701 | 2292 | # 'storage in packs, 255-way hashed CHK inventory, bencode revision, group compress, ' | ||
702 | 2293 | # 'rich roots. Supported by bzr 1.16 and later.', | ||
703 | 2294 | branch_format='breezy.bzr.branch.BzrBranchFormat7', | ||
704 | 2295 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat6', | ||
705 | 2296 | experimental=False, | ||
706 | 2297 | ) | ||
707 | 2298 | |||
708 | 2299 | # The following format should be an alias for the rich root equivalent | ||
709 | 2300 | # of the default format | ||
710 | 2301 | register_metadir(controldir.format_registry, 'default-rich-root', | ||
711 | 2302 | 'breezy.bzr.groupcompress_repo.RepositoryFormat2a', | ||
712 | 2303 | branch_format='breezy.bzr.branch.BzrBranchFormat7', | ||
713 | 2304 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat6', | ||
714 | 2305 | alias=True, | ||
715 | 2306 | hidden=True, | ||
716 | 2307 | help='Same as 2a.') | ||
717 | 2308 | |||
718 | 2309 | # The current format that is made on 'bzr init'. | ||
719 | 2310 | format_name = config.GlobalStack().get('default_format') | ||
720 | 2311 | controldir.format_registry.set_default(format_name) | ||
722 | 2312 | 1985 | ||
723 | === modified file 'breezy/bzr/remote.py' | |||
724 | --- breezy/bzr/remote.py 2017-06-14 23:29:06 +0000 | |||
725 | +++ breezy/bzr/remote.py 2017-06-15 23:39:05 +0000 | |||
726 | @@ -22,6 +22,7 @@ | |||
727 | 22 | from .. import ( | 22 | from .. import ( |
728 | 23 | bencode, | 23 | bencode, |
729 | 24 | branch, | 24 | branch, |
730 | 25 | bzr as _mod_bzr, | ||
731 | 25 | config as _mod_config, | 26 | config as _mod_config, |
732 | 26 | controldir, | 27 | controldir, |
733 | 27 | debug, | 28 | debug, |
734 | @@ -490,7 +491,7 @@ | |||
735 | 490 | warning('VFS BzrDir access triggered\n%s', | 491 | warning('VFS BzrDir access triggered\n%s', |
736 | 491 | ''.join(traceback.format_stack())) | 492 | ''.join(traceback.format_stack())) |
737 | 492 | self._real_bzrdir = _mod_bzrdir.BzrDir.open_from_transport( | 493 | self._real_bzrdir = _mod_bzrdir.BzrDir.open_from_transport( |
739 | 493 | self.root_transport, probers=[_mod_bzrdir.BzrProber]) | 494 | self.root_transport, probers=[_mod_bzr.BzrProber]) |
740 | 494 | self._format._network_name = \ | 495 | self._format._network_name = \ |
741 | 495 | self._real_bzrdir._format.network_name() | 496 | self._real_bzrdir._format.network_name() |
742 | 496 | 497 | ||
743 | 497 | 498 | ||
744 | === modified file 'breezy/bzr/smart/bzrdir.py' | |||
745 | --- breezy/bzr/smart/bzrdir.py 2017-06-11 20:15:04 +0000 | |||
746 | +++ breezy/bzr/smart/bzrdir.py 2017-06-15 23:39:05 +0000 | |||
747 | @@ -25,10 +25,12 @@ | |||
748 | 25 | repository, | 25 | repository, |
749 | 26 | urlutils, | 26 | urlutils, |
750 | 27 | ) | 27 | ) |
751 | 28 | from .. import ( | ||
752 | 29 | BzrProber, | ||
753 | 30 | ) | ||
754 | 28 | from ..bzrdir import ( | 31 | from ..bzrdir import ( |
755 | 29 | BzrDir, | 32 | BzrDir, |
756 | 30 | BzrDirFormat, | 33 | BzrDirFormat, |
757 | 31 | BzrProber, | ||
758 | 32 | ) | 34 | ) |
759 | 33 | from ...controldir import ( | 35 | from ...controldir import ( |
760 | 34 | network_format_registry, | 36 | network_format_registry, |
761 | 35 | 37 | ||
762 | === modified file 'breezy/plugins/weave_fmt/__init__.py' | |||
763 | --- breezy/plugins/weave_fmt/__init__.py 2017-06-11 20:33:20 +0000 | |||
764 | +++ breezy/plugins/weave_fmt/__init__.py 2017-06-15 23:39:05 +0000 | |||
765 | @@ -33,7 +33,7 @@ | |||
766 | 33 | from ...bzr import ( | 33 | from ...bzr import ( |
767 | 34 | serializer, | 34 | serializer, |
768 | 35 | ) | 35 | ) |
770 | 36 | from ...bzr.bzrdir import ( | 36 | from ...bzr import ( |
771 | 37 | BzrProber, | 37 | BzrProber, |
772 | 38 | register_metadir, | 38 | register_metadir, |
773 | 39 | ) | 39 | ) |
774 | 40 | 40 | ||
775 | === modified file 'breezy/tests/blackbox/test_exceptions.py' | |||
776 | --- breezy/tests/blackbox/test_exceptions.py 2017-06-11 01:22:16 +0000 | |||
777 | +++ breezy/tests/blackbox/test_exceptions.py 2017-06-15 23:39:05 +0000 | |||
778 | @@ -20,6 +20,7 @@ | |||
779 | 20 | import re | 20 | import re |
780 | 21 | 21 | ||
781 | 22 | from breezy import ( | 22 | from breezy import ( |
782 | 23 | bzr, | ||
783 | 23 | config, | 24 | config, |
784 | 24 | controldir, | 25 | controldir, |
785 | 25 | errors, | 26 | errors, |
786 | @@ -27,9 +28,6 @@ | |||
787 | 27 | repository, | 28 | repository, |
788 | 28 | tests, | 29 | tests, |
789 | 29 | ) | 30 | ) |
790 | 30 | from breezy.bzr import ( | ||
791 | 31 | bzrdir, | ||
792 | 32 | ) | ||
793 | 33 | from breezy.bzr.groupcompress_repo import RepositoryFormat2a | 31 | from breezy.bzr.groupcompress_repo import RepositoryFormat2a |
794 | 34 | 32 | ||
795 | 35 | 33 | ||
796 | @@ -104,7 +102,7 @@ | |||
797 | 104 | TestObsoleteRepoFormat) | 102 | TestObsoleteRepoFormat) |
798 | 105 | repository.format_registry.register(TestObsoleteRepoFormat) | 103 | repository.format_registry.register(TestObsoleteRepoFormat) |
799 | 106 | self.addCleanup(controldir.format_registry.remove, "testobsolete") | 104 | self.addCleanup(controldir.format_registry.remove, "testobsolete") |
801 | 107 | bzrdir.register_metadir(controldir.format_registry, "testobsolete", | 105 | bzr.register_metadir(controldir.format_registry, "testobsolete", |
802 | 108 | "breezy.tests.blackbox.test_exceptions.TestObsoleteRepoFormat", | 106 | "breezy.tests.blackbox.test_exceptions.TestObsoleteRepoFormat", |
803 | 109 | branch_format='breezy.bzr.branch.BzrBranchFormat7', | 107 | branch_format='breezy.bzr.branch.BzrBranchFormat7', |
804 | 110 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat6', | 108 | tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat6', |
805 | 111 | 109 | ||
806 | === modified file 'breezy/tests/blackbox/test_upgrade.py' | |||
807 | --- breezy/tests/blackbox/test_upgrade.py 2017-06-10 16:40:42 +0000 | |||
808 | +++ breezy/tests/blackbox/test_upgrade.py 2017-06-15 23:39:05 +0000 | |||
809 | @@ -19,6 +19,7 @@ | |||
810 | 19 | import stat | 19 | import stat |
811 | 20 | 20 | ||
812 | 21 | from breezy import ( | 21 | from breezy import ( |
813 | 22 | bzr, | ||
814 | 22 | controldir, | 23 | controldir, |
815 | 23 | lockable_files, | 24 | lockable_files, |
816 | 24 | ui, | 25 | ui, |
817 | @@ -130,9 +131,9 @@ | |||
818 | 130 | 131 | ||
819 | 131 | def test_upgrade_control_dir(self): | 132 | def test_upgrade_control_dir(self): |
820 | 132 | old_format = OldBzrDirFormat() | 133 | old_format = OldBzrDirFormat() |
822 | 133 | self.addCleanup(bzrdir.BzrProber.formats.remove, | 134 | self.addCleanup(bzr.BzrProber.formats.remove, |
823 | 134 | old_format.get_format_string()) | 135 | old_format.get_format_string()) |
825 | 135 | bzrdir.BzrProber.formats.register(old_format.get_format_string(), | 136 | bzr.BzrProber.formats.register(old_format.get_format_string(), |
826 | 136 | old_format) | 137 | old_format) |
827 | 137 | self.addCleanup(controldir.ControlDirFormat._set_default_format, | 138 | self.addCleanup(controldir.ControlDirFormat._set_default_format, |
828 | 138 | controldir.ControlDirFormat.get_default_format()) | 139 | controldir.ControlDirFormat.get_default_format()) |
829 | 139 | 140 | ||
830 | === modified file 'breezy/tests/test_bzrdir.py' | |||
831 | --- breezy/tests/test_bzrdir.py 2017-06-11 14:07:05 +0000 | |||
832 | +++ breezy/tests/test_bzrdir.py 2017-06-15 23:39:05 +0000 | |||
833 | @@ -25,6 +25,7 @@ | |||
834 | 25 | 25 | ||
835 | 26 | from .. import ( | 26 | from .. import ( |
836 | 27 | branch, | 27 | branch, |
837 | 28 | bzr, | ||
838 | 28 | config, | 29 | config, |
839 | 29 | controldir, | 30 | controldir, |
840 | 30 | errors, | 31 | errors, |
841 | @@ -103,18 +104,18 @@ | |||
842 | 103 | my_format_registry.register_lazy('lazy', 'breezy.tests.test_bzrdir', | 104 | my_format_registry.register_lazy('lazy', 'breezy.tests.test_bzrdir', |
843 | 104 | 'DeprecatedBzrDirFormat', 'Format registered lazily', | 105 | 'DeprecatedBzrDirFormat', 'Format registered lazily', |
844 | 105 | deprecated=True) | 106 | deprecated=True) |
846 | 106 | bzrdir.register_metadir(my_format_registry, 'knit', | 107 | bzr.register_metadir(my_format_registry, 'knit', |
847 | 107 | 'breezy.bzr.knitrepo.RepositoryFormatKnit1', | 108 | 'breezy.bzr.knitrepo.RepositoryFormatKnit1', |
848 | 108 | 'Format using knits', | 109 | 'Format using knits', |
849 | 109 | ) | 110 | ) |
850 | 110 | my_format_registry.set_default('knit') | 111 | my_format_registry.set_default('knit') |
852 | 111 | bzrdir.register_metadir(my_format_registry, | 112 | bzr.register_metadir(my_format_registry, |
853 | 112 | 'branch6', | 113 | 'branch6', |
854 | 113 | 'breezy.bzr.knitrepo.RepositoryFormatKnit3', | 114 | 'breezy.bzr.knitrepo.RepositoryFormatKnit3', |
855 | 114 | 'Experimental successor to knit. Use at your own risk.', | 115 | 'Experimental successor to knit. Use at your own risk.', |
856 | 115 | branch_format='breezy.bzr.branch.BzrBranchFormat6', | 116 | branch_format='breezy.bzr.branch.BzrBranchFormat6', |
857 | 116 | experimental=True) | 117 | experimental=True) |
859 | 117 | bzrdir.register_metadir(my_format_registry, | 118 | bzr.register_metadir(my_format_registry, |
860 | 118 | 'hidden format', | 119 | 'hidden format', |
861 | 119 | 'breezy.bzr.knitrepo.RepositoryFormatKnit3', | 120 | 'breezy.bzr.knitrepo.RepositoryFormatKnit3', |
862 | 120 | 'Experimental successor to knit. Use at your own risk.', | 121 | 'Experimental successor to knit. Use at your own risk.', |
863 | @@ -281,13 +282,13 @@ | |||
864 | 281 | def test_find_format(self): | 282 | def test_find_format(self): |
865 | 282 | # is the right format object found for a branch? | 283 | # is the right format object found for a branch? |
866 | 283 | # create a branch with a few known format objects. | 284 | # create a branch with a few known format objects. |
868 | 284 | bzrdir.BzrProber.formats.register(BzrDirFormatTest1.get_format_string(), | 285 | bzr.BzrProber.formats.register(BzrDirFormatTest1.get_format_string(), |
869 | 285 | BzrDirFormatTest1()) | 286 | BzrDirFormatTest1()) |
871 | 286 | self.addCleanup(bzrdir.BzrProber.formats.remove, | 287 | self.addCleanup(bzr.BzrProber.formats.remove, |
872 | 287 | BzrDirFormatTest1.get_format_string()) | 288 | BzrDirFormatTest1.get_format_string()) |
874 | 288 | bzrdir.BzrProber.formats.register(BzrDirFormatTest2.get_format_string(), | 289 | bzr.BzrProber.formats.register(BzrDirFormatTest2.get_format_string(), |
875 | 289 | BzrDirFormatTest2()) | 290 | BzrDirFormatTest2()) |
877 | 290 | self.addCleanup(bzrdir.BzrProber.formats.remove, | 291 | self.addCleanup(bzr.BzrProber.formats.remove, |
878 | 291 | BzrDirFormatTest2.get_format_string()) | 292 | BzrDirFormatTest2.get_format_string()) |
879 | 292 | t = self.get_transport() | 293 | t = self.get_transport() |
880 | 293 | self.build_tree(["foo/", "bar/"], transport=t) | 294 | self.build_tree(["foo/", "bar/"], transport=t) |
881 | @@ -318,7 +319,7 @@ | |||
882 | 318 | # make a bzrdir | 319 | # make a bzrdir |
883 | 319 | format.initialize(url) | 320 | format.initialize(url) |
884 | 320 | # register a format for it. | 321 | # register a format for it. |
886 | 321 | bzrdir.BzrProber.formats.register(format.get_format_string(), format) | 322 | bzr.BzrProber.formats.register(format.get_format_string(), format) |
887 | 322 | # which bzrdir.Open will refuse (not supported) | 323 | # which bzrdir.Open will refuse (not supported) |
888 | 323 | self.assertRaises(UnsupportedFormatError, bzrdir.BzrDir.open, url) | 324 | self.assertRaises(UnsupportedFormatError, bzrdir.BzrDir.open, url) |
889 | 324 | # which bzrdir.open_containing will refuse (not supported) | 325 | # which bzrdir.open_containing will refuse (not supported) |
890 | @@ -327,7 +328,7 @@ | |||
891 | 327 | t = _mod_transport.get_transport_from_url(url) | 328 | t = _mod_transport.get_transport_from_url(url) |
892 | 328 | self.assertEqual(format.open(t), bzrdir.BzrDir.open_unsupported(url)) | 329 | self.assertEqual(format.open(t), bzrdir.BzrDir.open_unsupported(url)) |
893 | 329 | # unregister the format | 330 | # unregister the format |
895 | 330 | bzrdir.BzrProber.formats.remove(format.get_format_string()) | 331 | bzr.BzrProber.formats.remove(format.get_format_string()) |
896 | 331 | # now open_downlevel should fail too. | 332 | # now open_downlevel should fail too. |
897 | 332 | self.assertRaises(UnknownFormatError, bzrdir.BzrDir.open_unsupported, url) | 333 | self.assertRaises(UnknownFormatError, bzrdir.BzrDir.open_unsupported, url) |
898 | 333 | 334 | ||
899 | 334 | 335 | ||
900 | === modified file 'breezy/tests/test_options.py' | |||
901 | --- breezy/tests/test_options.py 2017-06-10 16:40:42 +0000 | |||
902 | +++ breezy/tests/test_options.py 2017-06-15 23:39:05 +0000 | |||
903 | @@ -17,15 +17,13 @@ | |||
904 | 17 | import re | 17 | import re |
905 | 18 | 18 | ||
906 | 19 | from .. import ( | 19 | from .. import ( |
907 | 20 | bzr, | ||
908 | 20 | commands, | 21 | commands, |
909 | 21 | controldir, | 22 | controldir, |
910 | 22 | errors, | 23 | errors, |
911 | 23 | option, | 24 | option, |
912 | 24 | registry, | 25 | registry, |
913 | 25 | ) | 26 | ) |
914 | 26 | from ..bzr import ( | ||
915 | 27 | bzrdir, | ||
916 | 28 | ) | ||
917 | 29 | from ..builtins import cmd_commit | 27 | from ..builtins import cmd_commit |
918 | 30 | from ..commands import parse_args | 28 | from ..commands import parse_args |
919 | 31 | from . import TestCase | 29 | from . import TestCase |
920 | @@ -120,9 +118,9 @@ | |||
921 | 120 | 118 | ||
922 | 121 | def test_registry_conversion(self): | 119 | def test_registry_conversion(self): |
923 | 122 | registry = controldir.ControlDirFormatRegistry() | 120 | registry = controldir.ControlDirFormatRegistry() |
927 | 123 | bzrdir.register_metadir(registry, 'one', 'RepositoryFormat7', 'one help') | 121 | bzr.register_metadir(registry, 'one', 'RepositoryFormat7', 'one help') |
928 | 124 | bzrdir.register_metadir(registry, 'two', 'RepositoryFormatKnit1', 'two help') | 122 | bzr.register_metadir(registry, 'two', 'RepositoryFormatKnit1', 'two help') |
929 | 125 | bzrdir.register_metadir(registry, 'hidden', 'RepositoryFormatKnit1', | 123 | bzr.register_metadir(registry, 'hidden', 'RepositoryFormatKnit1', |
930 | 126 | 'two help', hidden=True) | 124 | 'two help', hidden=True) |
931 | 127 | registry.set_default('one') | 125 | registry.set_default('one') |
932 | 128 | options = [option.RegistryOption('format', '', registry, str)] | 126 | options = [option.RegistryOption('format', '', registry, str)] |
933 | @@ -190,12 +188,12 @@ | |||
934 | 190 | 188 | ||
935 | 191 | def test_help(self): | 189 | def test_help(self): |
936 | 192 | registry = controldir.ControlDirFormatRegistry() | 190 | registry = controldir.ControlDirFormatRegistry() |
939 | 193 | bzrdir.register_metadir(registry, 'one', 'RepositoryFormat7', 'one help') | 191 | bzr.register_metadir(registry, 'one', 'RepositoryFormat7', 'one help') |
940 | 194 | bzrdir.register_metadir(registry, 'two', | 192 | bzr.register_metadir(registry, 'two', |
941 | 195 | 'breezy.bzr.knitrepo.RepositoryFormatKnit1', | 193 | 'breezy.bzr.knitrepo.RepositoryFormatKnit1', |
942 | 196 | 'two help', | 194 | 'two help', |
943 | 197 | ) | 195 | ) |
945 | 198 | bzrdir.register_metadir(registry, 'hidden', 'RepositoryFormat7', 'hidden help', | 196 | bzr.register_metadir(registry, 'hidden', 'RepositoryFormat7', 'hidden help', |
946 | 199 | hidden=True) | 197 | hidden=True) |
947 | 200 | registry.set_default('one') | 198 | registry.set_default('one') |
948 | 201 | options = [option.RegistryOption('format', 'format help', registry, | 199 | options = [option.RegistryOption('format', 'format help', registry, |
949 | @@ -218,8 +216,8 @@ | |||
950 | 218 | self.assertEqual(list(opt.iter_switches()), | 216 | self.assertEqual(list(opt.iter_switches()), |
951 | 219 | [('hello', None, 'GAR', 'fg')]) | 217 | [('hello', None, 'GAR', 'fg')]) |
952 | 220 | registry = controldir.ControlDirFormatRegistry() | 218 | registry = controldir.ControlDirFormatRegistry() |
955 | 221 | bzrdir.register_metadir(registry, 'one', 'RepositoryFormat7', 'one help') | 219 | bzr.register_metadir(registry, 'one', 'RepositoryFormat7', 'one help') |
956 | 222 | bzrdir.register_metadir(registry, 'two', | 220 | bzr.register_metadir(registry, 'two', |
957 | 223 | 'breezy.bzr.knitrepo.RepositoryFormatKnit1', | 221 | 'breezy.bzr.knitrepo.RepositoryFormatKnit1', |
958 | 224 | 'two help', | 222 | 'two help', |
959 | 225 | ) | 223 | ) |
960 | @@ -379,9 +377,9 @@ | |||
961 | 379 | 377 | ||
962 | 380 | def test_is_hidden(self): | 378 | def test_is_hidden(self): |
963 | 381 | registry = controldir.ControlDirFormatRegistry() | 379 | registry = controldir.ControlDirFormatRegistry() |
965 | 382 | bzrdir.register_metadir(registry, 'hidden', 'HiddenFormat', | 380 | bzr.register_metadir(registry, 'hidden', 'HiddenFormat', |
966 | 383 | 'hidden help text', hidden=True) | 381 | 'hidden help text', hidden=True) |
968 | 384 | bzrdir.register_metadir(registry, 'visible', 'VisibleFormat', | 382 | bzr.register_metadir(registry, 'visible', 'VisibleFormat', |
969 | 385 | 'visible help text', hidden=False) | 383 | 'visible help text', hidden=False) |
970 | 386 | format = option.RegistryOption('format', '', registry, str) | 384 | format = option.RegistryOption('format', '', registry, str) |
971 | 387 | self.assertTrue(format.is_hidden('hidden')) | 385 | self.assertTrue(format.is_hidden('hidden')) |
972 | 388 | 386 | ||
973 | === modified file 'breezy/tests/test_remote.py' | |||
974 | --- breezy/tests/test_remote.py 2017-06-11 20:15:04 +0000 | |||
975 | +++ breezy/tests/test_remote.py 2017-06-15 23:39:05 +0000 | |||
976 | @@ -49,6 +49,8 @@ | |||
977 | 49 | from ..bzr.bzrdir import ( | 49 | from ..bzr.bzrdir import ( |
978 | 50 | BzrDir, | 50 | BzrDir, |
979 | 51 | BzrDirFormat, | 51 | BzrDirFormat, |
980 | 52 | ) | ||
981 | 53 | from ..bzr import ( | ||
982 | 52 | RemoteBzrProber, | 54 | RemoteBzrProber, |
983 | 53 | ) | 55 | ) |
984 | 54 | from ..bzr.chk_serializer import chk_bencode_serializer | 56 | from ..bzr.chk_serializer import chk_bencode_serializer |
985 | @@ -127,7 +129,7 @@ | |||
986 | 127 | def test_find_correct_format(self): | 129 | def test_find_correct_format(self): |
987 | 128 | """Should open a RemoteBzrDir over a RemoteTransport""" | 130 | """Should open a RemoteBzrDir over a RemoteTransport""" |
988 | 129 | fmt = BzrDirFormat.find_format(self.transport) | 131 | fmt = BzrDirFormat.find_format(self.transport) |
990 | 130 | self.assertTrue(bzrdir.RemoteBzrProber | 132 | self.assertTrue(RemoteBzrProber |
991 | 131 | in controldir.ControlDirFormat._server_probers) | 133 | in controldir.ControlDirFormat._server_probers) |
992 | 132 | self.assertIsInstance(fmt, RemoteBzrDirFormat) | 134 | self.assertIsInstance(fmt, RemoteBzrDirFormat) |
993 | 133 | 135 | ||
994 | 134 | 136 | ||
995 | === modified file 'breezy/tests/test_url_policy_open.py' | |||
996 | --- breezy/tests/test_url_policy_open.py 2017-06-10 16:40:42 +0000 | |||
997 | +++ breezy/tests/test_url_policy_open.py 2017-06-15 23:39:05 +0000 | |||
998 | @@ -23,7 +23,7 @@ | |||
999 | 23 | from ..bzr.branch import ( | 23 | from ..bzr.branch import ( |
1000 | 24 | BranchReferenceFormat, | 24 | BranchReferenceFormat, |
1001 | 25 | ) | 25 | ) |
1003 | 26 | from ..bzr.bzrdir import ( | 26 | from ..bzr import ( |
1004 | 27 | BzrProber, | 27 | BzrProber, |
1005 | 28 | ) | 28 | ) |
1006 | 29 | from ..controldir import ( | 29 | from ..controldir import ( |
1007 | 30 | 30 | ||
1008 | === modified file 'tools/generate_docs.py' | |||
1009 | --- tools/generate_docs.py 2017-06-13 01:08:49 +0000 | |||
1010 | +++ tools/generate_docs.py 2017-06-15 23:39:05 +0000 | |||
1011 | @@ -38,12 +38,11 @@ | |||
1012 | 38 | 38 | ||
1013 | 39 | sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) | 39 | sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) |
1014 | 40 | 40 | ||
1016 | 41 | import breezy | 41 | # Don't remove the following import, it triggers a format registration that |
1017 | 42 | # avoid http://pad.lv/956860 | ||
1018 | 43 | import breezy.bzr | ||
1019 | 42 | from breezy import ( | 44 | from breezy import ( |
1020 | 43 | commands, | 45 | commands, |
1021 | 44 | # Don't remove the following import, it triggers a format registration that | ||
1022 | 45 | # avoid http://pad.lv/956860 | ||
1023 | 46 | branch, | ||
1024 | 47 | doc_generate, | 46 | doc_generate, |
1025 | 48 | ) | 47 | ) |
1026 | 49 | 48 |
Looks good, as all imports are from a level up rather than siblings.