Merge lp:~jelmer/brz/move-registration into lp:brz

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
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
Martin Packman (gz) wrote :

Looks good, as all imports are from a level up rather than siblings.

review: Approve
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :

Running landing tests failed
http://10.242.247.184:8080/job/brz-dev/140/

Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :

Running landing tests failed
http://10.242.247.184:8080/job/brz-dev/142/

Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :

Running landing tests failed
http://10.242.247.184:8080/job/brz-dev/143/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'breezy/builtins.py'
--- breezy/builtins.py 2017-06-15 22:34:55 +0000
+++ breezy/builtins.py 2017-06-15 23:39:05 +0000
@@ -22,7 +22,7 @@
22import os22import os
23import sys23import sys
2424
25import breezy.bzr.bzrdir25import breezy.bzr
2626
27from . import lazy_import27from . import lazy_import
28lazy_import.lazy_import(globals(), """28lazy_import.lazy_import(globals(), """
2929
=== modified file 'breezy/bzr/__init__.py'
--- breezy/bzr/__init__.py 2017-06-10 01:39:46 +0000
+++ breezy/bzr/__init__.py 2017-06-15 23:39:05 +0000
@@ -15,3 +15,339 @@
15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1616
17from __future__ import absolute_import17from __future__ import absolute_import
18
19from .. import (
20 config,
21 errors,
22 controldir,
23 pyutils,
24 registry,
25 )
26
27class BzrProber(controldir.Prober):
28 """Prober for formats that use a .bzr/ control directory."""
29
30 formats = registry.FormatRegistry(controldir.network_format_registry)
31 """The known .bzr formats."""
32
33 @classmethod
34 def probe_transport(klass, transport):
35 """Return the .bzrdir style format present in a directory."""
36 try:
37 format_string = transport.get_bytes(".bzr/branch-format")
38 # GZ 2017-06-09: Where should format strings get decoded...
39 format_text = format_string.decode("ascii")
40 except errors.NoSuchFile:
41 raise errors.NotBranchError(path=transport.base)
42 try:
43 first_line = format_text[:format_text.index("\n")+1]
44 except ValueError:
45 first_line = format_text
46 try:
47 cls = klass.formats.get(first_line)
48 except KeyError:
49 raise errors.UnknownFormatError(format=first_line, kind='bzrdir')
50 return cls.from_string(format_text)
51
52 @classmethod
53 def known_formats(cls):
54 result = set()
55 for name, format in cls.formats.items():
56 if callable(format):
57 format = format()
58 result.add(format)
59 return result
60
61
62controldir.ControlDirFormat.register_prober(BzrProber)
63
64
65class RemoteBzrProber(controldir.Prober):
66 """Prober for remote servers that provide a Bazaar smart server."""
67
68 @classmethod
69 def probe_transport(klass, transport):
70 """Return a RemoteBzrDirFormat object if it looks possible."""
71 try:
72 medium = transport.get_smart_medium()
73 except (NotImplementedError, AttributeError,
74 errors.TransportNotPossible, errors.NoSmartMedium,
75 errors.SmartProtocolError):
76 # no smart server, so not a branch for this format type.
77 raise errors.NotBranchError(path=transport.base)
78 else:
79 # Decline to open it if the server doesn't support our required
80 # version (3) so that the VFS-based transport will do it.
81 if medium.should_probe():
82 try:
83 server_version = medium.protocol_version()
84 except errors.SmartProtocolError:
85 # Apparently there's no usable smart server there, even though
86 # the medium supports the smart protocol.
87 raise errors.NotBranchError(path=transport.base)
88 if server_version != '2':
89 raise errors.NotBranchError(path=transport.base)
90 from .remote import RemoteBzrDirFormat
91 return RemoteBzrDirFormat()
92
93 @classmethod
94 def known_formats(cls):
95 from .remote import RemoteBzrDirFormat
96 return {RemoteBzrDirFormat()}
97
98
99controldir.ControlDirFormat.register_server_prober(RemoteBzrProber)
100
101# Register bzr formats
102BzrProber.formats.register_lazy(
103 "Bazaar-NG meta directory, format 1\n",
104 __name__ + '.bzrdir', 'BzrDirMetaFormat1')
105BzrProber.formats.register_lazy(
106 "Bazaar meta directory, format 1 (with colocated branches)\n",
107 __name__ + '.bzrdir', 'BzrDirMetaFormat1Colo')
108
109
110def register_metadir(registry, key,
111 repository_format, help, native=True, deprecated=False,
112 branch_format=None,
113 tree_format=None,
114 hidden=False,
115 experimental=False,
116 alias=False, bzrdir_format=None):
117 """Register a metadir subformat.
118
119 These all use a meta bzrdir, but can be parameterized by the
120 Repository/Branch/WorkingTreeformats.
121
122 :param repository_format: The fully-qualified repository format class
123 name as a string.
124 :param branch_format: Fully-qualified branch format class name as
125 a string.
126 :param tree_format: Fully-qualified tree format class name as
127 a string.
128 """
129 if bzrdir_format is None:
130 bzrdir_format = 'breezy.bzr.bzrdir.BzrDirMetaFormat1'
131 # This should be expanded to support setting WorkingTree and Branch
132 # formats, once the API supports that.
133 def _load(full_name):
134 mod_name, factory_name = full_name.rsplit('.', 1)
135 try:
136 factory = pyutils.get_named_object(mod_name, factory_name)
137 except ImportError as e:
138 raise ImportError('failed to load %s: %s' % (full_name, e))
139 except AttributeError:
140 raise AttributeError('no factory %s in module %r'
141 % (full_name, sys.modules[mod_name]))
142 return factory()
143
144 def helper():
145 bd = _load(bzrdir_format)
146 if branch_format is not None:
147 bd.set_branch_format(_load(branch_format))
148 if tree_format is not None:
149 bd.workingtree_format = _load(tree_format)
150 if repository_format is not None:
151 bd.repository_format = _load(repository_format)
152 return bd
153 registry.register(key, helper, help, native, deprecated, hidden,
154 experimental, alias)
155
156register_metadir(controldir.format_registry, 'knit',
157 'breezy.bzr.knitrepo.RepositoryFormatKnit1',
158 'Format using knits. Recommended for interoperation with bzr <= 0.14.',
159 branch_format='breezy.bzr.fullhistory.BzrBranchFormat5',
160 tree_format='breezy.bzr.workingtree_3.WorkingTreeFormat3',
161 hidden=True,
162 deprecated=True)
163register_metadir(controldir.format_registry, 'dirstate',
164 'breezy.bzr.knitrepo.RepositoryFormatKnit1',
165 help='Format using dirstate for working trees. '
166 'Compatible with bzr 0.8 and '
167 'above when accessed over the network. Introduced in bzr 0.15.',
168 branch_format='breezy.bzr.fullhistory.BzrBranchFormat5',
169 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4',
170 hidden=True,
171 deprecated=True)
172register_metadir(controldir.format_registry, 'dirstate-tags',
173 'breezy.bzr.knitrepo.RepositoryFormatKnit1',
174 help='Variant of dirstate with support for tags. '
175 'Introduced in bzr 0.15.',
176 branch_format='breezy.bzr.branch.BzrBranchFormat6',
177 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4',
178 hidden=True,
179 deprecated=True)
180register_metadir(controldir.format_registry, 'rich-root',
181 'breezy.bzr.knitrepo.RepositoryFormatKnit4',
182 help='Variant of dirstate with better handling of tree roots. '
183 'Introduced in bzr 1.0',
184 branch_format='breezy.bzr.branch.BzrBranchFormat6',
185 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4',
186 hidden=True,
187 deprecated=True)
188register_metadir(controldir.format_registry, 'dirstate-with-subtree',
189 'breezy.bzr.knitrepo.RepositoryFormatKnit3',
190 help='Variant of dirstate with support for nested trees. '
191 'Introduced in 0.15.',
192 branch_format='breezy.bzr.branch.BzrBranchFormat6',
193 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4',
194 experimental=True,
195 hidden=True,
196 )
197register_metadir(controldir.format_registry, 'pack-0.92',
198 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack1',
199 help='Pack-based format used in 1.x series. Introduced in 0.92. '
200 'Interoperates with bzr repositories before 0.92 but cannot be '
201 'read by bzr < 0.92. '
202 ,
203 branch_format='breezy.bzr.branch.BzrBranchFormat6',
204 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4',
205 deprecated=True,
206 )
207register_metadir(controldir.format_registry, 'pack-0.92-subtree',
208 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack3',
209 help='Pack-based format used in 1.x series, with subtree support. '
210 'Introduced in 0.92. Interoperates with '
211 'bzr repositories before 0.92 but cannot be read by bzr < 0.92. '
212 ,
213 branch_format='breezy.bzr.branch.BzrBranchFormat6',
214 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4',
215 hidden=True,
216 deprecated=True,
217 experimental=True,
218 )
219register_metadir(controldir.format_registry, 'rich-root-pack',
220 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack4',
221 help='A variant of pack-0.92 that supports rich-root data '
222 '(needed for bzr-svn and bzr-git). Introduced in 1.0.',
223 branch_format='breezy.bzr.branch.BzrBranchFormat6',
224 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4',
225 hidden=True,
226 deprecated=True,
227 )
228register_metadir(controldir.format_registry, '1.6',
229 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack5',
230 help='A format that allows a branch to indicate that there is another '
231 '(stacked) repository that should be used to access data that is '
232 'not present locally.',
233 branch_format='breezy.bzr.branch.BzrBranchFormat7',
234 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4',
235 hidden=True,
236 deprecated=True,
237 )
238register_metadir(controldir.format_registry, '1.6.1-rich-root',
239 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack5RichRoot',
240 help='A variant of 1.6 that supports rich-root data '
241 '(needed for bzr-svn and bzr-git).',
242 branch_format='breezy.bzr.branch.BzrBranchFormat7',
243 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4',
244 hidden=True,
245 deprecated=True,
246 )
247register_metadir(controldir.format_registry, '1.9',
248 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack6',
249 help='A repository format using B+tree indexes. These indexes '
250 'are smaller in size, have smarter caching and provide faster '
251 'performance for most operations.',
252 branch_format='breezy.bzr.branch.BzrBranchFormat7',
253 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4',
254 hidden=True,
255 deprecated=True,
256 )
257register_metadir(controldir.format_registry, '1.9-rich-root',
258 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack6RichRoot',
259 help='A variant of 1.9 that supports rich-root data '
260 '(needed for bzr-svn and bzr-git).',
261 branch_format='breezy.bzr.branch.BzrBranchFormat7',
262 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4',
263 hidden=True,
264 deprecated=True,
265 )
266register_metadir(controldir.format_registry, '1.14',
267 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack6',
268 help='A working-tree format that supports content filtering.',
269 branch_format='breezy.bzr.branch.BzrBranchFormat7',
270 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat5',
271 hidden=True,
272 deprecated=True,
273 )
274register_metadir(controldir.format_registry, '1.14-rich-root',
275 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack6RichRoot',
276 help='A variant of 1.14 that supports rich-root data '
277 '(needed for bzr-svn and bzr-git).',
278 branch_format='breezy.bzr.branch.BzrBranchFormat7',
279 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat5',
280 hidden=True,
281 deprecated=True,
282 )
283# The following un-numbered 'development' formats should always just be aliases.
284register_metadir(controldir.format_registry, 'development-subtree',
285 'breezy.bzr.groupcompress_repo.RepositoryFormat2aSubtree',
286 help='Current development format, subtree variant. Can convert data to and '
287 'from pack-0.92-subtree (and anything compatible with '
288 'pack-0.92-subtree) format repositories. Repositories and branches in '
289 'this format can only be read by bzr.dev. Please read '
290 'http://doc.bazaar.canonical.com/latest/developers/development-repo.html '
291 'before use.',
292 branch_format='breezy.bzr.branch.BzrBranchFormat7',
293 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat6',
294 experimental=True,
295 hidden=True,
296 alias=False, # Restore to being an alias when an actual development subtree format is added
297 # This current non-alias status is simply because we did not introduce a
298 # chk based subtree format.
299 )
300register_metadir(controldir.format_registry, 'development5-subtree',
301 'breezy.bzr.knitpack_repo.RepositoryFormatPackDevelopment2Subtree',
302 help='Development format, subtree variant. Can convert data to and '
303 'from pack-0.92-subtree (and anything compatible with '
304 'pack-0.92-subtree) format repositories. Repositories and branches in '
305 'this format can only be read by bzr.dev. Please read '
306 'http://doc.bazaar.canonical.com/latest/developers/development-repo.html '
307 'before use.',
308 branch_format='breezy.bzr.branch.BzrBranchFormat7',
309 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat6',
310 experimental=True,
311 hidden=True,
312 alias=False,
313 )
314
315register_metadir(controldir.format_registry, 'development-colo',
316 'breezy.bzr.groupcompress_repo.RepositoryFormat2a',
317 help='The 2a format with experimental support for colocated branches.\n',
318 branch_format='breezy.bzr.branch.BzrBranchFormat7',
319 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat6',
320 experimental=True,
321 bzrdir_format='breezy.bzr.bzrdir.BzrDirMetaFormat1Colo',
322 )
323
324
325# And the development formats above will have aliased one of the following:
326
327# Finally, the current format.
328register_metadir(controldir.format_registry, '2a',
329 'breezy.bzr.groupcompress_repo.RepositoryFormat2a',
330 help='Format for the bzr 2.0 series.\n'
331 'Uses group-compress storage.\n'
332 'Provides rich roots which are a one-way transition.\n',
333 # 'storage in packs, 255-way hashed CHK inventory, bencode revision, group compress, '
334 # 'rich roots. Supported by bzr 1.16 and later.',
335 branch_format='breezy.bzr.branch.BzrBranchFormat7',
336 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat6',
337 experimental=False,
338 )
339
340# The following format should be an alias for the rich root equivalent
341# of the default format
342register_metadir(controldir.format_registry, 'default-rich-root',
343 'breezy.bzr.groupcompress_repo.RepositoryFormat2a',
344 branch_format='breezy.bzr.branch.BzrBranchFormat7',
345 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat6',
346 alias=True,
347 hidden=True,
348 help='Same as 2a.')
349
350
351# The current format that is made on 'bzr init'.
352format_name = config.GlobalStack().get('default_format')
353controldir.format_registry.set_default(format_name)
18354
=== modified file 'breezy/bzr/bzrdir.py'
--- breezy/bzr/bzrdir.py 2017-06-11 14:07:05 +0000
+++ breezy/bzr/bzrdir.py 2017-06-15 23:39:05 +0000
@@ -1223,78 +1223,6 @@
1223 self.features[name] = necessity1223 self.features[name] = necessity
12241224
12251225
1226class BzrProber(controldir.Prober):
1227 """Prober for formats that use a .bzr/ control directory."""
1228
1229 formats = registry.FormatRegistry(controldir.network_format_registry)
1230 """The known .bzr formats."""
1231
1232 @classmethod
1233 def probe_transport(klass, transport):
1234 """Return the .bzrdir style format present in a directory."""
1235 try:
1236 format_string = transport.get_bytes(".bzr/branch-format")
1237 # GZ 2017-06-09: Where should format strings get decoded...
1238 format_text = format_string.decode("ascii")
1239 except errors.NoSuchFile:
1240 raise errors.NotBranchError(path=transport.base)
1241 try:
1242 first_line = format_text[:format_text.index("\n")+1]
1243 except ValueError:
1244 first_line = format_text
1245 try:
1246 cls = klass.formats.get(first_line)
1247 except KeyError:
1248 raise errors.UnknownFormatError(format=first_line, kind='bzrdir')
1249 return cls.from_string(format_text)
1250
1251 @classmethod
1252 def known_formats(cls):
1253 result = set()
1254 for name, format in cls.formats.items():
1255 if callable(format):
1256 format = format()
1257 result.add(format)
1258 return result
1259
1260
1261controldir.ControlDirFormat.register_prober(BzrProber)
1262
1263
1264class RemoteBzrProber(controldir.Prober):
1265 """Prober for remote servers that provide a Bazaar smart server."""
1266
1267 @classmethod
1268 def probe_transport(klass, transport):
1269 """Return a RemoteBzrDirFormat object if it looks possible."""
1270 try:
1271 medium = transport.get_smart_medium()
1272 except (NotImplementedError, AttributeError,
1273 errors.TransportNotPossible, errors.NoSmartMedium,
1274 errors.SmartProtocolError):
1275 # no smart server, so not a branch for this format type.
1276 raise errors.NotBranchError(path=transport.base)
1277 else:
1278 # Decline to open it if the server doesn't support our required
1279 # version (3) so that the VFS-based transport will do it.
1280 if medium.should_probe():
1281 try:
1282 server_version = medium.protocol_version()
1283 except errors.SmartProtocolError:
1284 # Apparently there's no usable smart server there, even though
1285 # the medium supports the smart protocol.
1286 raise errors.NotBranchError(path=transport.base)
1287 if server_version != '2':
1288 raise errors.NotBranchError(path=transport.base)
1289 from .remote import RemoteBzrDirFormat
1290 return RemoteBzrDirFormat()
1291
1292 @classmethod
1293 def known_formats(cls):
1294 from .remote import RemoteBzrDirFormat
1295 return {RemoteBzrDirFormat()}
1296
1297
1298class BzrDirFormat(BzrFormat, controldir.ControlDirFormat):1226class BzrDirFormat(BzrFormat, controldir.ControlDirFormat):
1299 """ControlDirFormat base class for .bzr/ directories.1227 """ControlDirFormat base class for .bzr/ directories.
13001228
@@ -1745,12 +1673,6 @@
1745 __set_workingtree_format)1673 __set_workingtree_format)
17461674
17471675
1748# Register bzr formats
1749BzrProber.formats.register(BzrDirMetaFormat1.get_format_string(),
1750 BzrDirMetaFormat1)
1751controldir.ControlDirFormat._default_format = BzrDirMetaFormat1()
1752
1753
1754class BzrDirMetaFormat1Colo(BzrDirMetaFormat1):1676class BzrDirMetaFormat1Colo(BzrDirMetaFormat1):
1755 """BzrDirMeta1 format with support for colocated branches."""1677 """BzrDirMeta1 format with support for colocated branches."""
17561678
@@ -1775,10 +1697,6 @@
1775 return BzrDirMeta1(transport, format)1697 return BzrDirMeta1(transport, format)
17761698
17771699
1778BzrProber.formats.register(BzrDirMetaFormat1Colo.get_format_string(),
1779 BzrDirMetaFormat1Colo)
1780
1781
1782class ConvertMetaToMeta(controldir.Converter):1700class ConvertMetaToMeta(controldir.Converter):
1783 """Converts the components of metadirs."""1701 """Converts the components of metadirs."""
17841702
@@ -1892,9 +1810,6 @@
1892 return BzrDir.open_from_transport(to_convert.root_transport)1810 return BzrDir.open_from_transport(to_convert.root_transport)
18931811
18941812
1895controldir.ControlDirFormat.register_server_prober(RemoteBzrProber)
1896
1897
1898class RepositoryAcquisitionPolicy(object):1813class RepositoryAcquisitionPolicy(object):
1899 """Abstract base class for repository acquisition policies.1814 """Abstract base class for repository acquisition policies.
19001815
@@ -2066,246 +1981,4 @@
2066 return self._repository, False1981 return self._repository, False
20671982
20681983
2069def register_metadir(registry, key,1984controldir.ControlDirFormat._default_format = BzrDirMetaFormat1()
2070 repository_format, help, native=True, deprecated=False,
2071 branch_format=None,
2072 tree_format=None,
2073 hidden=False,
2074 experimental=False,
2075 alias=False, bzrdir_format=None):
2076 """Register a metadir subformat.
2077
2078 These all use a meta bzrdir, but can be parameterized by the
2079 Repository/Branch/WorkingTreeformats.
2080
2081 :param repository_format: The fully-qualified repository format class
2082 name as a string.
2083 :param branch_format: Fully-qualified branch format class name as
2084 a string.
2085 :param tree_format: Fully-qualified tree format class name as
2086 a string.
2087 """
2088 if bzrdir_format is None:
2089 bzrdir_format = BzrDirMetaFormat1
2090 # This should be expanded to support setting WorkingTree and Branch
2091 # formats, once the API supports that.
2092 def _load(full_name):
2093 mod_name, factory_name = full_name.rsplit('.', 1)
2094 try:
2095 factory = pyutils.get_named_object(mod_name, factory_name)
2096 except ImportError as e:
2097 raise ImportError('failed to load %s: %s' % (full_name, e))
2098 except AttributeError:
2099 raise AttributeError('no factory %s in module %r'
2100 % (full_name, sys.modules[mod_name]))
2101 return factory()
2102
2103 def helper():
2104 bd = bzrdir_format()
2105 if branch_format is not None:
2106 bd.set_branch_format(_load(branch_format))
2107 if tree_format is not None:
2108 bd.workingtree_format = _load(tree_format)
2109 if repository_format is not None:
2110 bd.repository_format = _load(repository_format)
2111 return bd
2112 registry.register(key, helper, help, native, deprecated, hidden,
2113 experimental, alias)
2114
2115register_metadir(controldir.format_registry, 'knit',
2116 'breezy.bzr.knitrepo.RepositoryFormatKnit1',
2117 'Format using knits. Recommended for interoperation with bzr <= 0.14.',
2118 branch_format='breezy.bzr.fullhistory.BzrBranchFormat5',
2119 tree_format='breezy.bzr.workingtree_3.WorkingTreeFormat3',
2120 hidden=True,
2121 deprecated=True)
2122register_metadir(controldir.format_registry, 'dirstate',
2123 'breezy.bzr.knitrepo.RepositoryFormatKnit1',
2124 help='Format using dirstate for working trees. '
2125 'Compatible with bzr 0.8 and '
2126 'above when accessed over the network. Introduced in bzr 0.15.',
2127 branch_format='breezy.bzr.fullhistory.BzrBranchFormat5',
2128 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4',
2129 hidden=True,
2130 deprecated=True)
2131register_metadir(controldir.format_registry, 'dirstate-tags',
2132 'breezy.bzr.knitrepo.RepositoryFormatKnit1',
2133 help='Variant of dirstate with support for tags. '
2134 'Introduced in bzr 0.15.',
2135 branch_format='breezy.bzr.branch.BzrBranchFormat6',
2136 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4',
2137 hidden=True,
2138 deprecated=True)
2139register_metadir(controldir.format_registry, 'rich-root',
2140 'breezy.bzr.knitrepo.RepositoryFormatKnit4',
2141 help='Variant of dirstate with better handling of tree roots. '
2142 'Introduced in bzr 1.0',
2143 branch_format='breezy.bzr.branch.BzrBranchFormat6',
2144 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4',
2145 hidden=True,
2146 deprecated=True)
2147register_metadir(controldir.format_registry, 'dirstate-with-subtree',
2148 'breezy.bzr.knitrepo.RepositoryFormatKnit3',
2149 help='Variant of dirstate with support for nested trees. '
2150 'Introduced in 0.15.',
2151 branch_format='breezy.bzr.branch.BzrBranchFormat6',
2152 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4',
2153 experimental=True,
2154 hidden=True,
2155 )
2156register_metadir(controldir.format_registry, 'pack-0.92',
2157 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack1',
2158 help='Pack-based format used in 1.x series. Introduced in 0.92. '
2159 'Interoperates with bzr repositories before 0.92 but cannot be '
2160 'read by bzr < 0.92. '
2161 ,
2162 branch_format='breezy.bzr.branch.BzrBranchFormat6',
2163 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4',
2164 deprecated=True,
2165 )
2166register_metadir(controldir.format_registry, 'pack-0.92-subtree',
2167 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack3',
2168 help='Pack-based format used in 1.x series, with subtree support. '
2169 'Introduced in 0.92. Interoperates with '
2170 'bzr repositories before 0.92 but cannot be read by bzr < 0.92. '
2171 ,
2172 branch_format='breezy.bzr.branch.BzrBranchFormat6',
2173 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4',
2174 hidden=True,
2175 deprecated=True,
2176 experimental=True,
2177 )
2178register_metadir(controldir.format_registry, 'rich-root-pack',
2179 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack4',
2180 help='A variant of pack-0.92 that supports rich-root data '
2181 '(needed for bzr-svn and bzr-git). Introduced in 1.0.',
2182 branch_format='breezy.bzr.branch.BzrBranchFormat6',
2183 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4',
2184 hidden=True,
2185 deprecated=True,
2186 )
2187register_metadir(controldir.format_registry, '1.6',
2188 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack5',
2189 help='A format that allows a branch to indicate that there is another '
2190 '(stacked) repository that should be used to access data that is '
2191 'not present locally.',
2192 branch_format='breezy.bzr.branch.BzrBranchFormat7',
2193 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4',
2194 hidden=True,
2195 deprecated=True,
2196 )
2197register_metadir(controldir.format_registry, '1.6.1-rich-root',
2198 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack5RichRoot',
2199 help='A variant of 1.6 that supports rich-root data '
2200 '(needed for bzr-svn and bzr-git).',
2201 branch_format='breezy.bzr.branch.BzrBranchFormat7',
2202 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4',
2203 hidden=True,
2204 deprecated=True,
2205 )
2206register_metadir(controldir.format_registry, '1.9',
2207 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack6',
2208 help='A repository format using B+tree indexes. These indexes '
2209 'are smaller in size, have smarter caching and provide faster '
2210 'performance for most operations.',
2211 branch_format='breezy.bzr.branch.BzrBranchFormat7',
2212 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4',
2213 hidden=True,
2214 deprecated=True,
2215 )
2216register_metadir(controldir.format_registry, '1.9-rich-root',
2217 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack6RichRoot',
2218 help='A variant of 1.9 that supports rich-root data '
2219 '(needed for bzr-svn and bzr-git).',
2220 branch_format='breezy.bzr.branch.BzrBranchFormat7',
2221 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat4',
2222 hidden=True,
2223 deprecated=True,
2224 )
2225register_metadir(controldir.format_registry, '1.14',
2226 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack6',
2227 help='A working-tree format that supports content filtering.',
2228 branch_format='breezy.bzr.branch.BzrBranchFormat7',
2229 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat5',
2230 hidden=True,
2231 deprecated=True,
2232 )
2233register_metadir(controldir.format_registry, '1.14-rich-root',
2234 'breezy.bzr.knitpack_repo.RepositoryFormatKnitPack6RichRoot',
2235 help='A variant of 1.14 that supports rich-root data '
2236 '(needed for bzr-svn and bzr-git).',
2237 branch_format='breezy.bzr.branch.BzrBranchFormat7',
2238 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat5',
2239 hidden=True,
2240 deprecated=True,
2241 )
2242# The following un-numbered 'development' formats should always just be aliases.
2243register_metadir(controldir.format_registry, 'development-subtree',
2244 'breezy.bzr.groupcompress_repo.RepositoryFormat2aSubtree',
2245 help='Current development format, subtree variant. Can convert data to and '
2246 'from pack-0.92-subtree (and anything compatible with '
2247 'pack-0.92-subtree) format repositories. Repositories and branches in '
2248 'this format can only be read by bzr.dev. Please read '
2249 'http://doc.bazaar.canonical.com/latest/developers/development-repo.html '
2250 'before use.',
2251 branch_format='breezy.bzr.branch.BzrBranchFormat7',
2252 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat6',
2253 experimental=True,
2254 hidden=True,
2255 alias=False, # Restore to being an alias when an actual development subtree format is added
2256 # This current non-alias status is simply because we did not introduce a
2257 # chk based subtree format.
2258 )
2259register_metadir(controldir.format_registry, 'development5-subtree',
2260 'breezy.bzr.knitpack_repo.RepositoryFormatPackDevelopment2Subtree',
2261 help='Development format, subtree variant. Can convert data to and '
2262 'from pack-0.92-subtree (and anything compatible with '
2263 'pack-0.92-subtree) format repositories. Repositories and branches in '
2264 'this format can only be read by bzr.dev. Please read '
2265 'http://doc.bazaar.canonical.com/latest/developers/development-repo.html '
2266 'before use.',
2267 branch_format='breezy.bzr.branch.BzrBranchFormat7',
2268 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat6',
2269 experimental=True,
2270 hidden=True,
2271 alias=False,
2272 )
2273
2274register_metadir(controldir.format_registry, 'development-colo',
2275 'breezy.bzr.groupcompress_repo.RepositoryFormat2a',
2276 help='The 2a format with experimental support for colocated branches.\n',
2277 branch_format='breezy.bzr.branch.BzrBranchFormat7',
2278 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat6',
2279 experimental=True,
2280 bzrdir_format=BzrDirMetaFormat1Colo,
2281 )
2282
2283
2284# And the development formats above will have aliased one of the following:
2285
2286# Finally, the current format.
2287register_metadir(controldir.format_registry, '2a',
2288 'breezy.bzr.groupcompress_repo.RepositoryFormat2a',
2289 help='Format for the bzr 2.0 series.\n'
2290 'Uses group-compress storage.\n'
2291 'Provides rich roots which are a one-way transition.\n',
2292 # 'storage in packs, 255-way hashed CHK inventory, bencode revision, group compress, '
2293 # 'rich roots. Supported by bzr 1.16 and later.',
2294 branch_format='breezy.bzr.branch.BzrBranchFormat7',
2295 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat6',
2296 experimental=False,
2297 )
2298
2299# The following format should be an alias for the rich root equivalent
2300# of the default format
2301register_metadir(controldir.format_registry, 'default-rich-root',
2302 'breezy.bzr.groupcompress_repo.RepositoryFormat2a',
2303 branch_format='breezy.bzr.branch.BzrBranchFormat7',
2304 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat6',
2305 alias=True,
2306 hidden=True,
2307 help='Same as 2a.')
2308
2309# The current format that is made on 'bzr init'.
2310format_name = config.GlobalStack().get('default_format')
2311controldir.format_registry.set_default(format_name)
23121985
=== modified file 'breezy/bzr/remote.py'
--- breezy/bzr/remote.py 2017-06-14 23:29:06 +0000
+++ breezy/bzr/remote.py 2017-06-15 23:39:05 +0000
@@ -22,6 +22,7 @@
22from .. import (22from .. import (
23 bencode,23 bencode,
24 branch,24 branch,
25 bzr as _mod_bzr,
25 config as _mod_config,26 config as _mod_config,
26 controldir,27 controldir,
27 debug,28 debug,
@@ -490,7 +491,7 @@
490 warning('VFS BzrDir access triggered\n%s',491 warning('VFS BzrDir access triggered\n%s',
491 ''.join(traceback.format_stack()))492 ''.join(traceback.format_stack()))
492 self._real_bzrdir = _mod_bzrdir.BzrDir.open_from_transport(493 self._real_bzrdir = _mod_bzrdir.BzrDir.open_from_transport(
493 self.root_transport, probers=[_mod_bzrdir.BzrProber])494 self.root_transport, probers=[_mod_bzr.BzrProber])
494 self._format._network_name = \495 self._format._network_name = \
495 self._real_bzrdir._format.network_name()496 self._real_bzrdir._format.network_name()
496497
497498
=== modified file 'breezy/bzr/smart/bzrdir.py'
--- breezy/bzr/smart/bzrdir.py 2017-06-11 20:15:04 +0000
+++ breezy/bzr/smart/bzrdir.py 2017-06-15 23:39:05 +0000
@@ -25,10 +25,12 @@
25 repository,25 repository,
26 urlutils,26 urlutils,
27 )27 )
28from .. import (
29 BzrProber,
30 )
28from ..bzrdir import (31from ..bzrdir import (
29 BzrDir,32 BzrDir,
30 BzrDirFormat,33 BzrDirFormat,
31 BzrProber,
32 )34 )
33from ...controldir import (35from ...controldir import (
34 network_format_registry,36 network_format_registry,
3537
=== modified file 'breezy/plugins/weave_fmt/__init__.py'
--- breezy/plugins/weave_fmt/__init__.py 2017-06-11 20:33:20 +0000
+++ breezy/plugins/weave_fmt/__init__.py 2017-06-15 23:39:05 +0000
@@ -33,7 +33,7 @@
33from ...bzr import (33from ...bzr import (
34 serializer,34 serializer,
35 )35 )
36from ...bzr.bzrdir import (36from ...bzr import (
37 BzrProber,37 BzrProber,
38 register_metadir,38 register_metadir,
39 )39 )
4040
=== modified file 'breezy/tests/blackbox/test_exceptions.py'
--- breezy/tests/blackbox/test_exceptions.py 2017-06-11 01:22:16 +0000
+++ breezy/tests/blackbox/test_exceptions.py 2017-06-15 23:39:05 +0000
@@ -20,6 +20,7 @@
20import re20import re
2121
22from breezy import (22from breezy import (
23 bzr,
23 config,24 config,
24 controldir,25 controldir,
25 errors,26 errors,
@@ -27,9 +28,6 @@
27 repository,28 repository,
28 tests,29 tests,
29 )30 )
30from breezy.bzr import (
31 bzrdir,
32 )
33from breezy.bzr.groupcompress_repo import RepositoryFormat2a31from breezy.bzr.groupcompress_repo import RepositoryFormat2a
3432
3533
@@ -104,7 +102,7 @@
104 TestObsoleteRepoFormat)102 TestObsoleteRepoFormat)
105 repository.format_registry.register(TestObsoleteRepoFormat)103 repository.format_registry.register(TestObsoleteRepoFormat)
106 self.addCleanup(controldir.format_registry.remove, "testobsolete")104 self.addCleanup(controldir.format_registry.remove, "testobsolete")
107 bzrdir.register_metadir(controldir.format_registry, "testobsolete",105 bzr.register_metadir(controldir.format_registry, "testobsolete",
108 "breezy.tests.blackbox.test_exceptions.TestObsoleteRepoFormat",106 "breezy.tests.blackbox.test_exceptions.TestObsoleteRepoFormat",
109 branch_format='breezy.bzr.branch.BzrBranchFormat7',107 branch_format='breezy.bzr.branch.BzrBranchFormat7',
110 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat6',108 tree_format='breezy.bzr.workingtree_4.WorkingTreeFormat6',
111109
=== modified file 'breezy/tests/blackbox/test_upgrade.py'
--- breezy/tests/blackbox/test_upgrade.py 2017-06-10 16:40:42 +0000
+++ breezy/tests/blackbox/test_upgrade.py 2017-06-15 23:39:05 +0000
@@ -19,6 +19,7 @@
19import stat19import stat
2020
21from breezy import (21from breezy import (
22 bzr,
22 controldir,23 controldir,
23 lockable_files,24 lockable_files,
24 ui,25 ui,
@@ -130,9 +131,9 @@
130131
131 def test_upgrade_control_dir(self):132 def test_upgrade_control_dir(self):
132 old_format = OldBzrDirFormat()133 old_format = OldBzrDirFormat()
133 self.addCleanup(bzrdir.BzrProber.formats.remove,134 self.addCleanup(bzr.BzrProber.formats.remove,
134 old_format.get_format_string())135 old_format.get_format_string())
135 bzrdir.BzrProber.formats.register(old_format.get_format_string(),136 bzr.BzrProber.formats.register(old_format.get_format_string(),
136 old_format)137 old_format)
137 self.addCleanup(controldir.ControlDirFormat._set_default_format,138 self.addCleanup(controldir.ControlDirFormat._set_default_format,
138 controldir.ControlDirFormat.get_default_format())139 controldir.ControlDirFormat.get_default_format())
139140
=== modified file 'breezy/tests/test_bzrdir.py'
--- breezy/tests/test_bzrdir.py 2017-06-11 14:07:05 +0000
+++ breezy/tests/test_bzrdir.py 2017-06-15 23:39:05 +0000
@@ -25,6 +25,7 @@
2525
26from .. import (26from .. import (
27 branch,27 branch,
28 bzr,
28 config,29 config,
29 controldir,30 controldir,
30 errors,31 errors,
@@ -103,18 +104,18 @@
103 my_format_registry.register_lazy('lazy', 'breezy.tests.test_bzrdir',104 my_format_registry.register_lazy('lazy', 'breezy.tests.test_bzrdir',
104 'DeprecatedBzrDirFormat', 'Format registered lazily',105 'DeprecatedBzrDirFormat', 'Format registered lazily',
105 deprecated=True)106 deprecated=True)
106 bzrdir.register_metadir(my_format_registry, 'knit',107 bzr.register_metadir(my_format_registry, 'knit',
107 'breezy.bzr.knitrepo.RepositoryFormatKnit1',108 'breezy.bzr.knitrepo.RepositoryFormatKnit1',
108 'Format using knits',109 'Format using knits',
109 )110 )
110 my_format_registry.set_default('knit')111 my_format_registry.set_default('knit')
111 bzrdir.register_metadir(my_format_registry,112 bzr.register_metadir(my_format_registry,
112 'branch6',113 'branch6',
113 'breezy.bzr.knitrepo.RepositoryFormatKnit3',114 'breezy.bzr.knitrepo.RepositoryFormatKnit3',
114 'Experimental successor to knit. Use at your own risk.',115 'Experimental successor to knit. Use at your own risk.',
115 branch_format='breezy.bzr.branch.BzrBranchFormat6',116 branch_format='breezy.bzr.branch.BzrBranchFormat6',
116 experimental=True)117 experimental=True)
117 bzrdir.register_metadir(my_format_registry,118 bzr.register_metadir(my_format_registry,
118 'hidden format',119 'hidden format',
119 'breezy.bzr.knitrepo.RepositoryFormatKnit3',120 'breezy.bzr.knitrepo.RepositoryFormatKnit3',
120 'Experimental successor to knit. Use at your own risk.',121 'Experimental successor to knit. Use at your own risk.',
@@ -281,13 +282,13 @@
281 def test_find_format(self):282 def test_find_format(self):
282 # is the right format object found for a branch?283 # is the right format object found for a branch?
283 # create a branch with a few known format objects.284 # create a branch with a few known format objects.
284 bzrdir.BzrProber.formats.register(BzrDirFormatTest1.get_format_string(),285 bzr.BzrProber.formats.register(BzrDirFormatTest1.get_format_string(),
285 BzrDirFormatTest1())286 BzrDirFormatTest1())
286 self.addCleanup(bzrdir.BzrProber.formats.remove,287 self.addCleanup(bzr.BzrProber.formats.remove,
287 BzrDirFormatTest1.get_format_string())288 BzrDirFormatTest1.get_format_string())
288 bzrdir.BzrProber.formats.register(BzrDirFormatTest2.get_format_string(),289 bzr.BzrProber.formats.register(BzrDirFormatTest2.get_format_string(),
289 BzrDirFormatTest2())290 BzrDirFormatTest2())
290 self.addCleanup(bzrdir.BzrProber.formats.remove,291 self.addCleanup(bzr.BzrProber.formats.remove,
291 BzrDirFormatTest2.get_format_string())292 BzrDirFormatTest2.get_format_string())
292 t = self.get_transport()293 t = self.get_transport()
293 self.build_tree(["foo/", "bar/"], transport=t)294 self.build_tree(["foo/", "bar/"], transport=t)
@@ -318,7 +319,7 @@
318 # make a bzrdir319 # make a bzrdir
319 format.initialize(url)320 format.initialize(url)
320 # register a format for it.321 # register a format for it.
321 bzrdir.BzrProber.formats.register(format.get_format_string(), format)322 bzr.BzrProber.formats.register(format.get_format_string(), format)
322 # which bzrdir.Open will refuse (not supported)323 # which bzrdir.Open will refuse (not supported)
323 self.assertRaises(UnsupportedFormatError, bzrdir.BzrDir.open, url)324 self.assertRaises(UnsupportedFormatError, bzrdir.BzrDir.open, url)
324 # which bzrdir.open_containing will refuse (not supported)325 # which bzrdir.open_containing will refuse (not supported)
@@ -327,7 +328,7 @@
327 t = _mod_transport.get_transport_from_url(url)328 t = _mod_transport.get_transport_from_url(url)
328 self.assertEqual(format.open(t), bzrdir.BzrDir.open_unsupported(url))329 self.assertEqual(format.open(t), bzrdir.BzrDir.open_unsupported(url))
329 # unregister the format330 # unregister the format
330 bzrdir.BzrProber.formats.remove(format.get_format_string())331 bzr.BzrProber.formats.remove(format.get_format_string())
331 # now open_downlevel should fail too.332 # now open_downlevel should fail too.
332 self.assertRaises(UnknownFormatError, bzrdir.BzrDir.open_unsupported, url)333 self.assertRaises(UnknownFormatError, bzrdir.BzrDir.open_unsupported, url)
333334
334335
=== modified file 'breezy/tests/test_options.py'
--- breezy/tests/test_options.py 2017-06-10 16:40:42 +0000
+++ breezy/tests/test_options.py 2017-06-15 23:39:05 +0000
@@ -17,15 +17,13 @@
17import re17import re
1818
19from .. import (19from .. import (
20 bzr,
20 commands,21 commands,
21 controldir,22 controldir,
22 errors,23 errors,
23 option,24 option,
24 registry,25 registry,
25 )26 )
26from ..bzr import (
27 bzrdir,
28 )
29from ..builtins import cmd_commit27from ..builtins import cmd_commit
30from ..commands import parse_args28from ..commands import parse_args
31from . import TestCase29from . import TestCase
@@ -120,9 +118,9 @@
120118
121 def test_registry_conversion(self):119 def test_registry_conversion(self):
122 registry = controldir.ControlDirFormatRegistry()120 registry = controldir.ControlDirFormatRegistry()
123 bzrdir.register_metadir(registry, 'one', 'RepositoryFormat7', 'one help')121 bzr.register_metadir(registry, 'one', 'RepositoryFormat7', 'one help')
124 bzrdir.register_metadir(registry, 'two', 'RepositoryFormatKnit1', 'two help')122 bzr.register_metadir(registry, 'two', 'RepositoryFormatKnit1', 'two help')
125 bzrdir.register_metadir(registry, 'hidden', 'RepositoryFormatKnit1',123 bzr.register_metadir(registry, 'hidden', 'RepositoryFormatKnit1',
126 'two help', hidden=True)124 'two help', hidden=True)
127 registry.set_default('one')125 registry.set_default('one')
128 options = [option.RegistryOption('format', '', registry, str)]126 options = [option.RegistryOption('format', '', registry, str)]
@@ -190,12 +188,12 @@
190188
191 def test_help(self):189 def test_help(self):
192 registry = controldir.ControlDirFormatRegistry()190 registry = controldir.ControlDirFormatRegistry()
193 bzrdir.register_metadir(registry, 'one', 'RepositoryFormat7', 'one help')191 bzr.register_metadir(registry, 'one', 'RepositoryFormat7', 'one help')
194 bzrdir.register_metadir(registry, 'two',192 bzr.register_metadir(registry, 'two',
195 'breezy.bzr.knitrepo.RepositoryFormatKnit1',193 'breezy.bzr.knitrepo.RepositoryFormatKnit1',
196 'two help',194 'two help',
197 )195 )
198 bzrdir.register_metadir(registry, 'hidden', 'RepositoryFormat7', 'hidden help',196 bzr.register_metadir(registry, 'hidden', 'RepositoryFormat7', 'hidden help',
199 hidden=True)197 hidden=True)
200 registry.set_default('one')198 registry.set_default('one')
201 options = [option.RegistryOption('format', 'format help', registry,199 options = [option.RegistryOption('format', 'format help', registry,
@@ -218,8 +216,8 @@
218 self.assertEqual(list(opt.iter_switches()),216 self.assertEqual(list(opt.iter_switches()),
219 [('hello', None, 'GAR', 'fg')])217 [('hello', None, 'GAR', 'fg')])
220 registry = controldir.ControlDirFormatRegistry()218 registry = controldir.ControlDirFormatRegistry()
221 bzrdir.register_metadir(registry, 'one', 'RepositoryFormat7', 'one help')219 bzr.register_metadir(registry, 'one', 'RepositoryFormat7', 'one help')
222 bzrdir.register_metadir(registry, 'two',220 bzr.register_metadir(registry, 'two',
223 'breezy.bzr.knitrepo.RepositoryFormatKnit1',221 'breezy.bzr.knitrepo.RepositoryFormatKnit1',
224 'two help',222 'two help',
225 )223 )
@@ -379,9 +377,9 @@
379377
380 def test_is_hidden(self):378 def test_is_hidden(self):
381 registry = controldir.ControlDirFormatRegistry()379 registry = controldir.ControlDirFormatRegistry()
382 bzrdir.register_metadir(registry, 'hidden', 'HiddenFormat',380 bzr.register_metadir(registry, 'hidden', 'HiddenFormat',
383 'hidden help text', hidden=True)381 'hidden help text', hidden=True)
384 bzrdir.register_metadir(registry, 'visible', 'VisibleFormat',382 bzr.register_metadir(registry, 'visible', 'VisibleFormat',
385 'visible help text', hidden=False)383 'visible help text', hidden=False)
386 format = option.RegistryOption('format', '', registry, str)384 format = option.RegistryOption('format', '', registry, str)
387 self.assertTrue(format.is_hidden('hidden'))385 self.assertTrue(format.is_hidden('hidden'))
388386
=== modified file 'breezy/tests/test_remote.py'
--- breezy/tests/test_remote.py 2017-06-11 20:15:04 +0000
+++ breezy/tests/test_remote.py 2017-06-15 23:39:05 +0000
@@ -49,6 +49,8 @@
49from ..bzr.bzrdir import (49from ..bzr.bzrdir import (
50 BzrDir,50 BzrDir,
51 BzrDirFormat,51 BzrDirFormat,
52 )
53from ..bzr import (
52 RemoteBzrProber,54 RemoteBzrProber,
53 )55 )
54from ..bzr.chk_serializer import chk_bencode_serializer56from ..bzr.chk_serializer import chk_bencode_serializer
@@ -127,7 +129,7 @@
127 def test_find_correct_format(self):129 def test_find_correct_format(self):
128 """Should open a RemoteBzrDir over a RemoteTransport"""130 """Should open a RemoteBzrDir over a RemoteTransport"""
129 fmt = BzrDirFormat.find_format(self.transport)131 fmt = BzrDirFormat.find_format(self.transport)
130 self.assertTrue(bzrdir.RemoteBzrProber132 self.assertTrue(RemoteBzrProber
131 in controldir.ControlDirFormat._server_probers)133 in controldir.ControlDirFormat._server_probers)
132 self.assertIsInstance(fmt, RemoteBzrDirFormat)134 self.assertIsInstance(fmt, RemoteBzrDirFormat)
133135
134136
=== modified file 'breezy/tests/test_url_policy_open.py'
--- breezy/tests/test_url_policy_open.py 2017-06-10 16:40:42 +0000
+++ breezy/tests/test_url_policy_open.py 2017-06-15 23:39:05 +0000
@@ -23,7 +23,7 @@
23from ..bzr.branch import (23from ..bzr.branch import (
24 BranchReferenceFormat,24 BranchReferenceFormat,
25 )25 )
26from ..bzr.bzrdir import (26from ..bzr import (
27 BzrProber,27 BzrProber,
28 )28 )
29from ..controldir import (29from ..controldir import (
3030
=== modified file 'tools/generate_docs.py'
--- tools/generate_docs.py 2017-06-13 01:08:49 +0000
+++ tools/generate_docs.py 2017-06-15 23:39:05 +0000
@@ -38,12 +38,11 @@
3838
39sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))39sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
4040
41import breezy41# Don't remove the following import, it triggers a format registration that
42# avoid http://pad.lv/956860
43import breezy.bzr
42from breezy import (44from breezy import (
43 commands,45 commands,
44 # Don't remove the following import, it triggers a format registration that
45 # avoid http://pad.lv/956860
46 branch,
47 doc_generate,46 doc_generate,
48 )47 )
4948

Subscribers

People subscribed via source and target branches