Merge lp:~jelmer/bzr/use-bzr-controldir into lp:bzr
- use-bzr-controldir
- Merge into bzr.dev
Proposed by
Jelmer Vernooij
Status: | Merged |
---|---|
Approved by: | Martin Packman |
Approved revision: | no longer in the source branch. |
Merged at revision: | 6486 |
Proposed branch: | lp:~jelmer/bzr/use-bzr-controldir |
Merge into: | lp:bzr |
Diff against target: |
3614 lines (+402/-396) 82 files modified
bzrlib/branch.py (+1/-1) bzrlib/builtins.py (+1/-1) bzrlib/bzrdir.py (+1/-1) bzrlib/config.py (+4/-4) bzrlib/help_topics/__init__.py (+4/-4) bzrlib/plugins/launchpad/__init__.py (+2/-2) bzrlib/plugins/weave_fmt/bzrdir.py (+31/-30) bzrlib/plugins/weave_fmt/test_bzrdir.py (+7/-6) bzrlib/remote.py (+2/-2) bzrlib/repofmt/groupcompress_repo.py (+3/-3) bzrlib/repofmt/knitpack_repo.py (+10/-10) bzrlib/repofmt/knitrepo.py (+3/-3) bzrlib/smart/request.py (+1/-1) bzrlib/tests/__init__.py (+7/-6) bzrlib/tests/blackbox/test_bound_branches.py (+7/-8) bzrlib/tests/blackbox/test_branch.py (+3/-3) bzrlib/tests/blackbox/test_break_lock.py (+6/-6) bzrlib/tests/blackbox/test_checkout.py (+11/-10) bzrlib/tests/blackbox/test_commit.py (+4/-4) bzrlib/tests/blackbox/test_filtered_view_ops.py (+0/-3) bzrlib/tests/blackbox/test_info.py (+8/-8) bzrlib/tests/blackbox/test_join.py (+0/-2) bzrlib/tests/blackbox/test_merge.py (+2/-2) bzrlib/tests/blackbox/test_re_sign.py (+3/-3) bzrlib/tests/blackbox/test_reconcile.py (+3/-3) bzrlib/tests/blackbox/test_reconfigure.py (+4/-5) bzrlib/tests/blackbox/test_reference.py (+2/-2) bzrlib/tests/blackbox/test_rmbranch.py (+6/-6) bzrlib/tests/blackbox/test_send.py (+2/-3) bzrlib/tests/blackbox/test_serve.py (+3/-3) bzrlib/tests/blackbox/test_shared_repository.py (+14/-13) bzrlib/tests/blackbox/test_switch.py (+10/-10) bzrlib/tests/blackbox/test_upgrade.py (+6/-6) bzrlib/tests/per_branch/test_bound_sftp.py (+6/-7) bzrlib/tests/per_branch/test_branch.py (+4/-4) bzrlib/tests/per_branch/test_permissions.py (+2/-2) bzrlib/tests/per_branch/test_pull.py (+2/-2) bzrlib/tests/per_branch/test_push.py (+3/-3) bzrlib/tests/per_branch/test_stacking.py (+4/-4) bzrlib/tests/per_branch/test_tags.py (+2/-2) bzrlib/tests/per_bzrdir/test_bzrdir.py (+2/-2) bzrlib/tests/per_controldir/test_controldir.py (+25/-25) bzrlib/tests/per_interbranch/test_pull.py (+2/-2) bzrlib/tests/per_interbranch/test_push.py (+4/-4) bzrlib/tests/per_intertree/__init__.py (+1/-1) bzrlib/tests/per_pack_repository.py (+6/-6) bzrlib/tests/per_repository/__init__.py (+0/-1) bzrlib/tests/per_repository/test_fetch.py (+2/-2) bzrlib/tests/per_repository/test_has_same_location.py (+2/-2) bzrlib/tests/per_repository_reference/__init__.py (+2/-2) bzrlib/tests/per_repository_vf/test_reconcile.py (+12/-9) bzrlib/tests/per_repository_vf/test_write_group.py (+3/-2) bzrlib/tests/per_workingtree/test_commit.py (+2/-2) bzrlib/tests/per_workingtree/test_content_filters.py (+2/-2) bzrlib/tests/per_workingtree/test_workingtree.py (+2/-1) bzrlib/tests/test_branch.py (+3/-2) bzrlib/tests/test_bzrdir.py (+30/-30) bzrlib/tests/test_clean_tree.py (+5/-6) bzrlib/tests/test_commit.py (+2/-2) bzrlib/tests/test_config.py (+7/-7) bzrlib/tests/test_conflicts.py (+0/-1) bzrlib/tests/test_dirstate.py (+2/-3) bzrlib/tests/test_errors.py (+2/-2) bzrlib/tests/test_foreign.py (+3/-3) bzrlib/tests/test_http.py (+3/-3) bzrlib/tests/test_import_tariff.py (+2/-2) bzrlib/tests/test_merge_core.py (+2/-1) bzrlib/tests/test_options.py (+2/-2) bzrlib/tests/test_permissions.py (+2/-2) bzrlib/tests/test_reconfigure.py (+3/-3) bzrlib/tests/test_remote.py (+10/-10) bzrlib/tests/test_repository.py (+14/-13) bzrlib/tests/test_selftest.py (+7/-6) bzrlib/tests/test_sftp_transport.py (+3/-3) bzrlib/tests/test_smart.py (+6/-6) bzrlib/tests/test_smart_transport.py (+3/-1) bzrlib/tests/test_tag.py (+3/-3) bzrlib/tests/test_transform.py (+4/-4) bzrlib/tests/test_upgrade.py (+11/-11) bzrlib/tests/test_upgrade_stacked.py (+4/-4) bzrlib/tests/test_url_policy_open.py (+6/-4) bzrlib/workingtree_4.py (+2/-1) |
To merge this branch: | bzr merge lp:~jelmer/bzr/use-bzr-controldir |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Packman (community) | Approve | ||
Review via email: mp+94480@code.launchpad.net |
Commit message
Use bzrlib.controldir for generic access to control directories, rather than bzrlib.bzrdir.
Description of the change
Use ControlDir rather than BzrDir in most places.
This is in preparation of removing bzrlib.
To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) wrote : | # |
Revision history for this message
Martin Packman (gz) wrote : | # |
I have failed in my hunt for a bug in this, perhaps PQM will have more luck. :)
Making bzrdir a lazy import in smart.request is interesting. Are there other modules where that could usefully happen for cases where running against foreign formats?
review:
Approve
Revision history for this message
Jelmer Vernooij (jelmer) wrote : | # |
sent to pqm by email
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'bzrlib/branch.py' |
2 | --- bzrlib/branch.py 2012-02-14 17:22:37 +0000 |
3 | +++ bzrlib/branch.py 2012-03-06 18:30:24 +0000 |
4 | @@ -2045,7 +2045,7 @@ |
5 | |
6 | def _initialize_helper(self, a_bzrdir, utf8_files, name=None, |
7 | repository=None): |
8 | - """Initialize a branch in a bzrdir, with specified files |
9 | + """Initialize a branch in a control dir, with specified files |
10 | |
11 | :param a_bzrdir: The bzrdir to initialize the branch in |
12 | :param utf8_files: The files to create as a list of |
13 | |
14 | === modified file 'bzrlib/builtins.py' |
15 | --- bzrlib/builtins.py 2012-03-06 18:11:05 +0000 |
16 | +++ bzrlib/builtins.py 2012-03-06 18:30:24 +0000 |
17 | @@ -2053,7 +2053,7 @@ |
18 | RegistryOption('format', |
19 | help='Specify a format for this branch. ' |
20 | 'See "help formats".', |
21 | - lazy_registry=('bzrlib.bzrdir', 'format_registry'), |
22 | + lazy_registry=('bzrlib.controldir', 'format_registry'), |
23 | converter=lambda name: controldir.format_registry.make_bzrdir(name), |
24 | value_switches=True, |
25 | title="Branch format", |
26 | |
27 | === modified file 'bzrlib/bzrdir.py' |
28 | --- bzrlib/bzrdir.py 2012-01-31 15:43:17 +0000 |
29 | +++ bzrlib/bzrdir.py 2012-03-06 18:30:24 +0000 |
30 | @@ -1370,7 +1370,7 @@ |
31 | :param shared_repo: Control whether made repositories are shared or |
32 | not. |
33 | :param vfs_only: If True do not attempt to use a smart server |
34 | - :return: repo, bzrdir, require_stacking, repository_policy. repo is |
35 | + :return: repo, controldir, require_stacking, repository_policy. repo is |
36 | None if none was created or found, bzrdir is always valid. |
37 | require_stacking is the result of examining the stacked_on |
38 | parameter and any stacking policy found for the target. |
39 | |
40 | === modified file 'bzrlib/config.py' |
41 | --- bzrlib/config.py 2012-02-20 17:38:11 +0000 |
42 | +++ bzrlib/config.py 2012-03-06 18:30:24 +0000 |
43 | @@ -2174,8 +2174,8 @@ |
44 | |
45 | It may be set to a location, or None. |
46 | |
47 | - This policy affects all branches contained by this bzrdir, except for |
48 | - those under repositories. |
49 | + This policy affects all branches contained by this control dir, except |
50 | + for those under repositories. |
51 | """ |
52 | if self._config is None: |
53 | raise errors.BzrError("Cannot set configuration in %s" % self._bzrdir) |
54 | @@ -2189,8 +2189,8 @@ |
55 | |
56 | This will either be a location, or None. |
57 | |
58 | - This policy affects all branches contained by this bzrdir, except for |
59 | - those under repositories. |
60 | + This policy affects all branches contained by this control dir, except |
61 | + for those under repositories. |
62 | """ |
63 | if self._config is None: |
64 | return None |
65 | |
66 | === modified file 'bzrlib/help_topics/__init__.py' |
67 | --- bzrlib/help_topics/__init__.py 2011-12-18 12:46:49 +0000 |
68 | +++ bzrlib/help_topics/__init__.py 2012-03-06 18:30:24 +0000 |
69 | @@ -739,13 +739,13 @@ |
70 | topic_registry.register('basic', _basic_help, "Basic commands", SECT_HIDDEN) |
71 | topic_registry.register('topics', _help_on_topics, "Topics list", SECT_HIDDEN) |
72 | def get_current_formats_topic(topic): |
73 | - from bzrlib import bzrdir |
74 | + from bzrlib import controldir |
75 | return "Current Storage Formats\n\n" + \ |
76 | - bzrdir.format_registry.help_topic(topic) |
77 | + controldir.format_registry.help_topic(topic) |
78 | def get_other_formats_topic(topic): |
79 | - from bzrlib import bzrdir |
80 | + from bzrlib import controldir |
81 | return "Other Storage Formats\n\n" + \ |
82 | - bzrdir.format_registry.help_topic(topic) |
83 | + controldir.format_registry.help_topic(topic) |
84 | topic_registry.register('current-formats', get_current_formats_topic, |
85 | 'Current storage formats') |
86 | topic_registry.register('other-formats', get_other_formats_topic, |
87 | |
88 | === modified file 'bzrlib/plugins/launchpad/__init__.py' |
89 | --- bzrlib/plugins/launchpad/__init__.py 2012-02-26 15:43:02 +0000 |
90 | +++ bzrlib/plugins/launchpad/__init__.py 2012-03-06 18:30:24 +0000 |
91 | @@ -53,8 +53,8 @@ |
92 | |
93 | from bzrlib import ( |
94 | branch as _mod_branch, |
95 | - bzrdir, |
96 | config as _mod_config, |
97 | + controldir, |
98 | lazy_regex, |
99 | # Since we are a built-in plugin we share the bzrlib version |
100 | version_info, |
101 | @@ -353,7 +353,7 @@ |
102 | def run(self, submit_branch=None, review=None, staging=False, |
103 | message=None, approve=False, fixes=None): |
104 | from bzrlib.plugins.launchpad import lp_propose |
105 | - tree, branch, relpath = bzrdir.BzrDir.open_containing_tree_or_branch( |
106 | + tree, branch, relpath = controldir.ControlDir.open_containing_tree_or_branch( |
107 | '.') |
108 | if review is None: |
109 | reviews = None |
110 | |
111 | === modified file 'bzrlib/plugins/weave_fmt/bzrdir.py' |
112 | --- bzrlib/plugins/weave_fmt/bzrdir.py 2012-01-18 19:08:55 +0000 |
113 | +++ bzrlib/plugins/weave_fmt/bzrdir.py 2012-03-06 18:30:24 +0000 |
114 | @@ -24,6 +24,7 @@ |
115 | BzrDirMetaFormat1, |
116 | ) |
117 | from bzrlib.controldir import ( |
118 | + ControlDir, |
119 | Converter, |
120 | format_registry, |
121 | ) |
122 | @@ -66,7 +67,7 @@ |
123 | create_prefix=False, force_new_repo=False, stacked_on=None, |
124 | stack_on_pwd=None, repo_format_name=None, make_working_trees=None, |
125 | shared_repo=False): |
126 | - """See BzrDirFormat.initialize_on_transport_ex.""" |
127 | + """See ControlDir.initialize_on_transport_ex.""" |
128 | require_stacking = (stacked_on is not None) |
129 | # Format 5 cannot stack, but we've been asked to - actually init |
130 | # a Meta1Dir |
131 | @@ -116,11 +117,11 @@ |
132 | return BzrBranchFormat4() |
133 | |
134 | def get_format_description(self): |
135 | - """See BzrDirFormat.get_format_description().""" |
136 | + """See ControlDirFormat.get_format_description().""" |
137 | return "All-in-one format 5" |
138 | |
139 | def get_converter(self, format=None): |
140 | - """See BzrDirFormat.get_converter().""" |
141 | + """See ControlDirFormat.get_converter().""" |
142 | # there is one and only one upgrade path here. |
143 | return ConvertBzrDir5To6() |
144 | |
145 | @@ -176,7 +177,7 @@ |
146 | return "Bazaar-NG branch, format 6\n" |
147 | |
148 | def get_format_description(self): |
149 | - """See BzrDirFormat.get_format_description().""" |
150 | + """See ControlDirFormat.get_format_description().""" |
151 | return "All-in-one format 6" |
152 | |
153 | def get_branch_format(self): |
154 | @@ -184,7 +185,7 @@ |
155 | return BzrBranchFormat4() |
156 | |
157 | def get_converter(self, format=None): |
158 | - """See BzrDirFormat.get_converter().""" |
159 | + """See ControlDirFormat.get_converter().""" |
160 | # there is one and only one upgrade path here. |
161 | return ConvertBzrDir6ToMeta() |
162 | |
163 | @@ -240,7 +241,7 @@ |
164 | if isinstance(self.bzrdir.transport, local.LocalTransport): |
165 | self.bzrdir.get_workingtree_transport(None).delete('stat-cache') |
166 | self._convert_to_weaves() |
167 | - return BzrDir.open(self.bzrdir.user_url) |
168 | + return ControlDir.open(self.bzrdir.user_url) |
169 | finally: |
170 | self.pb.finished() |
171 | |
172 | @@ -505,7 +506,7 @@ |
173 | try: |
174 | ui.ui_factory.note(gettext('starting upgrade from format 5 to 6')) |
175 | self._convert_to_prefixed() |
176 | - return BzrDir.open(self.bzrdir.user_url) |
177 | + return ControlDir.open(self.bzrdir.user_url) |
178 | finally: |
179 | pb.finished() |
180 | |
181 | @@ -633,7 +634,7 @@ |
182 | BzrDirMetaFormat1().get_format_string(), |
183 | mode=self.file_mode) |
184 | self.pb.finished() |
185 | - return BzrDir.open(self.bzrdir.user_url) |
186 | + return ControlDir.open(self.bzrdir.user_url) |
187 | |
188 | def make_lock(self, name): |
189 | """Make a lock for the new control dir name.""" |
190 | @@ -685,11 +686,11 @@ |
191 | return "Bazaar-NG branch, format 0.0.4\n" |
192 | |
193 | def get_format_description(self): |
194 | - """See BzrDirFormat.get_format_description().""" |
195 | + """See ControlDirFormat.get_format_description().""" |
196 | return "All-in-one format 4" |
197 | |
198 | def get_converter(self, format=None): |
199 | - """See BzrDirFormat.get_converter().""" |
200 | + """See ControlDirFormat.get_converter().""" |
201 | # there is one and only one upgrade path here. |
202 | return ConvertBzrDir4To5() |
203 | |
204 | @@ -730,7 +731,7 @@ |
205 | """A common class for the all-in-one formats.""" |
206 | |
207 | def __init__(self, _transport, _format): |
208 | - """See BzrDir.__init__.""" |
209 | + """See ControlDir.__init__.""" |
210 | super(BzrDirPreSplitOut, self).__init__(_transport, _format) |
211 | self._control_files = lockable_files.LockableFiles( |
212 | self.get_branch_transport(None), |
213 | @@ -749,7 +750,7 @@ |
214 | |
215 | def clone(self, url, revision_id=None, force_new_repo=False, |
216 | preserve_stacking=False): |
217 | - """See BzrDir.clone(). |
218 | + """See ControlDir.clone(). |
219 | |
220 | force_new_repo has no effect, since this family of formats always |
221 | require a new repository. |
222 | @@ -772,7 +773,7 @@ |
223 | |
224 | def create_branch(self, name=None, repository=None, |
225 | append_revisions_only=None): |
226 | - """See BzrDir.create_branch.""" |
227 | + """See ControlDir.create_branch.""" |
228 | if repository is not None: |
229 | raise NotImplementedError( |
230 | "create_branch(repository=<not None>) on %r" % (self,)) |
231 | @@ -780,22 +781,22 @@ |
232 | append_revisions_only=append_revisions_only) |
233 | |
234 | def destroy_branch(self, name=None): |
235 | - """See BzrDir.destroy_branch.""" |
236 | + """See ControlDir.destroy_branch.""" |
237 | raise errors.UnsupportedOperation(self.destroy_branch, self) |
238 | |
239 | def create_repository(self, shared=False): |
240 | - """See BzrDir.create_repository.""" |
241 | + """See ControlDir.create_repository.""" |
242 | if shared: |
243 | raise errors.IncompatibleFormat('shared repository', self._format) |
244 | return self.open_repository() |
245 | |
246 | def destroy_repository(self): |
247 | - """See BzrDir.destroy_repository.""" |
248 | + """See ControlDir.destroy_repository.""" |
249 | raise errors.UnsupportedOperation(self.destroy_repository, self) |
250 | |
251 | def create_workingtree(self, revision_id=None, from_branch=None, |
252 | accelerator_tree=None, hardlink=False): |
253 | - """See BzrDir.create_workingtree.""" |
254 | + """See ControlDir.create_workingtree.""" |
255 | # The workingtree is sometimes created when the bzrdir is created, |
256 | # but not when cloning. |
257 | |
258 | @@ -833,11 +834,11 @@ |
259 | self.transport, self._control_files._file_mode) |
260 | |
261 | def destroy_workingtree(self): |
262 | - """See BzrDir.destroy_workingtree.""" |
263 | + """See ControlDir.destroy_workingtree.""" |
264 | raise errors.UnsupportedOperation(self.destroy_workingtree, self) |
265 | |
266 | def destroy_workingtree_metadata(self): |
267 | - """See BzrDir.destroy_workingtree_metadata.""" |
268 | + """See ControlDir.destroy_workingtree_metadata.""" |
269 | raise errors.UnsupportedOperation(self.destroy_workingtree_metadata, |
270 | self) |
271 | |
272 | @@ -874,7 +875,7 @@ |
273 | raise errors.IncompatibleFormat(workingtree_format, self._format) |
274 | |
275 | def needs_format_conversion(self, format=None): |
276 | - """See BzrDir.needs_format_conversion().""" |
277 | + """See ControlDir.needs_format_conversion().""" |
278 | # if the format is not the same as the system default, |
279 | # an upgrade is needed. |
280 | if format is None: |
281 | @@ -885,7 +886,7 @@ |
282 | |
283 | def open_branch(self, name=None, unsupported=False, |
284 | ignore_fallbacks=False, possible_transports=None): |
285 | - """See BzrDir.open_branch.""" |
286 | + """See ControlDir.open_branch.""" |
287 | from bzrlib.plugins.weave_fmt.branch import BzrBranchFormat4 |
288 | format = BzrBranchFormat4() |
289 | format.check_support_status(unsupported) |
290 | @@ -896,7 +897,7 @@ |
291 | possible_transports=None, accelerator_tree=None, |
292 | hardlink=False, stacked=False, create_tree_if_local=True, |
293 | source_branch=None): |
294 | - """See BzrDir.sprout().""" |
295 | + """See ControlDir.sprout().""" |
296 | if source_branch is not None: |
297 | my_branch = self.open_branch() |
298 | if source_branch.base != my_branch.base: |
299 | @@ -941,7 +942,7 @@ |
300 | """ |
301 | |
302 | def create_repository(self, shared=False): |
303 | - """See BzrDir.create_repository.""" |
304 | + """See ControlDir.create_repository.""" |
305 | return self._format.repository_format.initialize(self, shared) |
306 | |
307 | def needs_format_conversion(self, format=None): |
308 | @@ -952,7 +953,7 @@ |
309 | return True |
310 | |
311 | def open_repository(self): |
312 | - """See BzrDir.open_repository.""" |
313 | + """See ControlDir.open_repository.""" |
314 | from bzrlib.plugins.weave_fmt.repository import RepositoryFormat4 |
315 | return RepositoryFormat4().open(self, _found=True) |
316 | |
317 | @@ -964,17 +965,17 @@ |
318 | """ |
319 | |
320 | def has_workingtree(self): |
321 | - """See BzrDir.has_workingtree.""" |
322 | + """See ControlDir.has_workingtree.""" |
323 | return True |
324 | |
325 | def open_repository(self): |
326 | - """See BzrDir.open_repository.""" |
327 | + """See ControlDir.open_repository.""" |
328 | from bzrlib.plugins.weave_fmt.repository import RepositoryFormat5 |
329 | return RepositoryFormat5().open(self, _found=True) |
330 | |
331 | def open_workingtree(self, unsupported=False, |
332 | recommend_upgrade=True): |
333 | - """See BzrDir.create_workingtree.""" |
334 | + """See ControlDir.create_workingtree.""" |
335 | from bzrlib.plugins.weave_fmt.workingtree import WorkingTreeFormat2 |
336 | wt_format = WorkingTreeFormat2() |
337 | # we don't warn here about upgrades; that ought to be handled for the |
338 | @@ -989,16 +990,16 @@ |
339 | """ |
340 | |
341 | def has_workingtree(self): |
342 | - """See BzrDir.has_workingtree.""" |
343 | + """See ControlDir.has_workingtree.""" |
344 | return True |
345 | |
346 | def open_repository(self): |
347 | - """See BzrDir.open_repository.""" |
348 | + """See ControlDir.open_repository.""" |
349 | from bzrlib.plugins.weave_fmt.repository import RepositoryFormat6 |
350 | return RepositoryFormat6().open(self, _found=True) |
351 | |
352 | def open_workingtree(self, unsupported=False, recommend_upgrade=True): |
353 | - """See BzrDir.create_workingtree.""" |
354 | + """See ControlDir.create_workingtree.""" |
355 | # we don't warn here about upgrades; that ought to be handled for the |
356 | # bzrdir as a whole |
357 | from bzrlib.plugins.weave_fmt.workingtree import WorkingTreeFormat2 |
358 | |
359 | === modified file 'bzrlib/plugins/weave_fmt/test_bzrdir.py' |
360 | --- bzrlib/plugins/weave_fmt/test_bzrdir.py 2011-12-19 13:23:58 +0000 |
361 | +++ bzrlib/plugins/weave_fmt/test_bzrdir.py 2012-03-06 18:30:24 +0000 |
362 | @@ -27,6 +27,7 @@ |
363 | from bzrlib import ( |
364 | branch, |
365 | bzrdir, |
366 | + controldir, |
367 | errors, |
368 | repository, |
369 | upgrade, |
370 | @@ -66,7 +67,7 @@ |
371 | self.assertTrue(ctrl_2 is ctrl_3) |
372 | check_dir_components_use_same_lock(dir) |
373 | # and if we open it normally. |
374 | - dir = bzrdir.BzrDir.open(self.get_url()) |
375 | + dir = controldir.ControlDir.open(self.get_url()) |
376 | check_dir_components_use_same_lock(dir) |
377 | |
378 | def test_can_convert(self): |
379 | @@ -100,7 +101,7 @@ |
380 | self.assertTrue(ctrl_2 is ctrl_3) |
381 | check_dir_components_use_same_lock(dir) |
382 | # and if we open it normally. |
383 | - dir = bzrdir.BzrDir.open(self.get_url()) |
384 | + dir = controldir.ControlDir.open(self.get_url()) |
385 | check_dir_components_use_same_lock(dir) |
386 | |
387 | def test_can_convert(self): |
388 | @@ -302,7 +303,7 @@ |
389 | # At this point, we have a format6 branch without checkout files. |
390 | upgrade.upgrade('.', bzrdir.BzrDirMetaFormat1()) |
391 | # The upgrade should not have set up a working tree. |
392 | - control = bzrdir.BzrDir.open('.') |
393 | + control = controldir.ControlDir.open('.') |
394 | self.assertFalse(control.has_workingtree()) |
395 | # We have covered the scope of this test, we may as well check that |
396 | # upgrade has not eaten our data, even if it's a bit redundant with |
397 | @@ -319,7 +320,7 @@ |
398 | eq = self.assertEquals |
399 | self.build_tree_contents(_upgrade1_template) |
400 | upgrade.upgrade(u'.') |
401 | - control = bzrdir.BzrDir.open('.') |
402 | + control = controldir.ControlDir.open('.') |
403 | b = control.open_branch() |
404 | # tsk, peeking under the covers. |
405 | self.assertIsInstance( |
406 | @@ -389,7 +390,7 @@ |
407 | |
408 | def test_upgrade_makes_dir_weaves(self): |
409 | self.build_tree_contents(_upgrade_dir_template) |
410 | - old_repodir = bzrdir.BzrDir.open_unsupported('.') |
411 | + old_repodir = controldir.ControlDir.open_unsupported('.') |
412 | old_repo_format = old_repodir.open_repository()._format |
413 | upgrade.upgrade('.') |
414 | # this is the path to the literal file. As format changes |
415 | @@ -544,7 +545,7 @@ |
416 | self.build_tree(['master/', 'child/']) |
417 | self.make_branch_and_tree('master') |
418 | self.make_branch_and_tree('child', |
419 | - format=bzrdir.format_registry.make_bzrdir('weave')) |
420 | + format=controldir.format_registry.make_bzrdir('weave')) |
421 | os.chdir('child') |
422 | |
423 | def test_bind_format_6_bzrdir(self): |
424 | |
425 | === modified file 'bzrlib/remote.py' |
426 | --- bzrlib/remote.py 2012-02-14 17:22:37 +0000 |
427 | +++ bzrlib/remote.py 2012-03-06 18:30:24 +0000 |
428 | @@ -1051,7 +1051,7 @@ |
429 | network_name = self._network_name |
430 | else: |
431 | # Select the current bzrlib default and ask for that. |
432 | - reference_bzrdir_format = _mod_bzrdir.format_registry.get('default')() |
433 | + reference_bzrdir_format = controldir.format_registry.get('default')() |
434 | reference_format = reference_bzrdir_format.repository_format |
435 | network_name = reference_format.network_name() |
436 | # 2) try direct creation via RPC |
437 | @@ -3157,7 +3157,7 @@ |
438 | network_name = self._custom_format.network_name() |
439 | else: |
440 | # Select the current bzrlib default and ask for that. |
441 | - reference_bzrdir_format = _mod_bzrdir.format_registry.get('default')() |
442 | + reference_bzrdir_format = controldir.format_registry.get('default')() |
443 | reference_format = reference_bzrdir_format.get_branch_format() |
444 | self._custom_format = reference_format |
445 | network_name = reference_format.network_name() |
446 | |
447 | === modified file 'bzrlib/repofmt/groupcompress_repo.py' |
448 | --- bzrlib/repofmt/groupcompress_repo.py 2012-01-24 00:16:15 +0000 |
449 | +++ bzrlib/repofmt/groupcompress_repo.py 2012-03-06 18:30:24 +0000 |
450 | @@ -21,7 +21,7 @@ |
451 | import time |
452 | |
453 | from bzrlib import ( |
454 | - bzrdir, |
455 | + controldir, |
456 | chk_map, |
457 | chk_serializer, |
458 | debug, |
459 | @@ -1383,7 +1383,7 @@ |
460 | pack_compresses = True |
461 | |
462 | def _get_matching_bzrdir(self): |
463 | - return bzrdir.format_registry.make_bzrdir('2a') |
464 | + return controldir.format_registry.make_bzrdir('2a') |
465 | |
466 | def _ignore_setting_bzrdir(self, format): |
467 | pass |
468 | @@ -1406,7 +1406,7 @@ |
469 | """ |
470 | |
471 | def _get_matching_bzrdir(self): |
472 | - return bzrdir.format_registry.make_bzrdir('development-subtree') |
473 | + return controldir.format_registry.make_bzrdir('development-subtree') |
474 | |
475 | def _ignore_setting_bzrdir(self, format): |
476 | pass |
477 | |
478 | === modified file 'bzrlib/repofmt/knitpack_repo.py' |
479 | --- bzrlib/repofmt/knitpack_repo.py 2011-12-19 19:15:58 +0000 |
480 | +++ bzrlib/repofmt/knitpack_repo.py 2012-03-06 18:30:24 +0000 |
481 | @@ -24,7 +24,7 @@ |
482 | import time |
483 | |
484 | from bzrlib import ( |
485 | - bzrdir, |
486 | + controldir, |
487 | debug, |
488 | errors, |
489 | knit, |
490 | @@ -155,7 +155,7 @@ |
491 | index_class = GraphIndex |
492 | |
493 | def _get_matching_bzrdir(self): |
494 | - return bzrdir.format_registry.make_bzrdir('pack-0.92') |
495 | + return controldir.format_registry.make_bzrdir('pack-0.92') |
496 | |
497 | def _ignore_setting_bzrdir(self, format): |
498 | pass |
499 | @@ -195,7 +195,7 @@ |
500 | index_class = GraphIndex |
501 | |
502 | def _get_matching_bzrdir(self): |
503 | - return bzrdir.format_registry.make_bzrdir( |
504 | + return controldir.format_registry.make_bzrdir( |
505 | 'pack-0.92-subtree') |
506 | |
507 | def _ignore_setting_bzrdir(self, format): |
508 | @@ -234,7 +234,7 @@ |
509 | index_class = GraphIndex |
510 | |
511 | def _get_matching_bzrdir(self): |
512 | - return bzrdir.format_registry.make_bzrdir( |
513 | + return controldir.format_registry.make_bzrdir( |
514 | 'rich-root-pack') |
515 | |
516 | def _ignore_setting_bzrdir(self, format): |
517 | @@ -274,7 +274,7 @@ |
518 | return xml5.serializer_v5 |
519 | |
520 | def _get_matching_bzrdir(self): |
521 | - return bzrdir.format_registry.make_bzrdir('1.6') |
522 | + return controldir.format_registry.make_bzrdir('1.6') |
523 | |
524 | def _ignore_setting_bzrdir(self, format): |
525 | pass |
526 | @@ -314,7 +314,7 @@ |
527 | return xml6.serializer_v6 |
528 | |
529 | def _get_matching_bzrdir(self): |
530 | - return bzrdir.format_registry.make_bzrdir( |
531 | + return controldir.format_registry.make_bzrdir( |
532 | '1.6.1-rich-root') |
533 | |
534 | def _ignore_setting_bzrdir(self, format): |
535 | @@ -359,7 +359,7 @@ |
536 | return xml7.serializer_v7 |
537 | |
538 | def _get_matching_bzrdir(self): |
539 | - matching = bzrdir.format_registry.make_bzrdir( |
540 | + matching = controldir.format_registry.make_bzrdir( |
541 | '1.6.1-rich-root') |
542 | matching.repository_format = self |
543 | return matching |
544 | @@ -401,7 +401,7 @@ |
545 | return xml5.serializer_v5 |
546 | |
547 | def _get_matching_bzrdir(self): |
548 | - return bzrdir.format_registry.make_bzrdir('1.9') |
549 | + return controldir.format_registry.make_bzrdir('1.9') |
550 | |
551 | def _ignore_setting_bzrdir(self, format): |
552 | pass |
553 | @@ -438,7 +438,7 @@ |
554 | return xml6.serializer_v6 |
555 | |
556 | def _get_matching_bzrdir(self): |
557 | - return bzrdir.format_registry.make_bzrdir( |
558 | + return controldir.format_registry.make_bzrdir( |
559 | '1.9-rich-root') |
560 | |
561 | def _ignore_setting_bzrdir(self, format): |
562 | @@ -479,7 +479,7 @@ |
563 | return xml7.serializer_v7 |
564 | |
565 | def _get_matching_bzrdir(self): |
566 | - return bzrdir.format_registry.make_bzrdir( |
567 | + return controldir.format_registry.make_bzrdir( |
568 | 'development5-subtree') |
569 | |
570 | def _ignore_setting_bzrdir(self, format): |
571 | |
572 | === modified file 'bzrlib/repofmt/knitrepo.py' |
573 | --- bzrlib/repofmt/knitrepo.py 2011-12-19 19:15:58 +0000 |
574 | +++ bzrlib/repofmt/knitrepo.py 2012-03-06 18:30:24 +0000 |
575 | @@ -21,7 +21,7 @@ |
576 | import itertools |
577 | |
578 | from bzrlib import ( |
579 | - bzrdir, |
580 | + controldir, |
581 | errors, |
582 | knit as _mod_knit, |
583 | lockable_files, |
584 | @@ -405,7 +405,7 @@ |
585 | return xml7.serializer_v7 |
586 | |
587 | def _get_matching_bzrdir(self): |
588 | - return bzrdir.format_registry.make_bzrdir('dirstate-with-subtree') |
589 | + return controldir.format_registry.make_bzrdir('dirstate-with-subtree') |
590 | |
591 | def _ignore_setting_bzrdir(self, format): |
592 | pass |
593 | @@ -447,7 +447,7 @@ |
594 | return xml6.serializer_v6 |
595 | |
596 | def _get_matching_bzrdir(self): |
597 | - return bzrdir.format_registry.make_bzrdir('rich-root') |
598 | + return controldir.format_registry.make_bzrdir('rich-root') |
599 | |
600 | def _ignore_setting_bzrdir(self, format): |
601 | pass |
602 | |
603 | === modified file 'bzrlib/smart/request.py' |
604 | --- bzrlib/smart/request.py 2012-01-06 22:06:36 +0000 |
605 | +++ bzrlib/smart/request.py 2012-03-06 18:30:24 +0000 |
606 | @@ -36,7 +36,6 @@ |
607 | import threading |
608 | |
609 | from bzrlib import ( |
610 | - bzrdir, |
611 | debug, |
612 | errors, |
613 | osutils, |
614 | @@ -47,6 +46,7 @@ |
615 | ) |
616 | from bzrlib.lazy_import import lazy_import |
617 | lazy_import(globals(), """ |
618 | +from bzrlib import bzrdir |
619 | from bzrlib.bundle import serializer |
620 | |
621 | import tempfile |
622 | |
623 | === modified file 'bzrlib/tests/__init__.py' |
624 | --- bzrlib/tests/__init__.py 2012-02-18 16:55:04 +0000 |
625 | +++ bzrlib/tests/__init__.py 2012-03-06 18:30:24 +0000 |
626 | @@ -60,7 +60,7 @@ |
627 | import bzrlib |
628 | from bzrlib import ( |
629 | branchbuilder, |
630 | - bzrdir, |
631 | + controldir, |
632 | chk_map, |
633 | commands as _mod_commands, |
634 | config, |
635 | @@ -1328,7 +1328,7 @@ |
636 | # hook into bzr dir opening. This leaves a small window of error for |
637 | # transport tests, but they are well known, and we can improve on this |
638 | # step. |
639 | - bzrdir.BzrDir.hooks.install_named_hook("pre_open", |
640 | + controldir.ControlDir.hooks.install_named_hook("pre_open", |
641 | self._preopen_isolate_transport, "Check bzr directories are safe.") |
642 | |
643 | def _ndiff_strings(self, a, b): |
644 | @@ -2603,7 +2603,7 @@ |
645 | # http://pad.lv/825027). |
646 | self.assertIs(None, os.environ.get('BZR_HOME', None)) |
647 | os.environ['BZR_HOME'] = root |
648 | - wt = bzrdir.BzrDir.create_standalone_workingtree(root) |
649 | + wt = controldir.ControlDir.create_standalone_workingtree(root) |
650 | del os.environ['BZR_HOME'] |
651 | # Hack for speed: remember the raw bytes of the dirstate file so that |
652 | # we don't need to re-open the wt to check it hasn't changed. |
653 | @@ -2680,7 +2680,7 @@ |
654 | if format is None: |
655 | format = self.get_default_format() |
656 | if isinstance(format, basestring): |
657 | - format = bzrdir.format_registry.make_bzrdir(format) |
658 | + format = controldir.format_registry.make_bzrdir(format) |
659 | return format |
660 | |
661 | def make_bzrdir(self, relpath, format=None): |
662 | @@ -2854,7 +2854,7 @@ |
663 | # stacking policy to honour; create a bzr dir with an unshared |
664 | # repository (but not a branch - our code would be trying to escape |
665 | # then!) to stop them, and permit it to be read. |
666 | - # control = bzrdir.BzrDir.create(self.test_base_dir) |
667 | + # control = controldir.ControlDir.create(self.test_base_dir) |
668 | # control.create_repository() |
669 | self.test_home_dir = self.test_base_dir + '/home' |
670 | os.mkdir(self.test_home_dir) |
671 | @@ -3000,7 +3000,8 @@ |
672 | if self.vfs_transport_factory is test_server.LocalURLServer: |
673 | # the branch is colocated on disk, we cannot create a checkout. |
674 | # hopefully callers will expect this. |
675 | - local_controldir= bzrdir.BzrDir.open(self.get_vfs_only_url(relpath)) |
676 | + local_controldir = controldir.ControlDir.open( |
677 | + self.get_vfs_only_url(relpath)) |
678 | wt = local_controldir.create_workingtree() |
679 | if wt.branch._format != b._format: |
680 | wt._branch = b |
681 | |
682 | === modified file 'bzrlib/tests/blackbox/test_bound_branches.py' |
683 | --- bzrlib/tests/blackbox/test_bound_branches.py 2012-01-18 14:09:19 +0000 |
684 | +++ bzrlib/tests/blackbox/test_bound_branches.py 2012-03-06 18:30:24 +0000 |
685 | @@ -19,7 +19,7 @@ |
686 | |
687 | from bzrlib import ( |
688 | branch, |
689 | - bzrdir, |
690 | + controldir, |
691 | errors, |
692 | tests, |
693 | ) |
694 | @@ -35,19 +35,18 @@ |
695 | base_tree.add(['a', 'b']) |
696 | base_tree.commit('init') |
697 | base_tree.unlock() |
698 | - branch = base_tree.branch |
699 | |
700 | - child_tree = branch.create_checkout('child') |
701 | + child_tree = base_tree.branch.create_checkout('child') |
702 | |
703 | self.check_revno(1, 'child') |
704 | - d = bzrdir.BzrDir.open('child') |
705 | + d = controldir.ControlDir.open('child') |
706 | self.assertNotEqual(None, d.open_branch().get_master_branch()) |
707 | |
708 | return base_tree, child_tree |
709 | |
710 | def check_revno(self, val, loc='.'): |
711 | self.assertEqual( |
712 | - val, bzrdir.BzrDir.open(loc).open_branch().last_revision_info()[0]) |
713 | + val, controldir.ControlDir.open(loc).open_branch().last_revision_info()[0]) |
714 | |
715 | def test_simple_binding(self): |
716 | tree = self.make_branch_and_tree('base') |
717 | @@ -59,7 +58,7 @@ |
718 | |
719 | self.run_bzr('bind ../base', working_dir='child') |
720 | |
721 | - d = bzrdir.BzrDir.open('child') |
722 | + d = controldir.ControlDir.open('child') |
723 | self.assertNotEqual(None, d.open_branch().get_master_branch()) |
724 | |
725 | self.run_bzr('unbind', working_dir='child') |
726 | @@ -133,7 +132,7 @@ |
727 | self.run_bzr('bind ../child', working_dir='child2') |
728 | |
729 | # Refresh the child tree object as 'unbind' modified it |
730 | - child2_tree = bzrdir.BzrDir.open('child2').open_workingtree() |
731 | + child2_tree = controldir.ControlDir.open('child2').open_workingtree() |
732 | self.assertRaises(errors.CommitToDoubleBoundBranch, |
733 | child2_tree.commit, message='child2', allow_pointless=True) |
734 | |
735 | @@ -356,7 +355,7 @@ |
736 | branch = tree.branch |
737 | tree.bzrdir.sprout('child') |
738 | self.run_bzr('bind --directory=child base') |
739 | - d = bzrdir.BzrDir.open('child') |
740 | + d = controldir.ControlDir.open('child') |
741 | self.assertNotEqual(None, d.open_branch().get_master_branch()) |
742 | self.run_bzr('unbind -d child') |
743 | self.assertEqual(None, d.open_branch().get_master_branch()) |
744 | |
745 | === modified file 'bzrlib/tests/blackbox/test_branch.py' |
746 | --- bzrlib/tests/blackbox/test_branch.py 2012-02-14 17:22:37 +0000 |
747 | +++ bzrlib/tests/blackbox/test_branch.py 2012-03-06 18:30:24 +0000 |
748 | @@ -363,12 +363,12 @@ |
749 | |
750 | def assertRevisionInRepository(self, repo_path, revid): |
751 | """Check that a revision is in a repo, disregarding stacking.""" |
752 | - repo = bzrdir.BzrDir.open(repo_path).open_repository() |
753 | + repo = controldir.ControlDir.open(repo_path).open_repository() |
754 | self.assertTrue(repo.has_revision(revid)) |
755 | |
756 | def assertRevisionNotInRepository(self, repo_path, revid): |
757 | """Check that a revision is not in a repo, disregarding stacking.""" |
758 | - repo = bzrdir.BzrDir.open(repo_path).open_repository() |
759 | + repo = controldir.ControlDir.open(repo_path).open_repository() |
760 | self.assertFalse(repo.has_revision(revid)) |
761 | |
762 | def assertRevisionsInBranchRepository(self, revid_list, branch_path): |
763 | @@ -400,7 +400,7 @@ |
764 | # capable of supporting stacking, but not actually have a stacked_on |
765 | # branch configured |
766 | self.assertRaises(errors.NotStacked, |
767 | - bzrdir.BzrDir.open('newbranch').open_branch().get_stacked_on_url) |
768 | + controldir.ControlDir.open('newbranch').open_branch().get_stacked_on_url) |
769 | |
770 | def test_branch_stacked_branch_stacked(self): |
771 | """Asking to stack on a stacked branch does work""" |
772 | |
773 | === modified file 'bzrlib/tests/blackbox/test_break_lock.py' |
774 | --- bzrlib/tests/blackbox/test_break_lock.py 2012-01-18 17:47:06 +0000 |
775 | +++ bzrlib/tests/blackbox/test_break_lock.py 2012-03-06 18:30:24 +0000 |
776 | @@ -18,8 +18,8 @@ |
777 | |
778 | from bzrlib import ( |
779 | branch, |
780 | - bzrdir, |
781 | config, |
782 | + controldir, |
783 | errors, |
784 | osutils, |
785 | tests, |
786 | @@ -54,13 +54,13 @@ |
787 | 'repo/', |
788 | 'repo/branch/', |
789 | 'checkout/']) |
790 | - bzrdir.BzrDir.create('master-repo').create_repository() |
791 | - self.master_branch = bzrdir.BzrDir.create_branch_convenience( |
792 | + controldir.ControlDir.create('master-repo').create_repository() |
793 | + self.master_branch = controldir.ControlDir.create_branch_convenience( |
794 | 'master-repo/master-branch') |
795 | - bzrdir.BzrDir.create('repo').create_repository() |
796 | - local_branch = bzrdir.BzrDir.create_branch_convenience('repo/branch') |
797 | + controldir.ControlDir.create('repo').create_repository() |
798 | + local_branch = controldir.ControlDir.create_branch_convenience('repo/branch') |
799 | local_branch.bind(self.master_branch) |
800 | - checkoutdir = bzrdir.BzrDir.create('checkout') |
801 | + checkoutdir = controldir.ControlDir.create('checkout') |
802 | checkoutdir.set_branch_reference(local_branch) |
803 | self.wt = checkoutdir.create_workingtree() |
804 | |
805 | |
806 | === modified file 'bzrlib/tests/blackbox/test_checkout.py' |
807 | --- bzrlib/tests/blackbox/test_checkout.py 2012-02-14 17:22:37 +0000 |
808 | +++ bzrlib/tests/blackbox/test_checkout.py 2012-03-06 18:30:24 +0000 |
809 | @@ -21,6 +21,7 @@ |
810 | from bzrlib import ( |
811 | branch as _mod_branch, |
812 | bzrdir, |
813 | + controldir, |
814 | errors, |
815 | workingtree, |
816 | ) |
817 | @@ -37,7 +38,7 @@ |
818 | |
819 | def setUp(self): |
820 | super(TestCheckout, self).setUp() |
821 | - tree = bzrdir.BzrDir.create_standalone_workingtree('branch') |
822 | + tree = controldir.ControlDir.create_standalone_workingtree('branch') |
823 | tree.commit('1', rev_id='1', allow_pointless=True) |
824 | self.build_tree(['branch/added_in_2']) |
825 | tree.add('added_in_2') |
826 | @@ -46,16 +47,16 @@ |
827 | def test_checkout_makes_bound_branch(self): |
828 | self.run_bzr('checkout branch checkout') |
829 | # if we have a checkout, the branch base should be 'branch' |
830 | - source = bzrdir.BzrDir.open('branch') |
831 | - result = bzrdir.BzrDir.open('checkout') |
832 | + source = controldir.ControlDir.open('branch') |
833 | + result = controldir.ControlDir.open('checkout') |
834 | self.assertEqual(source.open_branch().bzrdir.root_transport.base, |
835 | result.open_branch().get_bound_location()) |
836 | |
837 | def test_checkout_light_makes_checkout(self): |
838 | self.run_bzr('checkout --lightweight branch checkout') |
839 | # if we have a checkout, the branch base should be 'branch' |
840 | - source = bzrdir.BzrDir.open('branch') |
841 | - result = bzrdir.BzrDir.open('checkout') |
842 | + source = controldir.ControlDir.open('branch') |
843 | + result = controldir.ControlDir.open('checkout') |
844 | self.assertEqual(source.open_branch().bzrdir.root_transport.base, |
845 | result.open_branch().bzrdir.root_transport.base) |
846 | |
847 | @@ -63,7 +64,7 @@ |
848 | out, err = self.run_bzr(['checkout', '-r', '-2', 'branch', 'checkout']) |
849 | # the working tree should now be at revision '1' with the content |
850 | # from 1. |
851 | - result = bzrdir.BzrDir.open('checkout') |
852 | + result = controldir.ControlDir.open('checkout') |
853 | self.assertEqual(['1'], result.open_workingtree().get_parent_ids()) |
854 | self.assertPathDoesNotExist('checkout/added_in_2') |
855 | |
856 | @@ -72,14 +73,14 @@ |
857 | 'branch', 'checkout']) |
858 | # the working tree should now be at revision '1' with the content |
859 | # from 1. |
860 | - result = bzrdir.BzrDir.open('checkout') |
861 | + result = controldir.ControlDir.open('checkout') |
862 | self.assertEqual(['1'], result.open_workingtree().get_parent_ids()) |
863 | self.assertPathDoesNotExist('checkout/added_in_2') |
864 | |
865 | def test_checkout_into_empty_dir(self): |
866 | self.make_bzrdir('checkout') |
867 | out, err = self.run_bzr(['checkout', 'branch', 'checkout']) |
868 | - result = bzrdir.BzrDir.open('checkout') |
869 | + result = controldir.ControlDir.open('checkout') |
870 | tree = result.open_workingtree() |
871 | branch = result.open_branch() |
872 | |
873 | @@ -88,7 +89,7 @@ |
874 | # or a 'bzr checkout path' with path the name of a directory with |
875 | # a branch with no tree will reconsistute the tree. |
876 | os.mkdir('treeless-branch') |
877 | - branch = bzrdir.BzrDir.create_branch_convenience( |
878 | + branch = controldir.ControlDir.create_branch_convenience( |
879 | 'treeless-branch', |
880 | force_new_tree=False, |
881 | format=bzrdir.BzrDirMetaFormat1()) |
882 | @@ -101,7 +102,7 @@ |
883 | out, err = self.run_bzr('diff treeless-branch') |
884 | |
885 | # now test with no parameters |
886 | - branch = bzrdir.BzrDir.create_branch_convenience( |
887 | + branch = controldir.ControlDir.create_branch_convenience( |
888 | '.', |
889 | force_new_tree=False, |
890 | format=bzrdir.BzrDirMetaFormat1()) |
891 | |
892 | === modified file 'bzrlib/tests/blackbox/test_commit.py' |
893 | --- bzrlib/tests/blackbox/test_commit.py 2012-02-14 17:22:37 +0000 |
894 | +++ bzrlib/tests/blackbox/test_commit.py 2012-03-06 18:30:24 +0000 |
895 | @@ -30,7 +30,7 @@ |
896 | ignores, |
897 | msgeditor, |
898 | ) |
899 | -from bzrlib.bzrdir import BzrDir |
900 | +from bzrlib.controldir import ControlDir |
901 | from bzrlib.tests import ( |
902 | test_foreign, |
903 | features, |
904 | @@ -117,7 +117,7 @@ |
905 | def prepare_simple_history(self): |
906 | """Prepare and return a working tree with one commit of one file""" |
907 | # Commit with modified file should say so |
908 | - wt = BzrDir.create_standalone_workingtree('.') |
909 | + wt = ControlDir.create_standalone_workingtree('.') |
910 | self.build_tree(['hello.txt', 'extra.txt']) |
911 | wt.add(['hello.txt']) |
912 | wt.commit(message='added') |
913 | @@ -225,7 +225,7 @@ |
914 | def test_verbose_commit_with_unknown(self): |
915 | """Unknown files should not be listed by default in verbose output""" |
916 | # Is that really the best policy? |
917 | - wt = BzrDir.create_standalone_workingtree('.') |
918 | + wt = ControlDir.create_standalone_workingtree('.') |
919 | self.build_tree(['hello.txt', 'extra.txt']) |
920 | wt.add(['hello.txt']) |
921 | out,err = self.run_bzr('commit -m added') |
922 | @@ -757,7 +757,7 @@ |
923 | # "UnlockableTransport error trying to commit in checkout of readonly |
924 | # branch" |
925 | self.make_branch('master') |
926 | - master = BzrDir.open_from_transport( |
927 | + master = ControlDir.open_from_transport( |
928 | self.get_readonly_transport('master')).open_branch() |
929 | master.create_checkout('checkout') |
930 | out, err = self.run_bzr(['commit', '--unchanged', '-mfoo', 'checkout'], |
931 | |
932 | === modified file 'bzrlib/tests/blackbox/test_filtered_view_ops.py' |
933 | --- bzrlib/tests/blackbox/test_filtered_view_ops.py 2010-11-22 03:35:24 +0000 |
934 | +++ bzrlib/tests/blackbox/test_filtered_view_ops.py 2012-03-06 18:30:24 +0000 |
935 | @@ -16,10 +16,7 @@ |
936 | |
937 | """Tests that an enabled view is reported and impacts expected commands.""" |
938 | |
939 | -import os |
940 | - |
941 | from bzrlib import ( |
942 | - bzrdir, |
943 | osutils, |
944 | tests, |
945 | ) |
946 | |
947 | === modified file 'bzrlib/tests/blackbox/test_info.py' |
948 | --- bzrlib/tests/blackbox/test_info.py 2012-02-23 18:19:18 +0000 |
949 | +++ bzrlib/tests/blackbox/test_info.py 2012-03-06 18:30:24 +0000 |
950 | @@ -231,7 +231,7 @@ |
951 | # Branch and bind to standalone, needs upgrade to metadir |
952 | # (creates backup as unknown) |
953 | branch1.bzrdir.sprout('bound') |
954 | - knit1_format = bzrdir.format_registry.make_bzrdir('knit') |
955 | + knit1_format = controldir.format_registry.make_bzrdir('knit') |
956 | upgrade.upgrade('bound', knit1_format) |
957 | branch3 = controldir.ControlDir.open('bound').open_branch() |
958 | branch3.bind(branch1) |
959 | @@ -328,7 +328,7 @@ |
960 | tree5 = branch1.create_checkout('lightcheckout', lightweight=True) |
961 | branch5 = tree5.branch |
962 | out, err = self.run_bzr('info -v lightcheckout') |
963 | - if "metaweave" in bzrdir.format_registry: |
964 | + if "metaweave" in controldir.format_registry: |
965 | format_description = "knit or metaweave" |
966 | else: |
967 | format_description = "knit" |
968 | @@ -546,7 +546,7 @@ |
969 | |
970 | def test_info_standalone_no_tree(self): |
971 | # create standalone branch without a working tree |
972 | - format = bzrdir.format_registry.make_bzrdir('default') |
973 | + format = controldir.format_registry.make_bzrdir('default') |
974 | branch = self.make_branch('branch') |
975 | repo = branch.repository |
976 | out, err = self.run_bzr('info branch -v') |
977 | @@ -575,7 +575,7 @@ |
978 | self.assertEqual('', err) |
979 | |
980 | def test_info_shared_repository(self): |
981 | - format = bzrdir.format_registry.make_bzrdir('knit') |
982 | + format = controldir.format_registry.make_bzrdir('knit') |
983 | transport = self.get_transport() |
984 | |
985 | # Create shared repository |
986 | @@ -871,7 +871,7 @@ |
987 | self.assertEqual('', err) |
988 | |
989 | def test_info_shared_repository_with_trees(self): |
990 | - format = bzrdir.format_registry.make_bzrdir('knit') |
991 | + format = controldir.format_registry.make_bzrdir('knit') |
992 | transport = self.get_transport() |
993 | |
994 | # Create shared repository with working trees |
995 | @@ -1098,7 +1098,7 @@ |
996 | self.assertEqual('', err) |
997 | |
998 | def test_info_shared_repository_with_tree_in_root(self): |
999 | - format = bzrdir.format_registry.make_bzrdir('knit') |
1000 | + format = controldir.format_registry.make_bzrdir('knit') |
1001 | transport = self.get_transport() |
1002 | |
1003 | # Create shared repository with working trees |
1004 | @@ -1166,7 +1166,7 @@ |
1005 | self.assertEqual('', err) |
1006 | |
1007 | def test_info_repository_hook(self): |
1008 | - format = bzrdir.format_registry.make_bzrdir('knit') |
1009 | + format = controldir.format_registry.make_bzrdir('knit') |
1010 | def repo_info(repo, stats, outf): |
1011 | outf.write("more info\n") |
1012 | info.hooks.install_named_hook('repository', repo_info, None) |
1013 | @@ -1195,7 +1195,7 @@ |
1014 | self.assertEqual('', err) |
1015 | |
1016 | def test_info_unshared_repository_with_colocated_branches(self): |
1017 | - format = bzrdir.format_registry.make_bzrdir('development-colo') |
1018 | + format = controldir.format_registry.make_bzrdir('development-colo') |
1019 | transport = self.get_transport() |
1020 | |
1021 | # Create unshared repository |
1022 | |
1023 | === modified file 'bzrlib/tests/blackbox/test_join.py' |
1024 | --- bzrlib/tests/blackbox/test_join.py 2012-01-27 16:27:26 +0000 |
1025 | +++ bzrlib/tests/blackbox/test_join.py 2012-03-06 18:30:24 +0000 |
1026 | @@ -18,9 +18,7 @@ |
1027 | import os |
1028 | |
1029 | from bzrlib import ( |
1030 | - bzrdir, |
1031 | osutils, |
1032 | - repository, |
1033 | tests, |
1034 | workingtree, |
1035 | ) |
1036 | |
1037 | === modified file 'bzrlib/tests/blackbox/test_merge.py' |
1038 | --- bzrlib/tests/blackbox/test_merge.py 2012-01-05 17:56:30 +0000 |
1039 | +++ bzrlib/tests/blackbox/test_merge.py 2012-03-06 18:30:24 +0000 |
1040 | @@ -26,8 +26,8 @@ |
1041 | |
1042 | from bzrlib import ( |
1043 | branch, |
1044 | - bzrdir, |
1045 | conflicts, |
1046 | + controldir, |
1047 | merge_directive, |
1048 | osutils, |
1049 | tests, |
1050 | @@ -75,7 +75,7 @@ |
1051 | return tree, other |
1052 | |
1053 | def test_merge_reprocess(self): |
1054 | - d = bzrdir.BzrDir.create_standalone_workingtree('.') |
1055 | + d = controldir.ControlDir.create_standalone_workingtree('.') |
1056 | d.commit('h') |
1057 | self.run_bzr('merge . --reprocess --merge-type weave') |
1058 | |
1059 | |
1060 | === modified file 'bzrlib/tests/blackbox/test_re_sign.py' |
1061 | --- bzrlib/tests/blackbox/test_re_sign.py 2011-12-09 12:05:47 +0000 |
1062 | +++ bzrlib/tests/blackbox/test_re_sign.py 2012-03-06 18:30:24 +0000 |
1063 | @@ -23,7 +23,7 @@ |
1064 | gpg, |
1065 | tests, |
1066 | ) |
1067 | -from bzrlib.bzrdir import BzrDir |
1068 | +from bzrlib.controldir import ControlDir |
1069 | from bzrlib.testament import Testament |
1070 | |
1071 | |
1072 | @@ -39,7 +39,7 @@ |
1073 | self.overrideAttr(gpg, 'GPGStrategy', gpg.LoopbackGPGStrategy) |
1074 | |
1075 | def setup_tree(self): |
1076 | - wt = BzrDir.create_standalone_workingtree('.') |
1077 | + wt = ControlDir.create_standalone_workingtree('.') |
1078 | wt.commit("base A", allow_pointless=True, rev_id='A') |
1079 | wt.commit("base B", allow_pointless=True, rev_id='B') |
1080 | wt.commit("base C", allow_pointless=True, rev_id='C') |
1081 | @@ -89,7 +89,7 @@ |
1082 | |
1083 | def test_resign_directory(self): |
1084 | """Test --directory option""" |
1085 | - wt = BzrDir.create_standalone_workingtree('a') |
1086 | + wt = ControlDir.create_standalone_workingtree('a') |
1087 | wt.commit("base A", allow_pointless=True, rev_id='A') |
1088 | wt.commit("base B", allow_pointless=True, rev_id='B') |
1089 | wt.commit("base C", allow_pointless=True, rev_id='C') |
1090 | |
1091 | === modified file 'bzrlib/tests/blackbox/test_reconcile.py' |
1092 | --- bzrlib/tests/blackbox/test_reconcile.py 2011-12-14 20:21:52 +0000 |
1093 | +++ bzrlib/tests/blackbox/test_reconcile.py 2012-03-06 18:30:24 +0000 |
1094 | @@ -18,7 +18,7 @@ |
1095 | |
1096 | |
1097 | from bzrlib import ( |
1098 | - bzrdir, |
1099 | + controldir, |
1100 | inventory, |
1101 | tests, |
1102 | ) |
1103 | @@ -28,7 +28,7 @@ |
1104 | class TrivialTest(tests.TestCaseWithTransport): |
1105 | |
1106 | def test_trivial_reconcile(self): |
1107 | - t = bzrdir.BzrDir.create_standalone_workingtree('.') |
1108 | + t = controldir.ControlDir.create_standalone_workingtree('.') |
1109 | (out, err) = self.run_bzr('reconcile') |
1110 | if t.branch.repository._reconcile_backsup_inventory: |
1111 | does_backup_text = "Inventory ok.\n" |
1112 | @@ -45,7 +45,7 @@ |
1113 | self.assertEqualDiff(err, "") |
1114 | |
1115 | def test_does_something_reconcile(self): |
1116 | - t = bzrdir.BzrDir.create_standalone_workingtree('.') |
1117 | + t = controldir.ControlDir.create_standalone_workingtree('.') |
1118 | # an empty inventory with no revision will trigger reconciliation. |
1119 | repo = t.branch.repository |
1120 | inv = inventory.Inventory(revision_id='missing') |
1121 | |
1122 | === modified file 'bzrlib/tests/blackbox/test_reconfigure.py' |
1123 | --- bzrlib/tests/blackbox/test_reconfigure.py 2012-01-09 20:55:07 +0000 |
1124 | +++ bzrlib/tests/blackbox/test_reconfigure.py 2012-03-06 18:30:24 +0000 |
1125 | @@ -15,12 +15,11 @@ |
1126 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
1127 | |
1128 | from bzrlib import ( |
1129 | - bzrdir, |
1130 | + controldir, |
1131 | errors, |
1132 | tests, |
1133 | workingtree, |
1134 | ) |
1135 | -from bzrlib.branchbuilder import BranchBuilder |
1136 | from bzrlib.tests.script import TestCaseWithTransportAndScript |
1137 | |
1138 | |
1139 | @@ -86,7 +85,7 @@ |
1140 | |
1141 | def test_use_shared_to_standalone(self): |
1142 | repo = self.make_repository('repo', shared=True) |
1143 | - branch = bzrdir.BzrDir.create_branch_convenience('repo/tree') |
1144 | + branch = controldir.ControlDir.create_branch_convenience('repo/tree') |
1145 | self.assertNotEqual(branch.bzrdir.root_transport.base, |
1146 | branch.repository.bzrdir.root_transport.base) |
1147 | self.run_bzr('reconfigure --standalone', working_dir='repo/tree') |
1148 | @@ -126,7 +125,7 @@ |
1149 | |
1150 | def test_make_without_trees_leaves_tree_alone(self): |
1151 | repo = self.make_repository('repo', shared=True) |
1152 | - branch = bzrdir.BzrDir.create_branch_convenience('repo/branch') |
1153 | + branch = controldir.ControlDir.create_branch_convenience('repo/branch') |
1154 | tree = workingtree.WorkingTree.open('repo/branch') |
1155 | self.build_tree(['repo/branch/foo']) |
1156 | tree.add('foo') |
1157 | @@ -137,7 +136,7 @@ |
1158 | |
1159 | def test_shared_format_to_standalone(self, format=None): |
1160 | repo = self.make_repository('repo', shared=True, format=format) |
1161 | - branch = bzrdir.BzrDir.create_branch_convenience('repo/tree') |
1162 | + branch = controldir.ControlDir.create_branch_convenience('repo/tree') |
1163 | self.assertNotEqual(branch.bzrdir.root_transport.base, |
1164 | branch.repository.bzrdir.root_transport.base) |
1165 | tree = workingtree.WorkingTree.open('repo/tree') |
1166 | |
1167 | === modified file 'bzrlib/tests/blackbox/test_reference.py' |
1168 | --- bzrlib/tests/blackbox/test_reference.py 2011-09-21 20:29:48 +0000 |
1169 | +++ bzrlib/tests/blackbox/test_reference.py 2012-03-06 18:30:24 +0000 |
1170 | @@ -17,7 +17,7 @@ |
1171 | |
1172 | from bzrlib import ( |
1173 | branch as _mod_branch, |
1174 | - bzrdir, |
1175 | + controldir, |
1176 | ) |
1177 | from bzrlib.tests import TestCaseWithTransport |
1178 | |
1179 | @@ -25,7 +25,7 @@ |
1180 | class TestReference(TestCaseWithTransport): |
1181 | |
1182 | def get_default_format(self): |
1183 | - format = bzrdir.format_registry.make_bzrdir('1.9') |
1184 | + format = controldir.format_registry.make_bzrdir('1.9') |
1185 | format.set_branch_format(_mod_branch.BzrBranchFormat8()) |
1186 | return format |
1187 | |
1188 | |
1189 | === modified file 'bzrlib/tests/blackbox/test_rmbranch.py' |
1190 | --- bzrlib/tests/blackbox/test_rmbranch.py 2012-02-28 10:10:24 +0000 |
1191 | +++ bzrlib/tests/blackbox/test_rmbranch.py 2012-03-06 18:30:24 +0000 |
1192 | @@ -18,7 +18,7 @@ |
1193 | """Black-box tests for bzr rmbranch.""" |
1194 | |
1195 | from bzrlib import ( |
1196 | - bzrdir, |
1197 | + controldir, |
1198 | ) |
1199 | from bzrlib.tests import ( |
1200 | TestCaseWithTransport, |
1201 | @@ -44,7 +44,7 @@ |
1202 | self.run_bzr_error(['Branch is active. Use --force to remove it.\n'], |
1203 | 'rmbranch a') |
1204 | self.run_bzr('rmbranch --force a') |
1205 | - dir = bzrdir.BzrDir.open('a') |
1206 | + dir = controldir.ControlDir.open('a') |
1207 | self.assertFalse(dir.has_branch()) |
1208 | self.assertPathExists('a/hello') |
1209 | self.assertPathExists('a/goodbye') |
1210 | @@ -60,7 +60,7 @@ |
1211 | tree = self.example_tree('a') |
1212 | tree.bzrdir.destroy_workingtree() |
1213 | self.run_bzr('rmbranch', working_dir='a') |
1214 | - dir = bzrdir.BzrDir.open('a') |
1215 | + dir = controldir.ControlDir.open('a') |
1216 | self.assertFalse(dir.has_branch()) |
1217 | |
1218 | def test_no_arg(self): |
1219 | @@ -69,7 +69,7 @@ |
1220 | self.run_bzr_error(['Branch is active. Use --force to remove it.\n'], |
1221 | 'rmbranch a') |
1222 | self.run_bzr('rmbranch --force', working_dir='a') |
1223 | - dir = bzrdir.BzrDir.open('a') |
1224 | + dir = controldir.ControlDir.open('a') |
1225 | self.assertFalse(dir.has_branch()) |
1226 | |
1227 | def test_remove_colo(self): |
1228 | @@ -78,7 +78,7 @@ |
1229 | tree.bzrdir.create_branch(name="otherbranch") |
1230 | self.assertTrue(tree.bzrdir.has_branch('otherbranch')) |
1231 | self.run_bzr('rmbranch %s,branch=otherbranch' % tree.bzrdir.user_url) |
1232 | - dir = bzrdir.BzrDir.open('a') |
1233 | + dir = controldir.ControlDir.open('a') |
1234 | self.assertFalse(dir.has_branch('otherbranch')) |
1235 | self.assertTrue(dir.has_branch()) |
1236 | |
1237 | @@ -88,7 +88,7 @@ |
1238 | tree.bzrdir.create_branch(name="otherbranch") |
1239 | self.assertTrue(tree.bzrdir.has_branch('otherbranch')) |
1240 | self.run_bzr('rmbranch otherbranch -d %s' % tree.bzrdir.user_url) |
1241 | - dir = bzrdir.BzrDir.open('a') |
1242 | + dir = controldir.ControlDir.open('a') |
1243 | self.assertFalse(dir.has_branch('otherbranch')) |
1244 | self.assertTrue(dir.has_branch()) |
1245 | |
1246 | |
1247 | === modified file 'bzrlib/tests/blackbox/test_send.py' |
1248 | --- bzrlib/tests/blackbox/test_send.py 2012-02-14 17:22:37 +0000 |
1249 | +++ bzrlib/tests/blackbox/test_send.py 2012-03-06 18:30:24 +0000 |
1250 | @@ -20,7 +20,6 @@ |
1251 | |
1252 | from bzrlib import ( |
1253 | branch, |
1254 | - bzrdir, |
1255 | merge_directive, |
1256 | tests, |
1257 | ) |
1258 | @@ -63,7 +62,7 @@ |
1259 | |
1260 | def setUp(self): |
1261 | super(TestSend, self).setUp() |
1262 | - grandparent_tree = bzrdir.BzrDir.create_standalone_workingtree( |
1263 | + grandparent_tree = ControlDir.create_standalone_workingtree( |
1264 | 'grandparent') |
1265 | self.build_tree_contents([('grandparent/file1', 'grandparent')]) |
1266 | grandparent_tree.add('file1') |
1267 | @@ -275,7 +274,7 @@ |
1268 | |
1269 | def make_parent_and_local_branches(self): |
1270 | # Create a 'parent' branch as the base |
1271 | - self.parent_tree = bzrdir.BzrDir.create_standalone_workingtree('parent') |
1272 | + self.parent_tree = ControlDir.create_standalone_workingtree('parent') |
1273 | self.build_tree_contents([('parent/file', 'parent')]) |
1274 | self.parent_tree.add('file') |
1275 | self.parent_tree.commit('first commit', rev_id='parent') |
1276 | |
1277 | === modified file 'bzrlib/tests/blackbox/test_serve.py' |
1278 | --- bzrlib/tests/blackbox/test_serve.py 2012-02-24 20:22:06 +0000 |
1279 | +++ bzrlib/tests/blackbox/test_serve.py 2012-03-06 18:30:24 +0000 |
1280 | @@ -34,7 +34,7 @@ |
1281 | urlutils, |
1282 | ) |
1283 | from bzrlib.branch import Branch |
1284 | -from bzrlib.bzrdir import BzrDir |
1285 | +from bzrlib.controldir import ControlDir |
1286 | from bzrlib.smart import client, medium |
1287 | from bzrlib.smart.server import ( |
1288 | BzrServerFactory, |
1289 | @@ -221,7 +221,7 @@ |
1290 | process, transport = self.start_server_inet(['--allow-writes']) |
1291 | |
1292 | # We get a working branch, and can create a directory |
1293 | - branch = BzrDir.open_from_transport(transport).open_branch() |
1294 | + branch = ControlDir.open_from_transport(transport).open_branch() |
1295 | self.make_read_requests(branch) |
1296 | transport.mkdir('adir') |
1297 | self.assertInetServerShutsdownCleanly(process) |
1298 | @@ -263,7 +263,7 @@ |
1299 | log_fname = os.getcwd() + '/server.log' |
1300 | self.overrideEnv('BZR_LOG', log_fname) |
1301 | process, transport = self.start_server_inet(['-Dhpss']) |
1302 | - branch = BzrDir.open_from_transport(transport).open_branch() |
1303 | + branch = ControlDir.open_from_transport(transport).open_branch() |
1304 | self.make_read_requests(branch) |
1305 | self.assertInetServerShutsdownCleanly(process) |
1306 | f = open(log_fname, 'rb') |
1307 | |
1308 | === modified file 'bzrlib/tests/blackbox/test_shared_repository.py' |
1309 | --- bzrlib/tests/blackbox/test_shared_repository.py 2012-01-25 21:13:15 +0000 |
1310 | +++ bzrlib/tests/blackbox/test_shared_repository.py 2012-03-06 18:30:24 +0000 |
1311 | @@ -18,7 +18,8 @@ |
1312 | |
1313 | import os |
1314 | |
1315 | -from bzrlib.bzrdir import BzrDir, BzrDirMetaFormat1 |
1316 | +from bzrlib.bzrdir import BzrDirMetaFormat1 |
1317 | +from bzrlib.controldir import ControlDir |
1318 | import bzrlib.errors as errors |
1319 | from bzrlib.tests import TestCaseInTempDir |
1320 | from bzrlib.tests.matchers import ContainsNoVfsCalls |
1321 | @@ -34,7 +35,7 @@ |
1322 | shared repository: a |
1323 | """) |
1324 | self.assertEqual(err, "") |
1325 | - dir = BzrDir.open('a') |
1326 | + dir = ControlDir.open('a') |
1327 | self.assertIs(dir.open_repository().is_shared(), True) |
1328 | self.assertRaises(errors.NotBranchError, dir.open_branch) |
1329 | self.assertRaises(errors.NoWorkingTree, dir.open_workingtree) |
1330 | @@ -43,7 +44,7 @@ |
1331 | out, err = self.run_bzr("init-repository a -q") |
1332 | self.assertEqual(out, "") |
1333 | self.assertEqual(err, "") |
1334 | - dir = BzrDir.open('a') |
1335 | + dir = ControlDir.open('a') |
1336 | self.assertIs(dir.open_repository().is_shared(), True) |
1337 | self.assertRaises(errors.NotBranchError, dir.open_branch) |
1338 | self.assertRaises(errors.NoWorkingTree, dir.open_workingtree) |
1339 | @@ -54,17 +55,17 @@ |
1340 | (Malone #38331) |
1341 | """ |
1342 | out, err = self.run_bzr("init-repository .") |
1343 | - dir = BzrDir.open('.') |
1344 | + dir = ControlDir.open('.') |
1345 | self.assertTrue(dir.open_repository()) |
1346 | |
1347 | def test_init(self): |
1348 | self.run_bzr("init-repo a") |
1349 | self.run_bzr("init --format=default a/b") |
1350 | - dir = BzrDir.open('a') |
1351 | + dir = ControlDir.open('a') |
1352 | self.assertIs(dir.open_repository().is_shared(), True) |
1353 | self.assertRaises(errors.NotBranchError, dir.open_branch) |
1354 | self.assertRaises(errors.NoWorkingTree, dir.open_workingtree) |
1355 | - bdir = BzrDir.open('a/b') |
1356 | + bdir = ControlDir.open('a/b') |
1357 | bdir.open_branch() |
1358 | self.assertRaises(errors.NoRepositoryPresent, bdir.open_repository) |
1359 | wt = bdir.open_workingtree() |
1360 | @@ -73,7 +74,7 @@ |
1361 | self.run_bzr("init-repo a") |
1362 | self.run_bzr("init --format=default a/b") |
1363 | self.run_bzr('branch a/b a/c') |
1364 | - cdir = BzrDir.open('a/c') |
1365 | + cdir = ControlDir.open('a/c') |
1366 | cdir.open_branch() |
1367 | self.assertRaises(errors.NoRepositoryPresent, cdir.open_repository) |
1368 | cdir.open_workingtree() |
1369 | @@ -86,7 +87,7 @@ |
1370 | self.run_bzr("commit -m bar b/hello") |
1371 | |
1372 | self.run_bzr('branch b a/c') |
1373 | - cdir = BzrDir.open('a/c') |
1374 | + cdir = ControlDir.open('a/c') |
1375 | cdir.open_branch() |
1376 | self.assertRaises(errors.NoRepositoryPresent, cdir.open_repository) |
1377 | self.assertPathExists('a/c/hello') |
1378 | @@ -95,20 +96,20 @@ |
1379 | def test_trees_default(self): |
1380 | # 0.15 switched to trees by default |
1381 | self.run_bzr("init-repo repo") |
1382 | - repo = BzrDir.open("repo").open_repository() |
1383 | + repo = ControlDir.open("repo").open_repository() |
1384 | self.assertEqual(True, repo.make_working_trees()) |
1385 | |
1386 | def test_trees_argument(self): |
1387 | # Supplying the --trees argument should be harmless, |
1388 | # as it was previously non-default we need to get it right. |
1389 | self.run_bzr("init-repo --trees trees") |
1390 | - repo = BzrDir.open("trees").open_repository() |
1391 | + repo = ControlDir.open("trees").open_repository() |
1392 | self.assertEqual(True, repo.make_working_trees()) |
1393 | |
1394 | def test_no_trees_argument(self): |
1395 | # --no-trees should make it so that there is no working tree |
1396 | self.run_bzr("init-repo --no-trees notrees") |
1397 | - repo = BzrDir.open("notrees").open_repository() |
1398 | + repo = ControlDir.open("notrees").open_repository() |
1399 | self.assertEqual(False, repo.make_working_trees()) |
1400 | |
1401 | def test_init_repo_smart_acceptance(self): |
1402 | @@ -129,7 +130,7 @@ |
1403 | out, err = self.run_bzr("init-repository -q a") |
1404 | self.assertEqual(out, "") |
1405 | self.assertEqual(err, "") |
1406 | - dir = BzrDir.open('a') |
1407 | + dir = ControlDir.open('a') |
1408 | dir.open_repository() # there is a repository there |
1409 | e = self.assertRaises(errors.NotBranchError, dir.open_branch) |
1410 | self.assertContainsRe(str(e), "location is a repository") |
1411 | @@ -145,7 +146,7 @@ |
1412 | |
1413 | def test_init_repo_with_post_repo_init_hook(self): |
1414 | calls = [] |
1415 | - BzrDir.hooks.install_named_hook('post_repo_init', calls.append, None) |
1416 | + ControlDir.hooks.install_named_hook('post_repo_init', calls.append, None) |
1417 | self.assertLength(0, calls) |
1418 | self.run_bzr("init-repository a") |
1419 | self.assertLength(1, calls) |
1420 | |
1421 | === modified file 'bzrlib/tests/blackbox/test_switch.py' |
1422 | --- bzrlib/tests/blackbox/test_switch.py 2012-02-28 10:02:24 +0000 |
1423 | +++ bzrlib/tests/blackbox/test_switch.py 2012-03-06 18:30:24 +0000 |
1424 | @@ -20,17 +20,17 @@ |
1425 | |
1426 | import os |
1427 | |
1428 | -from bzrlib.bzrdir import BzrDir |
1429 | +from bzrlib.controldir import ControlDir |
1430 | from bzrlib import ( |
1431 | - osutils, |
1432 | - urlutils, |
1433 | - branch, |
1434 | - ) |
1435 | + osutils, |
1436 | + urlutils, |
1437 | + branch, |
1438 | + ) |
1439 | from bzrlib.workingtree import WorkingTree |
1440 | from bzrlib.tests import ( |
1441 | - TestCaseWithTransport, |
1442 | - script, |
1443 | - ) |
1444 | + TestCaseWithTransport, |
1445 | + script, |
1446 | + ) |
1447 | from bzrlib.tests.features import UnicodeFilenameFeature |
1448 | from bzrlib.directory_service import directories |
1449 | |
1450 | @@ -237,7 +237,7 @@ |
1451 | tree.add('file-1') |
1452 | revid1 = tree.commit('rev1') |
1453 | self.run_bzr(['switch', '-b', 'anotherbranch'], working_dir='branch-1') |
1454 | - bzrdir = BzrDir.open("branch-1") |
1455 | + bzrdir = ControlDir.open("branch-1") |
1456 | self.assertEquals( |
1457 | set([b.name for b in bzrdir.list_branches()]), |
1458 | set(["foo", "anotherbranch"])) |
1459 | @@ -256,7 +256,7 @@ |
1460 | tree.add('file-1') |
1461 | revid1 = tree.commit('rev1') |
1462 | self.run_bzr(['switch', '-b', u'branch\xe9'], working_dir='branch-1') |
1463 | - bzrdir = BzrDir.open("branch-1") |
1464 | + bzrdir = ControlDir.open("branch-1") |
1465 | self.assertEquals( |
1466 | set([b.name for b in bzrdir.list_branches()]), |
1467 | set(["foo", u"branch\xe9"])) |
1468 | |
1469 | === modified file 'bzrlib/tests/blackbox/test_upgrade.py' |
1470 | --- bzrlib/tests/blackbox/test_upgrade.py 2011-12-07 14:16:12 +0000 |
1471 | +++ bzrlib/tests/blackbox/test_upgrade.py 2012-03-06 18:30:24 +0000 |
1472 | @@ -49,7 +49,7 @@ |
1473 | 'branch-format', |
1474 | bzrdir.BzrDirMetaFormat1().get_format_string(), |
1475 | mode=to_convert._get_file_mode()) |
1476 | - return bzrdir.BzrDir.open(to_convert.user_url) |
1477 | + return controldir.ControlDir.open(to_convert.user_url) |
1478 | |
1479 | |
1480 | class OldBzrDirFormat(bzrdir.BzrDirMetaFormat1): |
1481 | @@ -155,7 +155,7 @@ |
1482 | """ % (display_url, display_url, display_url, display_url, backup_dir), out) |
1483 | self.assertEqualDiff("", err) |
1484 | self.assertTrue(isinstance( |
1485 | - bzrdir.BzrDir.open(self.get_url(path))._format, |
1486 | + controldir.ControlDir.open(self.get_url(path))._format, |
1487 | bzrdir.BzrDirMetaFormat1)) |
1488 | |
1489 | def test_upgrade_explicit_knit(self): |
1490 | @@ -179,7 +179,7 @@ |
1491 | """ % (display_url, display_url, display_url, display_url, backup_dir), |
1492 | out) |
1493 | self.assertEqualDiff("", err) |
1494 | - converted_dir = bzrdir.BzrDir.open(self.get_url('branch')) |
1495 | + converted_dir = controldir.ControlDir.open(self.get_url('branch')) |
1496 | self.assertTrue(isinstance(converted_dir._format, |
1497 | bzrdir.BzrDirMetaFormat1)) |
1498 | self.assertTrue(isinstance(converted_dir.open_repository()._format, |
1499 | @@ -196,9 +196,9 @@ |
1500 | self.run_bzr('upgrade --format=2a branch-foo %s' % (option_str,)) |
1501 | |
1502 | def assertBranchFormat(self, dir, format): |
1503 | - branch = bzrdir.BzrDir.open_tree_or_branch(self.get_url(dir))[1] |
1504 | + branch = controldir.ControlDir.open_tree_or_branch(self.get_url(dir))[1] |
1505 | branch_format = branch._format |
1506 | - meta_format = bzrdir.format_registry.make_bzrdir(format) |
1507 | + meta_format = controldir.format_registry.make_bzrdir(format) |
1508 | expected_format = meta_format.get_branch_format() |
1509 | self.assertEqual(expected_format, branch_format) |
1510 | |
1511 | @@ -245,7 +245,7 @@ |
1512 | """ % (display_url, display_url, display_url, display_url, backup_dir2), out) |
1513 | self.assertEqualDiff("", err) |
1514 | self.assertTrue(isinstance( |
1515 | - bzrdir.BzrDir.open(self.get_url("old_format_branch"))._format, |
1516 | + controldir.ControlDir.open(self.get_url("old_format_branch"))._format, |
1517 | bzrdir.BzrDirMetaFormat1)) |
1518 | self.assertTrue(t.has(backup_dir2)) |
1519 | |
1520 | |
1521 | === modified file 'bzrlib/tests/per_branch/test_bound_sftp.py' |
1522 | --- bzrlib/tests/per_branch/test_bound_sftp.py 2012-01-25 21:13:15 +0000 |
1523 | +++ bzrlib/tests/per_branch/test_bound_sftp.py 2012-03-06 18:30:24 +0000 |
1524 | @@ -21,7 +21,7 @@ |
1525 | |
1526 | from bzrlib import ( |
1527 | branch, |
1528 | - bzrdir, |
1529 | + controldir, |
1530 | errors, |
1531 | tests, |
1532 | ) |
1533 | @@ -39,9 +39,9 @@ |
1534 | |
1535 | def create_branches(self): |
1536 | self.build_tree(['base/', 'base/a', 'base/b']) |
1537 | - format = bzrdir.format_registry.make_bzrdir('knit') |
1538 | + format = controldir.format_registry.make_bzrdir('knit') |
1539 | try: |
1540 | - wt_base = bzrdir.BzrDir.create_standalone_workingtree( |
1541 | + wt_base = controldir.ControlDir.create_standalone_workingtree( |
1542 | self.get_url('base'), format=format) |
1543 | except errors.NotLocalUrl: |
1544 | raise tests.TestSkipped('Not a local URL') |
1545 | @@ -63,7 +63,7 @@ |
1546 | def test_simple_binding(self): |
1547 | self.build_tree(['base/', 'base/a', 'base/b', 'child/']) |
1548 | try: |
1549 | - wt_base = bzrdir.BzrDir.create_standalone_workingtree( |
1550 | + wt_base = controldir.ControlDir.create_standalone_workingtree( |
1551 | self.get_url('base')) |
1552 | except errors.NotLocalUrl: |
1553 | raise tests.TestSkipped('Not a local URL') |
1554 | @@ -76,8 +76,8 @@ |
1555 | # manually make a branch we can bind, because the default format |
1556 | # may not be bindable-from, and we want to test the side effects etc |
1557 | # of bondage. |
1558 | - format = bzrdir.format_registry.make_bzrdir('knit') |
1559 | - b_child = bzrdir.BzrDir.create_branch_convenience( |
1560 | + format = controldir.format_registry.make_bzrdir('knit') |
1561 | + b_child = controldir.ControlDir.create_branch_convenience( |
1562 | 'child', format=format) |
1563 | self.assertEqual(None, b_child.get_bound_location()) |
1564 | self.assertEqual(None, b_child.get_master_branch()) |
1565 | @@ -144,7 +144,6 @@ |
1566 | wt_child2.commit, 'child2', rev_id='r@d-2') |
1567 | |
1568 | def test_unbinding(self): |
1569 | - from bzrlib import transport |
1570 | b_base, wt_child = self.create_branches() |
1571 | |
1572 | # TestCaseWithSFTPServer only allows you to connect one time |
1573 | |
1574 | === modified file 'bzrlib/tests/per_branch/test_branch.py' |
1575 | --- bzrlib/tests/per_branch/test_branch.py 2012-02-14 17:22:37 +0000 |
1576 | +++ bzrlib/tests/per_branch/test_branch.py 2012-03-06 18:30:24 +0000 |
1577 | @@ -18,7 +18,7 @@ |
1578 | |
1579 | from bzrlib import ( |
1580 | branch as _mod_branch, |
1581 | - bzrdir, |
1582 | + controldir, |
1583 | config, |
1584 | delta as _mod_delta, |
1585 | errors, |
1586 | @@ -708,7 +708,7 @@ |
1587 | self.assertIsInstance(made_branch, _mod_branch.Branch) |
1588 | |
1589 | # find it via bzrdir opening: |
1590 | - opened_control = bzrdir.BzrDir.open(readonly_t.base) |
1591 | + opened_control = controldir.ControlDir.open(readonly_t.base) |
1592 | direct_opened_branch = opened_control.open_branch() |
1593 | self.assertEqual(direct_opened_branch.__class__, made_branch.__class__) |
1594 | self.assertEqual(opened_control, direct_opened_branch.bzrdir) |
1595 | @@ -849,13 +849,13 @@ |
1596 | def test_fallbacks_not_opened(self): |
1597 | stacked = self.make_branch_with_fallback() |
1598 | self.get_transport('').rename('fallback', 'moved') |
1599 | - reopened_dir = bzrdir.BzrDir.open(stacked.base) |
1600 | + reopened_dir = controldir.ControlDir.open(stacked.base) |
1601 | reopened = reopened_dir.open_branch(ignore_fallbacks=True) |
1602 | self.assertEqual([], reopened.repository._fallback_repositories) |
1603 | |
1604 | def test_fallbacks_are_opened(self): |
1605 | stacked = self.make_branch_with_fallback() |
1606 | - reopened_dir = bzrdir.BzrDir.open(stacked.base) |
1607 | + reopened_dir = controldir.ControlDir.open(stacked.base) |
1608 | reopened = reopened_dir.open_branch(ignore_fallbacks=False) |
1609 | self.assertLength(1, reopened.repository._fallback_repositories) |
1610 | |
1611 | |
1612 | === modified file 'bzrlib/tests/per_branch/test_permissions.py' |
1613 | --- bzrlib/tests/per_branch/test_permissions.py 2011-09-12 09:51:52 +0000 |
1614 | +++ bzrlib/tests/per_branch/test_permissions.py 2012-03-06 18:30:24 +0000 |
1615 | @@ -32,7 +32,7 @@ |
1616 | |
1617 | from bzrlib import tests |
1618 | from bzrlib.branch import BzrBranch |
1619 | -from bzrlib.bzrdir import BzrDir |
1620 | +from bzrlib.controldir import ControlDir |
1621 | from bzrlib.remote import RemoteBranchFormat |
1622 | from bzrlib.tests.test_permissions import check_mode_r |
1623 | |
1624 | @@ -126,7 +126,7 @@ |
1625 | raise tests.TestNotApplicable('Remote branches have no' |
1626 | ' permission logic') |
1627 | self.make_branch_and_tree('.') |
1628 | - bzrdir = BzrDir.open('.') |
1629 | + bzrdir = ControlDir.open('.') |
1630 | # Monkey patch the transport |
1631 | _orig_stat = bzrdir.transport.stat |
1632 | def null_perms_stat(*args, **kwargs): |
1633 | |
1634 | === modified file 'bzrlib/tests/per_branch/test_pull.py' |
1635 | --- bzrlib/tests/per_branch/test_pull.py 2011-12-27 12:18:36 +0000 |
1636 | +++ bzrlib/tests/per_branch/test_pull.py 2012-03-06 18:30:24 +0000 |
1637 | @@ -18,7 +18,7 @@ |
1638 | |
1639 | from bzrlib import ( |
1640 | branch, |
1641 | - bzrdir, |
1642 | + controldir, |
1643 | errors, |
1644 | memorytree, |
1645 | revision, |
1646 | @@ -238,7 +238,7 @@ |
1647 | # remotebranches can't be bound. Let's instead make a new local |
1648 | # branch of the default type, which does allow binding. |
1649 | # See https://bugs.launchpad.net/bzr/+bug/112020 |
1650 | - local = bzrdir.BzrDir.create_branch_convenience('local2') |
1651 | + local = controldir.ControlDir.create_branch_convenience('local2') |
1652 | local.bind(target) |
1653 | source = self.make_branch('source') |
1654 | branch.Branch.hooks.install_named_hook( |
1655 | |
1656 | === modified file 'bzrlib/tests/per_branch/test_push.py' |
1657 | --- bzrlib/tests/per_branch/test_push.py 2011-09-26 15:21:01 +0000 |
1658 | +++ bzrlib/tests/per_branch/test_push.py 2012-03-06 18:30:24 +0000 |
1659 | @@ -22,7 +22,7 @@ |
1660 | from bzrlib import ( |
1661 | branch, |
1662 | builtins, |
1663 | - bzrdir, |
1664 | + controldir, |
1665 | check, |
1666 | errors, |
1667 | memorytree, |
1668 | @@ -173,7 +173,7 @@ |
1669 | if self.vfs_transport_factory is test_server.LocalURLServer: |
1670 | # the branch is colocated on disk, we cannot create a checkout. |
1671 | # hopefully callers will expect this. |
1672 | - local_controldir= bzrdir.BzrDir.open( |
1673 | + local_controldir = controldir.ControlDir.open( |
1674 | self.get_vfs_only_url('repo/tree')) |
1675 | tree = local_controldir.create_workingtree() |
1676 | else: |
1677 | @@ -355,7 +355,7 @@ |
1678 | # remotebranches can't be bound. Let's instead make a new local |
1679 | # branch of the default type, which does allow binding. |
1680 | # See https://bugs.launchpad.net/bzr/+bug/112020 |
1681 | - local = bzrdir.BzrDir.create_branch_convenience('local2') |
1682 | + local = controldir.ControlDir.create_branch_convenience('local2') |
1683 | local.bind(target) |
1684 | source = self.make_branch('source') |
1685 | branch.Branch.hooks.install_named_hook( |
1686 | |
1687 | === modified file 'bzrlib/tests/per_branch/test_stacking.py' |
1688 | --- bzrlib/tests/per_branch/test_stacking.py 2011-11-24 17:24:21 +0000 |
1689 | +++ bzrlib/tests/per_branch/test_stacking.py 2012-03-06 18:30:24 +0000 |
1690 | @@ -18,7 +18,7 @@ |
1691 | |
1692 | from bzrlib import ( |
1693 | branch, |
1694 | - bzrdir, |
1695 | + controldir, |
1696 | check, |
1697 | errors, |
1698 | ) |
1699 | @@ -107,12 +107,12 @@ |
1700 | |
1701 | def assertRevisionInRepository(self, repo_path, revid): |
1702 | """Check that a revision is in a repository, disregarding stacking.""" |
1703 | - repo = bzrdir.BzrDir.open(repo_path).open_repository() |
1704 | + repo = controldir.ControlDir.open(repo_path).open_repository() |
1705 | self.assertTrue(repo.has_revision(revid)) |
1706 | |
1707 | def assertRevisionNotInRepository(self, repo_path, revid): |
1708 | """Check that a revision is not in a repository, disregarding stacking.""" |
1709 | - repo = bzrdir.BzrDir.open(repo_path).open_repository() |
1710 | + repo = controldir.ControlDir.open(repo_path).open_repository() |
1711 | self.assertFalse(repo.has_revision(revid)) |
1712 | |
1713 | def test_get_graph_stacked(self): |
1714 | @@ -165,7 +165,7 @@ |
1715 | raise TestNotApplicable(e) |
1716 | # Now serve the original mainline from a smart server |
1717 | remote_transport = self.make_smart_server('mainline') |
1718 | - remote_bzrdir = bzrdir.BzrDir.open_from_transport(remote_transport) |
1719 | + remote_bzrdir = controldir.ControlDir.open_from_transport(remote_transport) |
1720 | # and make branch from the smart server which is stacked |
1721 | new_dir = remote_bzrdir.sprout('newbranch', stacked=True) |
1722 | # stacked repository |
1723 | |
1724 | === modified file 'bzrlib/tests/per_branch/test_tags.py' |
1725 | --- bzrlib/tests/per_branch/test_tags.py 2011-09-12 09:51:52 +0000 |
1726 | +++ bzrlib/tests/per_branch/test_tags.py 2012-03-06 18:30:24 +0000 |
1727 | @@ -22,7 +22,7 @@ |
1728 | |
1729 | from bzrlib import ( |
1730 | branch, |
1731 | - bzrdir as _mod_bzrdir, |
1732 | + controldir, |
1733 | errors, |
1734 | tests, |
1735 | ) |
1736 | @@ -170,7 +170,7 @@ |
1737 | b1 = self.make_branch_with_revisions('b', |
1738 | ['rev-1', 'rev-1-changed', 'rev-2']) |
1739 | b1.tags.set_tag('one', 'rev-1') |
1740 | - b2 = _mod_bzrdir.BzrDir.open('b').open_branch() |
1741 | + b2 = controldir.ControlDir.open('b').open_branch() |
1742 | b1.lock_read() |
1743 | self.assertEqual({'one': 'rev-1'}, b1.tags.get_tag_dict()) |
1744 | # Add a tag and modify a tag in b2. b1 is read-locked and has already |
1745 | |
1746 | === modified file 'bzrlib/tests/per_bzrdir/test_bzrdir.py' |
1747 | --- bzrlib/tests/per_bzrdir/test_bzrdir.py 2012-01-28 00:41:30 +0000 |
1748 | +++ bzrlib/tests/per_bzrdir/test_bzrdir.py 2012-03-06 18:30:24 +0000 |
1749 | @@ -21,8 +21,8 @@ |
1750 | |
1751 | import bzrlib.branch |
1752 | from bzrlib import ( |
1753 | - branch, |
1754 | bzrdir, |
1755 | + controldir, |
1756 | errors, |
1757 | repository, |
1758 | revision as _mod_revision, |
1759 | @@ -657,7 +657,7 @@ |
1760 | raise TestNotApplicable('Only relevant for stackable formats.') |
1761 | # Initialize a bzrdir subject to the policy. |
1762 | t = self.get_transport('stacked') |
1763 | - repo_fmt = bzrdir.format_registry.make_bzrdir('1.9') |
1764 | + repo_fmt = controldir.format_registry.make_bzrdir('1.9') |
1765 | repo_name = repo_fmt.repository_format.network_name() |
1766 | repo, control = self.assertInitializeEx( |
1767 | t, need_meta=True, repo_format_name=repo_name, stacked_on=None) |
1768 | |
1769 | === modified file 'bzrlib/tests/per_controldir/test_controldir.py' |
1770 | --- bzrlib/tests/per_controldir/test_controldir.py 2012-02-14 17:22:37 +0000 |
1771 | +++ bzrlib/tests/per_controldir/test_controldir.py 2012-03-06 18:30:24 +0000 |
1772 | @@ -20,18 +20,18 @@ |
1773 | |
1774 | import bzrlib.branch |
1775 | from bzrlib import ( |
1776 | - bzrdir, |
1777 | + bzrdir as _mod_bzrdir, |
1778 | check, |
1779 | controldir, |
1780 | errors, |
1781 | gpg, |
1782 | osutils, |
1783 | + revision as _mod_revision, |
1784 | transport, |
1785 | ui, |
1786 | urlutils, |
1787 | workingtree, |
1788 | ) |
1789 | -import bzrlib.revision |
1790 | from bzrlib.tests import ( |
1791 | fixtures, |
1792 | ChrootedTestCase, |
1793 | @@ -124,7 +124,7 @@ |
1794 | dir.create_repository() |
1795 | dir.create_branch() |
1796 | try: |
1797 | - wt = dir.create_workingtree(revision_id=bzrlib.revision.NULL_REVISION) |
1798 | + wt = dir.create_workingtree(revision_id=_mod_revision.NULL_REVISION) |
1799 | except (errors.NotLocalUrl, errors.UnsupportedOperation): |
1800 | raise TestSkipped("cannot make working tree with transport %r" |
1801 | % dir.transport) |
1802 | @@ -186,7 +186,7 @@ |
1803 | e.g. NotLocalUrl) if there is no working tree. |
1804 | """ |
1805 | dir = self.make_bzrdir('source') |
1806 | - vfs_dir = bzrdir.BzrDir.open(self.get_vfs_only_url('source')) |
1807 | + vfs_dir = controldir.ControlDir.open(self.get_vfs_only_url('source')) |
1808 | if vfs_dir.has_workingtree(): |
1809 | # This ControlDir format doesn't support ControlDirs without |
1810 | # working trees, so this test is irrelevant. |
1811 | @@ -232,7 +232,7 @@ |
1812 | tree.add('foo') |
1813 | tree.commit('revision 1', rev_id='1') |
1814 | tree.bzrdir.open_branch().generate_revision_history( |
1815 | - bzrlib.revision.NULL_REVISION) |
1816 | + _mod_revision.NULL_REVISION) |
1817 | tree.set_parent_trees([]) |
1818 | tree.commit('revision 2', rev_id='2') |
1819 | # Copy the content (i.e. revisions) from the 'commit_tree' branch's |
1820 | @@ -265,7 +265,7 @@ |
1821 | tree.add('foo') |
1822 | tree.commit('revision 1', rev_id='1') |
1823 | tree.branch.bzrdir.open_branch().generate_revision_history( |
1824 | - bzrlib.revision.NULL_REVISION) |
1825 | + _mod_revision.NULL_REVISION) |
1826 | tree.set_parent_trees([]) |
1827 | tree.commit('revision 2', rev_id='2') |
1828 | tree.branch.repository.copy_content_into(shared_repo) |
1829 | @@ -293,7 +293,7 @@ |
1830 | tree.add('foo') |
1831 | tree.commit('revision 1', rev_id='1') |
1832 | tree.branch.bzrdir.open_branch().generate_revision_history( |
1833 | - bzrlib.revision.NULL_REVISION) |
1834 | + _mod_revision.NULL_REVISION) |
1835 | tree.set_parent_trees([]) |
1836 | tree.commit('revision 2', rev_id='2') |
1837 | source = self.make_repository('source') |
1838 | @@ -365,7 +365,7 @@ |
1839 | self.assertEqual('1', target.open_branch().last_revision()) |
1840 | |
1841 | def test_clone_on_transport_preserves_repo_format(self): |
1842 | - if self.bzrdir_format == bzrdir.format_registry.make_bzrdir('default'): |
1843 | + if self.bzrdir_format == controldir.format_registry.make_bzrdir('default'): |
1844 | format = 'knit' |
1845 | else: |
1846 | format = None |
1847 | @@ -552,7 +552,7 @@ |
1848 | tree.add('foo') |
1849 | tree.commit('revision 1', rev_id='1') |
1850 | tree.bzrdir.open_branch().generate_revision_history( |
1851 | - bzrlib.revision.NULL_REVISION) |
1852 | + _mod_revision.NULL_REVISION) |
1853 | tree.set_parent_trees([]) |
1854 | tree.commit('revision 2', rev_id='2') |
1855 | source = self.make_repository('source') |
1856 | @@ -581,7 +581,7 @@ |
1857 | tree.add('foo') |
1858 | tree.commit('revision 1', rev_id='1') |
1859 | tree.bzrdir.open_branch().generate_revision_history( |
1860 | - bzrlib.revision.NULL_REVISION) |
1861 | + _mod_revision.NULL_REVISION) |
1862 | tree.set_parent_trees([]) |
1863 | tree.commit('revision 2', rev_id='2') |
1864 | tree.branch.repository.copy_content_into(shared_repo) |
1865 | @@ -606,7 +606,7 @@ |
1866 | tree.add('foo') |
1867 | tree.commit('revision 1', rev_id='1') |
1868 | tree.bzrdir.open_branch().generate_revision_history( |
1869 | - bzrlib.revision.NULL_REVISION) |
1870 | + _mod_revision.NULL_REVISION) |
1871 | tree.set_parent_trees([]) |
1872 | tree.commit('revision 2', rev_id='2') |
1873 | tree.branch.repository.copy_content_into(shared_repo) |
1874 | @@ -634,7 +634,7 @@ |
1875 | tree.add('foo') |
1876 | tree.commit('revision 1', rev_id='1') |
1877 | tree.bzrdir.open_branch().generate_revision_history( |
1878 | - bzrlib.revision.NULL_REVISION) |
1879 | + _mod_revision.NULL_REVISION) |
1880 | tree.set_parent_trees([]) |
1881 | tree.commit('revision 2', rev_id='2') |
1882 | source = self.make_repository('source') |
1883 | @@ -661,7 +661,7 @@ |
1884 | tree.add('foo') |
1885 | tree.commit('revision 1', rev_id='1') |
1886 | br = tree.bzrdir.open_branch() |
1887 | - br.set_last_revision_info(0, bzrlib.revision.NULL_REVISION) |
1888 | + br.set_last_revision_info(0, _mod_revision.NULL_REVISION) |
1889 | tree.set_parent_trees([]) |
1890 | tree.commit('revision 2', rev_id='2') |
1891 | source = self.make_repository('source') |
1892 | @@ -1048,7 +1048,7 @@ |
1893 | self.assertEqual(self.bzrdir_format, |
1894 | controldir.ControlDirFormat.find_format(readonly_t)) |
1895 | direct_opened_dir = self.bzrdir_format.open(readonly_t) |
1896 | - opened_dir = bzrdir.BzrDir.open(t.base) |
1897 | + opened_dir = controldir.ControlDir.open(t.base) |
1898 | self.assertEqual(made_control._format, |
1899 | opened_dir._format) |
1900 | self.assertEqual(direct_opened_dir._format, |
1901 | @@ -1086,7 +1086,7 @@ |
1902 | |
1903 | def test_format_initialize_on_transport_ex_force_new_repo_True(self): |
1904 | t = self.get_transport('repo') |
1905 | - repo_fmt = bzrdir.format_registry.make_bzrdir('1.9') |
1906 | + repo_fmt = controldir.format_registry.make_bzrdir('1.9') |
1907 | repo_name = repo_fmt.repository_format.network_name() |
1908 | repo = repo_fmt.initialize_on_transport_ex(t, |
1909 | repo_format_name=repo_name, shared_repo=True)[0] |
1910 | @@ -1097,7 +1097,7 @@ |
1911 | |
1912 | def test_format_initialize_on_transport_ex_force_new_repo_False(self): |
1913 | t = self.get_transport('repo') |
1914 | - repo_fmt = bzrdir.format_registry.make_bzrdir('1.9') |
1915 | + repo_fmt = controldir.format_registry.make_bzrdir('1.9') |
1916 | repo_name = repo_fmt.repository_format.network_name() |
1917 | repo = repo_fmt.initialize_on_transport_ex(t, |
1918 | repo_format_name=repo_name, shared_repo=True)[0] |
1919 | @@ -1115,7 +1115,7 @@ |
1920 | def test_format_initialize_on_transport_ex_repo_fmt_name_followed(self): |
1921 | t = self.get_transport('dir') |
1922 | # 1.6 is likely to never be default |
1923 | - fmt = bzrdir.format_registry.make_bzrdir('1.6') |
1924 | + fmt = controldir.format_registry.make_bzrdir('1.6') |
1925 | repo_name = fmt.repository_format.network_name() |
1926 | repo, control = self.assertInitializeEx(t, repo_format_name=repo_name) |
1927 | if self.bzrdir_format.fixed_components: |
1928 | @@ -1144,7 +1144,7 @@ |
1929 | self.assertTrue(repo.is_write_locked()) |
1930 | self.addCleanup(repo.unlock) |
1931 | self.assertIsInstance(control, controldir.ControlDir) |
1932 | - opened = bzrdir.BzrDir.open(t.base) |
1933 | + opened = controldir.ControlDir.open(t.base) |
1934 | expected_format = self.bzrdir_format |
1935 | if not isinstance(expected_format, RemoteBzrDirFormat): |
1936 | self.assertEqual(control._format.network_name(), |
1937 | @@ -1383,7 +1383,7 @@ |
1938 | except (errors.NotLocalUrl, errors.UnsupportedOperation): |
1939 | raise TestSkipped("Can't initialize %r on transport %r" |
1940 | % (self.bzrdir_format, t)) |
1941 | - dir = bzrdir.BzrDir.open(t.base+",branch=foo") |
1942 | + dir = controldir.ControlDir.open(t.base+",branch=foo") |
1943 | self.assertEquals({"branch": "foo"}, |
1944 | dir.user_transport.get_segment_parameters()) |
1945 | self.assertEquals("foo", dir._get_selected_branch()) |
1946 | @@ -1398,7 +1398,7 @@ |
1947 | except (errors.NotLocalUrl, errors.UnsupportedOperation): |
1948 | raise TestSkipped("Can't initialize %r on transport %r" |
1949 | % (self.bzrdir_format, t)) |
1950 | - dir = bzrdir.BzrDir.open(t.base) |
1951 | + dir = controldir.ControlDir.open(t.base) |
1952 | self.assertEqual(u"", dir._get_selected_branch()) |
1953 | |
1954 | def test_root_transport(self): |
1955 | @@ -1473,7 +1473,7 @@ |
1956 | raise TestNotApplicable("format does not support " |
1957 | "nesting repositories") |
1958 | child_repo = self.make_repository('childrepo') |
1959 | - opened_control = bzrdir.BzrDir.open(self.get_url('childrepo')) |
1960 | + opened_control = controldir.ControlDir.open(self.get_url('childrepo')) |
1961 | found_repo = opened_control.find_repository() |
1962 | self.assertEqual(child_repo.bzrdir.root_transport.base, |
1963 | found_repo.bzrdir.root_transport.base) |
1964 | @@ -1493,7 +1493,7 @@ |
1965 | self.get_transport().mkdir('childrepo') |
1966 | child_control = self.bzrdir_format.initialize(url) |
1967 | child_repo = child_control.create_repository(shared=True) |
1968 | - opened_control = bzrdir.BzrDir.open(self.get_url('childrepo')) |
1969 | + opened_control = controldir.ControlDir.open(self.get_url('childrepo')) |
1970 | found_repo = opened_control.find_repository() |
1971 | self.assertEqual(child_repo.bzrdir.root_transport.base, |
1972 | found_repo.bzrdir.root_transport.base) |
1973 | @@ -1713,14 +1713,14 @@ |
1974 | except errors.BzrError, e: |
1975 | if 'Cannot set config' in str(e): |
1976 | self.assertFalse( |
1977 | - isinstance(my_dir, (bzrdir.BzrDirMeta1, RemoteBzrDir)), |
1978 | + isinstance(my_dir, (_mod_bzrdir.BzrDirMeta1, RemoteBzrDir)), |
1979 | "%r should support configs" % my_dir) |
1980 | raise TestNotApplicable( |
1981 | 'This BzrDir format does not support configs.') |
1982 | else: |
1983 | raise |
1984 | self.assertEqual('http://example.com', config.get_default_stack_on()) |
1985 | - my_dir2 = bzrdir.BzrDir.open(self.get_url('.')) |
1986 | + my_dir2 = controldir.ControlDir.open(self.get_url('.')) |
1987 | config2 = my_dir2.get_config() |
1988 | self.assertEqual('http://example.com', config2.get_default_stack_on()) |
1989 | |
1990 | @@ -1748,7 +1748,7 @@ |
1991 | return |
1992 | except errors.NoRepositoryPresent: |
1993 | pass |
1994 | - made_control = bzrdir.BzrDir.open(self.get_readonly_url('subdir')) |
1995 | + made_control = controldir.ControlDir.open(self.get_readonly_url('subdir')) |
1996 | self.assertRaises(errors.NoRepositoryPresent, |
1997 | made_control.find_repository) |
1998 | |
1999 | |
2000 | === modified file 'bzrlib/tests/per_interbranch/test_pull.py' |
2001 | --- bzrlib/tests/per_interbranch/test_pull.py 2011-10-17 08:45:09 +0000 |
2002 | +++ bzrlib/tests/per_interbranch/test_pull.py 2012-03-06 18:30:24 +0000 |
2003 | @@ -17,7 +17,7 @@ |
2004 | """Tests for InterBranch.pull behaviour.""" |
2005 | |
2006 | from bzrlib.branch import Branch |
2007 | -from bzrlib.bzrdir import BzrDir |
2008 | +from bzrlib.controldir import ControlDir |
2009 | from bzrlib import errors |
2010 | from bzrlib.memorytree import MemoryTree |
2011 | from bzrlib.revision import NULL_REVISION |
2012 | @@ -175,7 +175,7 @@ |
2013 | # remotebranches can't be bound. Let's instead make a new local |
2014 | # branch of the default type, which does allow binding. |
2015 | # See https://bugs.launchpad.net/bzr/+bug/112020 |
2016 | - local = BzrDir.create_branch_convenience('local2') |
2017 | + local = ControlDir.create_branch_convenience('local2') |
2018 | local.bind(target) |
2019 | source = self.make_from_branch('source') |
2020 | Branch.hooks.install_named_hook('post_pull', |
2021 | |
2022 | === modified file 'bzrlib/tests/per_interbranch/test_push.py' |
2023 | --- bzrlib/tests/per_interbranch/test_push.py 2011-12-11 15:42:02 +0000 |
2024 | +++ bzrlib/tests/per_interbranch/test_push.py 2012-03-06 18:30:24 +0000 |
2025 | @@ -25,8 +25,8 @@ |
2026 | |
2027 | from bzrlib import ( |
2028 | branch, |
2029 | - bzrdir, |
2030 | check, |
2031 | + controldir, |
2032 | errors, |
2033 | push, |
2034 | symbol_versioning, |
2035 | @@ -34,7 +34,7 @@ |
2036 | vf_repository, |
2037 | ) |
2038 | from bzrlib.branch import Branch |
2039 | -from bzrlib.bzrdir import BzrDir |
2040 | +from bzrlib.controldir import ControlDir |
2041 | from bzrlib.memorytree import MemoryTree |
2042 | from bzrlib.revision import NULL_REVISION |
2043 | from bzrlib.smart.repository import SmartServerRepositoryGetParentMap |
2044 | @@ -165,7 +165,7 @@ |
2045 | if self.vfs_transport_factory is test_server.LocalURLServer: |
2046 | # the branch is colocated on disk, we cannot create a checkout. |
2047 | # hopefully callers will expect this. |
2048 | - local_controldir = bzrdir.BzrDir.open(self.get_vfs_only_url('repo/tree')) |
2049 | + local_controldir = controldir.ControlDir.open(self.get_vfs_only_url('repo/tree')) |
2050 | tree = local_controldir.create_workingtree() |
2051 | else: |
2052 | tree = a_branch.create_checkout('repo/tree', lightweight=True) |
2053 | @@ -349,7 +349,7 @@ |
2054 | # remotebranches can't be bound. Let's instead make a new local |
2055 | # branch of the default type, which does allow binding. |
2056 | # See https://bugs.launchpad.net/bzr/+bug/112020 |
2057 | - local = BzrDir.create_branch_convenience('local2') |
2058 | + local = ControlDir.create_branch_convenience('local2') |
2059 | local.bind(target) |
2060 | source = self.make_from_branch('source') |
2061 | Branch.hooks.install_named_hook('post_push', |
2062 | |
2063 | === modified file 'bzrlib/tests/per_intertree/__init__.py' |
2064 | --- bzrlib/tests/per_intertree/__init__.py 2011-08-04 14:01:47 +0000 |
2065 | +++ bzrlib/tests/per_intertree/__init__.py 2012-03-06 18:30:24 +0000 |
2066 | @@ -135,7 +135,7 @@ |
2067 | # -- vila 20090311 |
2068 | chk_tree_format = WorkingTreeFormat4() |
2069 | chk_tree_format._get_matchingbzrdir = \ |
2070 | - lambda:bzrlib.bzrdir.format_registry.make_bzrdir('2a') |
2071 | + lambda:bzrlib.controldir.format_registry.make_bzrdir('2a') |
2072 | test_intertree_permutations.append( |
2073 | (InterTree.__name__ + "(CHKInventory)", |
2074 | InterTree, |
2075 | |
2076 | === modified file 'bzrlib/tests/per_pack_repository.py' |
2077 | --- bzrlib/tests/per_pack_repository.py 2011-08-19 22:34:02 +0000 |
2078 | +++ bzrlib/tests/per_pack_repository.py 2012-03-06 18:30:24 +0000 |
2079 | @@ -24,7 +24,7 @@ |
2080 | from bzrlib.btree_index import BTreeGraphIndex |
2081 | from bzrlib.index import GraphIndex |
2082 | from bzrlib import ( |
2083 | - bzrdir, |
2084 | + controldir, |
2085 | errors, |
2086 | inventory, |
2087 | osutils, |
2088 | @@ -59,7 +59,7 @@ |
2089 | """ |
2090 | |
2091 | def get_format(self): |
2092 | - return bzrdir.format_registry.make_bzrdir(self.format_name) |
2093 | + return controldir.format_registry.make_bzrdir(self.format_name) |
2094 | |
2095 | def test_attribute__fetch_order(self): |
2096 | """Packs do not need ordered data retrieval.""" |
2097 | @@ -869,7 +869,7 @@ |
2098 | super(TestPackRepositoryStacking, self).setUp() |
2099 | |
2100 | def get_format(self): |
2101 | - return bzrdir.format_registry.make_bzrdir(self.format_name) |
2102 | + return controldir.format_registry.make_bzrdir(self.format_name) |
2103 | |
2104 | def test_stack_checks_rich_root_compatibility(self): |
2105 | # early versions of the packing code relied on pack internals to |
2106 | @@ -1000,7 +1000,7 @@ |
2107 | class TestKeyDependencies(TestCaseWithTransport): |
2108 | |
2109 | def get_format(self): |
2110 | - return bzrdir.format_registry.make_bzrdir(self.format_name) |
2111 | + return controldir.format_registry.make_bzrdir(self.format_name) |
2112 | |
2113 | def create_source_and_target(self): |
2114 | builder = self.make_branch_builder('source', format=self.get_format()) |
2115 | @@ -1085,7 +1085,7 @@ |
2116 | self.hpss_calls.append(params.method) |
2117 | |
2118 | def get_format(self): |
2119 | - return bzrdir.format_registry.make_bzrdir(self.format_name) |
2120 | + return controldir.format_registry.make_bzrdir(self.format_name) |
2121 | |
2122 | def test_autopack_or_streaming_rpc_is_used_when_using_hpss(self): |
2123 | # Make local and remote repos |
2124 | @@ -1093,7 +1093,7 @@ |
2125 | tree = self.make_branch_and_tree('local', format=format) |
2126 | self.make_branch_and_tree('remote', format=format) |
2127 | remote_branch_url = self.smart_server.get_url() + 'remote' |
2128 | - remote_branch = bzrdir.BzrDir.open(remote_branch_url).open_branch() |
2129 | + remote_branch = controldir.ControlDir.open(remote_branch_url).open_branch() |
2130 | # Make 9 local revisions, and push them one at a time to the remote |
2131 | # repo to produce 9 pack files. |
2132 | for x in range(9): |
2133 | |
2134 | === modified file 'bzrlib/tests/per_repository/__init__.py' |
2135 | --- bzrlib/tests/per_repository/__init__.py 2011-10-10 14:03:32 +0000 |
2136 | +++ bzrlib/tests/per_repository/__init__.py 2012-03-06 18:30:24 +0000 |
2137 | @@ -25,7 +25,6 @@ |
2138 | """ |
2139 | |
2140 | from bzrlib import ( |
2141 | - bzrdir, |
2142 | repository, |
2143 | ) |
2144 | from bzrlib.remote import RemoteRepositoryFormat |
2145 | |
2146 | === modified file 'bzrlib/tests/per_repository/test_fetch.py' |
2147 | --- bzrlib/tests/per_repository/test_fetch.py 2012-01-30 14:18:22 +0000 |
2148 | +++ bzrlib/tests/per_repository/test_fetch.py 2012-03-06 18:30:24 +0000 |
2149 | @@ -17,7 +17,7 @@ |
2150 | """Tests for fetch between repositories of the same type.""" |
2151 | |
2152 | from bzrlib import ( |
2153 | - bzrdir, |
2154 | + controldir, |
2155 | errors, |
2156 | gpg, |
2157 | remote, |
2158 | @@ -67,7 +67,7 @@ |
2159 | tree_a.add('foo', 'file1') |
2160 | tree_a.commit('rev1', rev_id='rev1') |
2161 | # create a knit-3 based format to fetch into |
2162 | - f = bzrdir.format_registry.make_bzrdir('development-subtree') |
2163 | + f = controldir.format_registry.make_bzrdir('development-subtree') |
2164 | try: |
2165 | format = tree_a.branch.repository._format |
2166 | format.check_conversion_target(f.repository_format) |
2167 | |
2168 | === modified file 'bzrlib/tests/per_repository/test_has_same_location.py' |
2169 | --- bzrlib/tests/per_repository/test_has_same_location.py 2011-08-19 22:34:02 +0000 |
2170 | +++ bzrlib/tests/per_repository/test_has_same_location.py 2012-03-06 18:30:24 +0000 |
2171 | @@ -17,7 +17,7 @@ |
2172 | """Tests for implementations of Repository.has_same_location.""" |
2173 | |
2174 | from bzrlib import ( |
2175 | - bzrdir, |
2176 | + controldir, |
2177 | transport, |
2178 | ) |
2179 | from bzrlib.remote import ( |
2180 | @@ -119,7 +119,7 @@ |
2181 | self.get_vfs_only_url()).delete_tree('other') |
2182 | other_repo = self.make_repository('other', format='knit') |
2183 | # Make sure the other_repo is not a RemoteRepository. |
2184 | - other_bzrdir = bzrdir.BzrDir.open(self.get_vfs_only_url('other')) |
2185 | + other_bzrdir = controldir.ControlDir.open(self.get_vfs_only_url('other')) |
2186 | other_repo = other_bzrdir.open_repository() |
2187 | self.assertDifferentRepo(repo, other_repo) |
2188 | |
2189 | |
2190 | === modified file 'bzrlib/tests/per_repository_reference/__init__.py' |
2191 | --- bzrlib/tests/per_repository_reference/__init__.py 2011-10-01 11:54:46 +0000 |
2192 | +++ bzrlib/tests/per_repository_reference/__init__.py 2012-03-06 18:30:24 +0000 |
2193 | @@ -27,7 +27,7 @@ |
2194 | remote, |
2195 | urlutils, |
2196 | ) |
2197 | -from bzrlib.bzrdir import BzrDir |
2198 | +from bzrlib.controldir import ControlDir |
2199 | from bzrlib.tests import multiply_tests |
2200 | from bzrlib.tests.per_repository import ( |
2201 | all_repository_format_scenarios, |
2202 | @@ -49,7 +49,7 @@ |
2203 | |
2204 | def readonly_repository(self, repo): |
2205 | relpath = urlutils.basename(repo.bzrdir.user_url.rstrip('/')) |
2206 | - return BzrDir.open_from_transport( |
2207 | + return ControlDir.open_from_transport( |
2208 | self.get_readonly_transport(relpath)).open_repository() |
2209 | |
2210 | |
2211 | |
2212 | === modified file 'bzrlib/tests/per_repository_vf/test_reconcile.py' |
2213 | --- bzrlib/tests/per_repository_vf/test_reconcile.py 2011-10-01 11:36:04 +0000 |
2214 | +++ bzrlib/tests/per_repository_vf/test_reconcile.py 2012-03-06 18:30:24 +0000 |
2215 | @@ -17,7 +17,10 @@ |
2216 | """Tests for reconciliation of repositories.""" |
2217 | |
2218 | import bzrlib |
2219 | -from bzrlib import errors |
2220 | +from bzrlib import ( |
2221 | + errors, |
2222 | + ) |
2223 | +from bzrlib.bzrdir import BzrDir |
2224 | from bzrlib.inventory import Inventory |
2225 | from bzrlib.reconcile import reconcile, Reconciler |
2226 | from bzrlib.revision import Revision |
2227 | @@ -135,14 +138,14 @@ |
2228 | # a inventory with a ghost that can be corrected now. |
2229 | t.copy_tree('inventory_one_ghost', 'inventory_ghost_present') |
2230 | bzrdir_url = self.get_url('inventory_ghost_present') |
2231 | - bzrdir = bzrlib.bzrdir.BzrDir.open(bzrdir_url) |
2232 | + bzrdir = BzrDir.open(bzrdir_url) |
2233 | repo = bzrdir.open_repository() |
2234 | add_commit(repo, 'the_ghost', []) |
2235 | |
2236 | def checkEmptyReconcile(self, **kwargs): |
2237 | """Check a reconcile on an empty repository.""" |
2238 | self.make_repository('empty') |
2239 | - d = bzrlib.bzrdir.BzrDir.open(self.get_url('empty')) |
2240 | + d = BzrDir.open(self.get_url('empty')) |
2241 | # calling on a empty repository should do nothing |
2242 | reconciler = d.find_repository().reconcile(**kwargs) |
2243 | # no inconsistent parents should have been found |
2244 | @@ -167,7 +170,7 @@ |
2245 | def test_convenience_reconcile_inventory_without_revision_reconcile(self): |
2246 | # smoke test for the all in one ui tool |
2247 | bzrdir_url = self.get_url('inventory_without_revision') |
2248 | - bzrdir = bzrlib.bzrdir.BzrDir.open(bzrdir_url) |
2249 | + bzrdir = BzrDir.open(bzrdir_url) |
2250 | repo = bzrdir.open_repository() |
2251 | if not repo._reconcile_does_inventory_gc: |
2252 | raise TestSkipped('Irrelevant test') |
2253 | @@ -179,7 +182,7 @@ |
2254 | def test_reweave_inventory_without_revision(self): |
2255 | # an excess inventory on its own is only reconciled by using thorough |
2256 | d_url = self.get_url('inventory_without_revision') |
2257 | - d = bzrlib.bzrdir.BzrDir.open(d_url) |
2258 | + d = BzrDir.open(d_url) |
2259 | repo = d.open_repository() |
2260 | if not repo._reconcile_does_inventory_gc: |
2261 | raise TestSkipped('Irrelevant test') |
2262 | @@ -232,7 +235,7 @@ |
2263 | # smoke test for the all in one Reconciler class, |
2264 | # other tests use the lower level repo.reconcile() |
2265 | d_url = self.get_url('inventory_without_revision_and_ghost') |
2266 | - d = bzrlib.bzrdir.BzrDir.open(d_url) |
2267 | + d = BzrDir.open(d_url) |
2268 | if not d.open_repository()._reconcile_does_inventory_gc: |
2269 | raise TestSkipped('Irrelevant test') |
2270 | def reconcile(): |
2271 | @@ -244,7 +247,7 @@ |
2272 | def test_reweave_inventory_without_revision_and_ghost(self): |
2273 | # actual low level test. |
2274 | d_url = self.get_url('inventory_without_revision_and_ghost') |
2275 | - d = bzrlib.bzrdir.BzrDir.open(d_url) |
2276 | + d = BzrDir.open(d_url) |
2277 | repo = d.open_repository() |
2278 | if not repo._reconcile_does_inventory_gc: |
2279 | raise TestSkipped('Irrelevant test') |
2280 | @@ -254,7 +257,7 @@ |
2281 | thorough=True) |
2282 | |
2283 | def test_reweave_inventory_preserves_a_revision_with_ghosts(self): |
2284 | - d = bzrlib.bzrdir.BzrDir.open(self.get_url('inventory_one_ghost')) |
2285 | + d = BzrDir.open(self.get_url('inventory_one_ghost')) |
2286 | reconciler = d.open_repository().reconcile(thorough=True) |
2287 | # no inconsistent parents should have been found: |
2288 | # the lack of a parent for ghost is normal |
2289 | @@ -267,7 +270,7 @@ |
2290 | self.assertThat(['ghost', 'the_ghost'], MatchesAncestry(repo, 'ghost')) |
2291 | |
2292 | def test_reweave_inventory_fixes_ancestryfor_a_present_ghost(self): |
2293 | - d = bzrlib.bzrdir.BzrDir.open(self.get_url('inventory_ghost_present')) |
2294 | + d = BzrDir.open(self.get_url('inventory_ghost_present')) |
2295 | repo = d.open_repository() |
2296 | m = MatchesAncestry(repo, 'ghost') |
2297 | if m.match(['the_ghost', 'ghost']) is None: |
2298 | |
2299 | === modified file 'bzrlib/tests/per_repository_vf/test_write_group.py' |
2300 | --- bzrlib/tests/per_repository_vf/test_write_group.py 2011-05-09 20:08:47 +0000 |
2301 | +++ bzrlib/tests/per_repository_vf/test_write_group.py 2012-03-06 18:30:24 +0000 |
2302 | @@ -20,7 +20,7 @@ |
2303 | |
2304 | from bzrlib import ( |
2305 | branch, |
2306 | - bzrdir, |
2307 | + controldir, |
2308 | errors, |
2309 | memorytree, |
2310 | remote, |
2311 | @@ -87,7 +87,8 @@ |
2312 | # repository, but the default format is unstackble. So explicitly |
2313 | # make a stackable real repository and use that. |
2314 | repo = self.make_repository(relpath, format='1.9') |
2315 | - repo = bzrdir.BzrDir.open(self.get_url(relpath)).open_repository() |
2316 | + dir = controldir.ControlDir.open(self.get_url(relpath)) |
2317 | + repo = dir.open_repository() |
2318 | else: |
2319 | repo = self.make_repository(relpath) |
2320 | if not repo._format.supports_external_lookups: |
2321 | |
2322 | === modified file 'bzrlib/tests/per_workingtree/test_commit.py' |
2323 | --- bzrlib/tests/per_workingtree/test_commit.py 2012-01-25 21:13:15 +0000 |
2324 | +++ bzrlib/tests/per_workingtree/test_commit.py 2012-03-06 18:30:24 +0000 |
2325 | @@ -19,8 +19,8 @@ |
2326 | |
2327 | from bzrlib import ( |
2328 | branch, |
2329 | - bzrdir, |
2330 | conflicts, |
2331 | + controldir, |
2332 | errors, |
2333 | mutabletree, |
2334 | osutils, |
2335 | @@ -264,7 +264,7 @@ |
2336 | del master |
2337 | # check its corrupted. |
2338 | self.assertRaises(errors.UnknownFormatError, |
2339 | - bzrdir.BzrDir.open, |
2340 | + controldir.ControlDir.open, |
2341 | 'master') |
2342 | tree.commit('foo', rev_id='foo', local=True) |
2343 | |
2344 | |
2345 | === modified file 'bzrlib/tests/per_workingtree/test_content_filters.py' |
2346 | --- bzrlib/tests/per_workingtree/test_content_filters.py 2010-12-02 09:23:10 +0000 |
2347 | +++ bzrlib/tests/per_workingtree/test_content_filters.py 2012-03-06 18:30:24 +0000 |
2348 | @@ -18,7 +18,7 @@ |
2349 | |
2350 | import os |
2351 | |
2352 | -from bzrlib.bzrdir import BzrDir |
2353 | +from bzrlib.controldir import ControlDir |
2354 | from bzrlib.filters import ContentFilter |
2355 | from bzrlib.switch import switch |
2356 | from bzrlib.workingtree import WorkingTree |
2357 | @@ -330,7 +330,7 @@ |
2358 | self.assertFileEqual("fOO tXT", 'checkout/file1.txt') |
2359 | |
2360 | # Switch it to branch-b and check the tree is updated |
2361 | - checkout_control_dir = BzrDir.open_containing('checkout')[0] |
2362 | + checkout_control_dir = ControlDir.open_containing('checkout')[0] |
2363 | switch(checkout_control_dir, source.branch) |
2364 | self.assertFileEqual("fOO rocks!", 'checkout/file1.txt') |
2365 | self.assertFileEqual("hELLO wORLD", 'checkout/file4.txt') |
2366 | |
2367 | === modified file 'bzrlib/tests/per_workingtree/test_workingtree.py' |
2368 | --- bzrlib/tests/per_workingtree/test_workingtree.py 2012-01-28 17:24:34 +0000 |
2369 | +++ bzrlib/tests/per_workingtree/test_workingtree.py 2012-03-06 18:30:24 +0000 |
2370 | @@ -24,6 +24,7 @@ |
2371 | branch, |
2372 | bzrdir, |
2373 | config, |
2374 | + controldir, |
2375 | errors, |
2376 | osutils, |
2377 | revision as _mod_revision, |
2378 | @@ -719,7 +720,7 @@ |
2379 | tree.add(['bloo', 'blo']) |
2380 | tree.commit("blah", allow_pointless=False) |
2381 | base = tree.branch.repository.revision_tree(tree.last_revision()) |
2382 | - bzrdir.BzrDir.open("mine").sprout("other") |
2383 | + controldir.ControlDir.open("mine").sprout("other") |
2384 | with file('other/bloo', 'wb') as f: f.write('two') |
2385 | othertree = WorkingTree.open('other') |
2386 | othertree.commit('blah', allow_pointless=False) |
2387 | |
2388 | === modified file 'bzrlib/tests/test_branch.py' |
2389 | --- bzrlib/tests/test_branch.py 2012-02-14 17:22:37 +0000 |
2390 | +++ bzrlib/tests/test_branch.py 2012-03-06 18:30:24 +0000 |
2391 | @@ -28,6 +28,7 @@ |
2392 | branch as _mod_branch, |
2393 | bzrdir, |
2394 | config, |
2395 | + controldir, |
2396 | errors, |
2397 | symbol_versioning, |
2398 | tests, |
2399 | @@ -244,7 +245,7 @@ |
2400 | # but open_downlevel will work |
2401 | self.assertEqual( |
2402 | format.open(dir), |
2403 | - bzrdir.BzrDir.open(self.get_url()).open_branch(unsupported=True)) |
2404 | + controldir.ControlDir.open(self.get_url()).open_branch(unsupported=True)) |
2405 | # unregister the format |
2406 | self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)), |
2407 | _mod_branch.BranchFormat.unregister_format, format) |
2408 | @@ -488,7 +489,7 @@ |
2409 | |
2410 | def make_branch(self, location, format=None): |
2411 | if format is None: |
2412 | - format = bzrdir.format_registry.make_bzrdir('1.9') |
2413 | + format = controldir.format_registry.make_bzrdir('1.9') |
2414 | format.set_branch_format(_mod_branch.BzrBranchFormat8()) |
2415 | return tests.TestCaseWithTransport.make_branch( |
2416 | self, location, format=format) |
2417 | |
2418 | === modified file 'bzrlib/tests/test_bzrdir.py' |
2419 | --- bzrlib/tests/test_bzrdir.py 2012-02-06 11:36:02 +0000 |
2420 | +++ bzrlib/tests/test_bzrdir.py 2012-03-06 18:30:24 +0000 |
2421 | @@ -170,18 +170,18 @@ |
2422 | self.assertNotContainsRe(new, 'hidden') |
2423 | |
2424 | def test_set_default_repository(self): |
2425 | - default_factory = bzrdir.format_registry.get('default') |
2426 | - old_default = [k for k, v in bzrdir.format_registry.iteritems() |
2427 | + default_factory = controldir.format_registry.get('default') |
2428 | + old_default = [k for k, v in controldir.format_registry.iteritems() |
2429 | if v == default_factory and k != 'default'][0] |
2430 | - bzrdir.format_registry.set_default_repository('dirstate-with-subtree') |
2431 | + controldir.format_registry.set_default_repository('dirstate-with-subtree') |
2432 | try: |
2433 | - self.assertIs(bzrdir.format_registry.get('dirstate-with-subtree'), |
2434 | - bzrdir.format_registry.get('default')) |
2435 | + self.assertIs(controldir.format_registry.get('dirstate-with-subtree'), |
2436 | + controldir.format_registry.get('default')) |
2437 | self.assertIs( |
2438 | repository.format_registry.get_default().__class__, |
2439 | knitrepo.RepositoryFormatKnit3) |
2440 | finally: |
2441 | - bzrdir.format_registry.set_default_repository(old_default) |
2442 | + controldir.format_registry.set_default_repository(old_default) |
2443 | |
2444 | def test_aliases(self): |
2445 | a_registry = controldir.ControlDirFormatRegistry() |
2446 | @@ -212,21 +212,21 @@ |
2447 | """A sample BzrDir implementation to allow testing static methods.""" |
2448 | |
2449 | def create_repository(self, shared=False): |
2450 | - """See BzrDir.create_repository.""" |
2451 | + """See ControlDir.create_repository.""" |
2452 | return "A repository" |
2453 | |
2454 | def open_repository(self): |
2455 | - """See BzrDir.open_repository.""" |
2456 | + """See ControlDir.open_repository.""" |
2457 | return SampleRepository(self) |
2458 | |
2459 | def create_branch(self, name=None): |
2460 | - """See BzrDir.create_branch.""" |
2461 | + """See ControlDir.create_branch.""" |
2462 | if name is not None: |
2463 | raise NoColocatedBranchSupport(self) |
2464 | return SampleBranch(self) |
2465 | |
2466 | def create_workingtree(self): |
2467 | - """See BzrDir.create_workingtree.""" |
2468 | + """See ControlDir.create_workingtree.""" |
2469 | return "A tree" |
2470 | |
2471 | |
2472 | @@ -337,7 +337,7 @@ |
2473 | def test_create_branch_and_repo_under_shared(self): |
2474 | # creating a branch and repo in a shared repo uses the |
2475 | # shared repository |
2476 | - format = bzrdir.format_registry.make_bzrdir('knit') |
2477 | + format = controldir.format_registry.make_bzrdir('knit') |
2478 | self.make_repository('.', shared=True, format=format) |
2479 | branch = bzrdir.BzrDir.create_branch_and_repo( |
2480 | self.get_url('child'), format=format) |
2481 | @@ -347,7 +347,7 @@ |
2482 | def test_create_branch_and_repo_under_shared_force_new(self): |
2483 | # creating a branch and repo in a shared repo can be forced to |
2484 | # make a new repo |
2485 | - format = bzrdir.format_registry.make_bzrdir('knit') |
2486 | + format = controldir.format_registry.make_bzrdir('knit') |
2487 | self.make_repository('.', shared=True, format=format) |
2488 | branch = bzrdir.BzrDir.create_branch_and_repo(self.get_url('child'), |
2489 | force_new_repo=True, |
2490 | @@ -367,7 +367,7 @@ |
2491 | |
2492 | def test_create_standalone_working_tree_under_shared_repo(self): |
2493 | # create standalone working tree always makes a repo. |
2494 | - format = bzrdir.format_registry.make_bzrdir('knit') |
2495 | + format = controldir.format_registry.make_bzrdir('knit') |
2496 | self.make_repository('.', shared=True, format=format) |
2497 | # note this is deliberately readonly, as this failure should |
2498 | # occur before any writes. |
2499 | @@ -380,14 +380,14 @@ |
2500 | |
2501 | def test_create_branch_convenience(self): |
2502 | # outside a repo the default convenience output is a repo+branch_tree |
2503 | - format = bzrdir.format_registry.make_bzrdir('knit') |
2504 | + format = controldir.format_registry.make_bzrdir('knit') |
2505 | branch = bzrdir.BzrDir.create_branch_convenience('.', format=format) |
2506 | branch.bzrdir.open_workingtree() |
2507 | branch.bzrdir.open_repository() |
2508 | |
2509 | def test_create_branch_convenience_possible_transports(self): |
2510 | """Check that the optional 'possible_transports' is recognized""" |
2511 | - format = bzrdir.format_registry.make_bzrdir('knit') |
2512 | + format = controldir.format_registry.make_bzrdir('knit') |
2513 | t = self.get_transport() |
2514 | branch = bzrdir.BzrDir.create_branch_convenience( |
2515 | '.', format=format, possible_transports=[t]) |
2516 | @@ -398,7 +398,7 @@ |
2517 | """Creating a branch at the root of a fs should work.""" |
2518 | self.vfs_transport_factory = memory.MemoryServer |
2519 | # outside a repo the default convenience output is a repo+branch_tree |
2520 | - format = bzrdir.format_registry.make_bzrdir('knit') |
2521 | + format = controldir.format_registry.make_bzrdir('knit') |
2522 | branch = bzrdir.BzrDir.create_branch_convenience(self.get_url(), |
2523 | format=format) |
2524 | self.assertRaises(errors.NoWorkingTree, |
2525 | @@ -408,7 +408,7 @@ |
2526 | def test_create_branch_convenience_under_shared_repo(self): |
2527 | # inside a repo the default convenience output is a branch+ follow the |
2528 | # repo tree policy |
2529 | - format = bzrdir.format_registry.make_bzrdir('knit') |
2530 | + format = controldir.format_registry.make_bzrdir('knit') |
2531 | self.make_repository('.', shared=True, format=format) |
2532 | branch = bzrdir.BzrDir.create_branch_convenience('child', |
2533 | format=format) |
2534 | @@ -419,7 +419,7 @@ |
2535 | def test_create_branch_convenience_under_shared_repo_force_no_tree(self): |
2536 | # inside a repo the default convenience output is a branch+ follow the |
2537 | # repo tree policy but we can override that |
2538 | - format = bzrdir.format_registry.make_bzrdir('knit') |
2539 | + format = controldir.format_registry.make_bzrdir('knit') |
2540 | self.make_repository('.', shared=True, format=format) |
2541 | branch = bzrdir.BzrDir.create_branch_convenience('child', |
2542 | force_new_tree=False, format=format) |
2543 | @@ -431,7 +431,7 @@ |
2544 | def test_create_branch_convenience_under_shared_repo_no_tree_policy(self): |
2545 | # inside a repo the default convenience output is a branch+ follow the |
2546 | # repo tree policy |
2547 | - format = bzrdir.format_registry.make_bzrdir('knit') |
2548 | + format = controldir.format_registry.make_bzrdir('knit') |
2549 | repo = self.make_repository('.', shared=True, format=format) |
2550 | repo.set_make_working_trees(False) |
2551 | branch = bzrdir.BzrDir.create_branch_convenience('child', |
2552 | @@ -444,7 +444,7 @@ |
2553 | def test_create_branch_convenience_under_shared_repo_no_tree_policy_force_tree(self): |
2554 | # inside a repo the default convenience output is a branch+ follow the |
2555 | # repo tree policy but we can override that |
2556 | - format = bzrdir.format_registry.make_bzrdir('knit') |
2557 | + format = controldir.format_registry.make_bzrdir('knit') |
2558 | repo = self.make_repository('.', shared=True, format=format) |
2559 | repo.set_make_working_trees(False) |
2560 | branch = bzrdir.BzrDir.create_branch_convenience('child', |
2561 | @@ -456,7 +456,7 @@ |
2562 | def test_create_branch_convenience_under_shared_repo_force_new_repo(self): |
2563 | # inside a repo the default convenience output is overridable to give |
2564 | # repo+branch+tree |
2565 | - format = bzrdir.format_registry.make_bzrdir('knit') |
2566 | + format = controldir.format_registry.make_bzrdir('knit') |
2567 | self.make_repository('.', shared=True, format=format) |
2568 | branch = bzrdir.BzrDir.create_branch_convenience('child', |
2569 | force_new_repo=True, format=format) |
2570 | @@ -523,7 +523,7 @@ |
2571 | # general case. |
2572 | trunk = self.make_branch('trunk', format='1.9') |
2573 | t = self.get_transport('stacked') |
2574 | - old_fmt = bzrdir.format_registry.make_bzrdir('pack-0.92') |
2575 | + old_fmt = controldir.format_registry.make_bzrdir('pack-0.92') |
2576 | repo_name = old_fmt.repository_format.network_name() |
2577 | # Should end up with a 1.9 format (stackable) |
2578 | repo, control, require_stacking, repo_policy = \ |
2579 | @@ -1015,13 +1015,13 @@ |
2580 | Metadirs should compare equal iff they have the same repo, branch and |
2581 | tree formats. |
2582 | """ |
2583 | - mydir = bzrdir.format_registry.make_bzrdir('knit') |
2584 | + mydir = controldir.format_registry.make_bzrdir('knit') |
2585 | self.assertEqual(mydir, mydir) |
2586 | self.assertFalse(mydir != mydir) |
2587 | - otherdir = bzrdir.format_registry.make_bzrdir('knit') |
2588 | + otherdir = controldir.format_registry.make_bzrdir('knit') |
2589 | self.assertEqual(otherdir, mydir) |
2590 | self.assertFalse(otherdir != mydir) |
2591 | - otherdir2 = bzrdir.format_registry.make_bzrdir('development-subtree') |
2592 | + otherdir2 = controldir.format_registry.make_bzrdir('development-subtree') |
2593 | self.assertNotEqual(otherdir2, mydir) |
2594 | self.assertFalse(otherdir2 == mydir) |
2595 | |
2596 | @@ -1039,14 +1039,14 @@ |
2597 | |
2598 | def test_needs_conversion_different_working_tree(self): |
2599 | # meta1dirs need an conversion if any element is not the default. |
2600 | - new_format = bzrdir.format_registry.make_bzrdir('dirstate') |
2601 | + new_format = controldir.format_registry.make_bzrdir('dirstate') |
2602 | tree = self.make_branch_and_tree('tree', format='knit') |
2603 | self.assertTrue(tree.bzrdir.needs_format_conversion( |
2604 | new_format)) |
2605 | |
2606 | def test_initialize_on_format_uses_smart_transport(self): |
2607 | self.setup_smart_server_with_call_log() |
2608 | - new_format = bzrdir.format_registry.make_bzrdir('dirstate') |
2609 | + new_format = controldir.format_registry.make_bzrdir('dirstate') |
2610 | transport = self.get_transport('target') |
2611 | transport.ensure_base() |
2612 | self.reset_smart_call_log() |
2613 | @@ -1070,7 +1070,7 @@ |
2614 | |
2615 | def test_create_branch_convenience(self): |
2616 | # outside a repo the default convenience output is a repo+branch_tree |
2617 | - format = bzrdir.format_registry.make_bzrdir('knit') |
2618 | + format = controldir.format_registry.make_bzrdir('knit') |
2619 | branch = bzrdir.BzrDir.create_branch_convenience( |
2620 | self.get_url('foo'), format=format) |
2621 | self.assertRaises(errors.NoWorkingTree, |
2622 | @@ -1079,7 +1079,7 @@ |
2623 | |
2624 | def test_create_branch_convenience_force_tree_not_local_fails(self): |
2625 | # outside a repo the default convenience output is a repo+branch_tree |
2626 | - format = bzrdir.format_registry.make_bzrdir('knit') |
2627 | + format = controldir.format_registry.make_bzrdir('knit') |
2628 | self.assertRaises(errors.NotLocalUrl, |
2629 | bzrdir.BzrDir.create_branch_convenience, |
2630 | self.get_url('foo'), |
2631 | @@ -1090,7 +1090,7 @@ |
2632 | |
2633 | def test_clone(self): |
2634 | # clone into a nonlocal path works |
2635 | - format = bzrdir.format_registry.make_bzrdir('knit') |
2636 | + format = controldir.format_registry.make_bzrdir('knit') |
2637 | branch = bzrdir.BzrDir.create_branch_convenience('local', |
2638 | format=format) |
2639 | branch.bzrdir.open_workingtree() |
2640 | |
2641 | === modified file 'bzrlib/tests/test_clean_tree.py' |
2642 | --- bzrlib/tests/test_clean_tree.py 2011-05-26 21:02:47 +0000 |
2643 | +++ bzrlib/tests/test_clean_tree.py 2012-03-06 18:30:24 +0000 |
2644 | @@ -19,11 +19,10 @@ |
2645 | import os |
2646 | import shutil |
2647 | import sys |
2648 | -import types |
2649 | |
2650 | from bzrlib import tests, ui |
2651 | -from bzrlib.bzrdir import ( |
2652 | - BzrDir, |
2653 | +from bzrlib.controldir import ( |
2654 | + ControlDir, |
2655 | ) |
2656 | from bzrlib.clean_tree import ( |
2657 | clean_tree, |
2658 | @@ -43,7 +42,7 @@ |
2659 | if has_symlinks() is False: |
2660 | return |
2661 | os.mkdir('branch') |
2662 | - BzrDir.create_standalone_workingtree('branch') |
2663 | + ControlDir.create_standalone_workingtree('branch') |
2664 | os.symlink(os.path.realpath('no-die-please'), 'branch/die-please') |
2665 | os.mkdir('no-die-please') |
2666 | self.assertPathExists('branch/die-please') |
2667 | @@ -56,7 +55,7 @@ |
2668 | def test_iter_deletable(self): |
2669 | """Files are selected for deletion appropriately""" |
2670 | os.mkdir('branch') |
2671 | - tree = BzrDir.create_standalone_workingtree('branch') |
2672 | + tree = ControlDir.create_standalone_workingtree('branch') |
2673 | transport = tree.bzrdir.root_transport |
2674 | transport.put_bytes('.bzrignore', '*~\n*.pyc\n.bzrignore\n') |
2675 | transport.put_bytes('file.BASE', 'contents') |
2676 | @@ -122,7 +121,7 @@ |
2677 | stderr = tests.StringIOWrapper() |
2678 | ui.ui_factory = tests.TestUIFactory(stdout=stdout, stderr=stderr) |
2679 | |
2680 | - BzrDir.create_standalone_workingtree('.') |
2681 | + ControlDir.create_standalone_workingtree('.') |
2682 | self.build_tree(['0foo', '1bar', '2baz', 'subdir0/']) |
2683 | clean_tree('.', unknown=True, no_prompt=True) |
2684 | self.assertContainsRe(stderr.getvalue(), |
2685 | |
2686 | === modified file 'bzrlib/tests/test_commit.py' |
2687 | --- bzrlib/tests/test_commit.py 2012-02-14 17:22:37 +0000 |
2688 | +++ bzrlib/tests/test_commit.py 2012-03-06 18:30:24 +0000 |
2689 | @@ -19,8 +19,8 @@ |
2690 | |
2691 | import bzrlib |
2692 | from bzrlib import ( |
2693 | - bzrdir, |
2694 | config, |
2695 | + controldir, |
2696 | errors, |
2697 | ) |
2698 | from bzrlib.branch import Branch |
2699 | @@ -835,7 +835,7 @@ |
2700 | def test_commit_with_checkout_and_branch_sharing_repo(self): |
2701 | repo = self.make_repository('repo', shared=True) |
2702 | # make_branch_and_tree ignores shared repos |
2703 | - branch = bzrdir.BzrDir.create_branch_convenience('repo/branch') |
2704 | + branch = controldir.ControlDir.create_branch_convenience('repo/branch') |
2705 | tree2 = branch.create_checkout('repo/tree2') |
2706 | tree2.commit('message', rev_id='rev1') |
2707 | self.assertTrue(tree2.branch.repository.has_revision('rev1')) |
2708 | |
2709 | === modified file 'bzrlib/tests/test_config.py' |
2710 | --- bzrlib/tests/test_config.py 2012-02-20 17:38:11 +0000 |
2711 | +++ bzrlib/tests/test_config.py 2012-03-06 18:30:24 +0000 |
2712 | @@ -27,8 +27,8 @@ |
2713 | #import bzrlib specific imports here |
2714 | from bzrlib import ( |
2715 | branch, |
2716 | - bzrdir, |
2717 | config, |
2718 | + controldir, |
2719 | diff, |
2720 | errors, |
2721 | osutils, |
2722 | @@ -115,7 +115,7 @@ |
2723 | |
2724 | def build_control_store(test): |
2725 | build_backing_branch(test, 'branch') |
2726 | - b = bzrdir.BzrDir.open('branch') |
2727 | + b = controldir.ControlDir.open('branch') |
2728 | return config.ControlStore(b) |
2729 | config.test_store_builder_registry.register('control', build_control_store) |
2730 | |
2731 | @@ -1142,7 +1142,7 @@ |
2732 | |
2733 | def test_get_config(self): |
2734 | """The Branch.get_config method works properly""" |
2735 | - b = bzrdir.BzrDir.create_standalone_workingtree('.').branch |
2736 | + b = controldir.ControlDir.create_standalone_workingtree('.').branch |
2737 | my_config = b.get_config() |
2738 | self.assertIs(my_config.get_user_option('wacky'), None) |
2739 | my_config.set_user_option('wacky', 'unlikely') |
2740 | @@ -2203,7 +2203,7 @@ |
2741 | self.assertGetHook(remote_branch._get_config(), 'file', 'branch') |
2742 | |
2743 | def test_get_hook_remote_bzrdir(self): |
2744 | - remote_bzrdir = bzrdir.BzrDir.open(self.get_url('tree')) |
2745 | + remote_bzrdir = controldir.ControlDir.open(self.get_url('tree')) |
2746 | conf = remote_bzrdir._get_config() |
2747 | conf.set_option('remotedir', 'file') |
2748 | self.assertGetHook(conf, 'file', 'remotedir') |
2749 | @@ -2231,7 +2231,7 @@ |
2750 | def test_set_hook_remote_bzrdir(self): |
2751 | remote_branch = branch.Branch.open(self.get_url('tree')) |
2752 | self.addCleanup(remote_branch.lock_write().unlock) |
2753 | - remote_bzrdir = bzrdir.BzrDir.open(self.get_url('tree')) |
2754 | + remote_bzrdir = controldir.ControlDir.open(self.get_url('tree')) |
2755 | self.assertSetHook(remote_bzrdir._get_config(), 'file', 'remotedir') |
2756 | |
2757 | def assertLoadHook(self, expected_nb_calls, name, conf_class, *conf_args): |
2758 | @@ -2254,7 +2254,7 @@ |
2759 | self.assertLoadHook(1, 'file', remote.RemoteBranchConfig, remote_branch) |
2760 | |
2761 | def test_load_hook_remote_bzrdir(self): |
2762 | - remote_bzrdir = bzrdir.BzrDir.open(self.get_url('tree')) |
2763 | + remote_bzrdir = controldir.ControlDir.open(self.get_url('tree')) |
2764 | # The config file doesn't exist, set an option to force its creation |
2765 | conf = remote_bzrdir._get_config() |
2766 | conf.set_option('remotedir', 'file') |
2767 | @@ -2285,7 +2285,7 @@ |
2768 | def test_save_hook_remote_bzrdir(self): |
2769 | remote_branch = branch.Branch.open(self.get_url('tree')) |
2770 | self.addCleanup(remote_branch.lock_write().unlock) |
2771 | - remote_bzrdir = bzrdir.BzrDir.open(self.get_url('tree')) |
2772 | + remote_bzrdir = controldir.ControlDir.open(self.get_url('tree')) |
2773 | self.assertSaveHook(remote_bzrdir._get_config()) |
2774 | |
2775 | |
2776 | |
2777 | === modified file 'bzrlib/tests/test_conflicts.py' |
2778 | --- bzrlib/tests/test_conflicts.py 2011-10-27 15:38:14 +0000 |
2779 | +++ bzrlib/tests/test_conflicts.py 2012-03-06 18:30:24 +0000 |
2780 | @@ -18,7 +18,6 @@ |
2781 | import os |
2782 | |
2783 | from bzrlib import ( |
2784 | - bzrdir, |
2785 | conflicts, |
2786 | errors, |
2787 | option, |
2788 | |
2789 | === modified file 'bzrlib/tests/test_dirstate.py' |
2790 | --- bzrlib/tests/test_dirstate.py 2012-01-30 14:18:22 +0000 |
2791 | +++ bzrlib/tests/test_dirstate.py 2012-03-06 18:30:24 +0000 |
2792 | @@ -20,7 +20,7 @@ |
2793 | import tempfile |
2794 | |
2795 | from bzrlib import ( |
2796 | - bzrdir, |
2797 | + controldir, |
2798 | dirstate, |
2799 | errors, |
2800 | inventory, |
2801 | @@ -31,7 +31,6 @@ |
2802 | tests, |
2803 | workingtree_4, |
2804 | ) |
2805 | -from bzrlib.transport import memory |
2806 | from bzrlib.tests import ( |
2807 | features, |
2808 | test_osutils, |
2809 | @@ -2444,7 +2443,7 @@ |
2810 | """A minimal api to get InventoryRevisionTree to work.""" |
2811 | |
2812 | def __init__(self): |
2813 | - default_format = bzrdir.format_registry.make_bzrdir('default') |
2814 | + default_format = controldir.format_registry.make_bzrdir('default') |
2815 | self._format = default_format.repository_format |
2816 | |
2817 | def lock_read(self): |
2818 | |
2819 | === modified file 'bzrlib/tests/test_errors.py' |
2820 | --- bzrlib/tests/test_errors.py 2011-11-28 17:15:29 +0000 |
2821 | +++ bzrlib/tests/test_errors.py 2012-03-06 18:30:24 +0000 |
2822 | @@ -22,7 +22,7 @@ |
2823 | import sys |
2824 | |
2825 | from bzrlib import ( |
2826 | - bzrdir, |
2827 | + controldir, |
2828 | errors, |
2829 | osutils, |
2830 | urlutils, |
2831 | @@ -207,7 +207,7 @@ |
2832 | 'There is no public branch set for "%s".' % url, str(error)) |
2833 | |
2834 | def test_no_repo(self): |
2835 | - dir = bzrdir.BzrDir.create(self.get_url()) |
2836 | + dir = controldir.ControlDir.create(self.get_url()) |
2837 | error = errors.NoRepositoryPresent(dir) |
2838 | self.assertNotEqual(-1, str(error).find((dir.transport.clone('..').base))) |
2839 | self.assertEqual(-1, str(error).find((dir.transport.base))) |
2840 | |
2841 | === modified file 'bzrlib/tests/test_foreign.py' |
2842 | --- bzrlib/tests/test_foreign.py 2012-01-24 16:19:04 +0000 |
2843 | +++ bzrlib/tests/test_foreign.py 2012-03-06 18:30:24 +0000 |
2844 | @@ -330,7 +330,7 @@ |
2845 | |
2846 | def cloning_metadir(self, stacked=False): |
2847 | """Produce a metadir suitable for cloning with.""" |
2848 | - return bzrdir.format_registry.make_bzrdir("default") |
2849 | + return controldir.format_registry.make_bzrdir("default") |
2850 | |
2851 | def checkout_metadir(self): |
2852 | return self.cloning_metadir() |
2853 | @@ -446,7 +446,7 @@ |
2854 | def test_create(self): |
2855 | """Test we can create dummies.""" |
2856 | self.make_branch_and_tree("d", format=DummyForeignVcsDirFormat()) |
2857 | - dir = bzrdir.BzrDir.open("d") |
2858 | + dir = controldir.ControlDir.open("d") |
2859 | self.assertEquals("A Dummy VCS Dir", dir._format.get_format_string()) |
2860 | dir.open_repository() |
2861 | dir.open_branch() |
2862 | @@ -455,7 +455,7 @@ |
2863 | def test_sprout(self): |
2864 | """Test we can clone dummies and that the format is not preserved.""" |
2865 | self.make_branch_and_tree("d", format=DummyForeignVcsDirFormat()) |
2866 | - dir = bzrdir.BzrDir.open("d") |
2867 | + dir = controldir.ControlDir.open("d") |
2868 | newdir = dir.sprout("e") |
2869 | self.assertNotEquals("A Dummy VCS Dir", |
2870 | newdir._format.get_format_string()) |
2871 | |
2872 | === modified file 'bzrlib/tests/test_http.py' |
2873 | --- bzrlib/tests/test_http.py 2012-01-20 12:56:05 +0000 |
2874 | +++ bzrlib/tests/test_http.py 2012-03-06 18:30:24 +0000 |
2875 | @@ -31,8 +31,8 @@ |
2876 | |
2877 | import bzrlib |
2878 | from bzrlib import ( |
2879 | - bzrdir, |
2880 | config, |
2881 | + controldir, |
2882 | debug, |
2883 | errors, |
2884 | osutils, |
2885 | @@ -1911,10 +1911,10 @@ |
2886 | server._url_protocol = self._url_protocol |
2887 | return server |
2888 | |
2889 | - def test_open_bzrdir(self): |
2890 | + def test_open_controldir(self): |
2891 | branch = self.make_branch('relpath') |
2892 | url = self.http_server.get_url() + 'relpath' |
2893 | - bd = bzrdir.BzrDir.open(url) |
2894 | + bd = controldir.ControlDir.open(url) |
2895 | self.addCleanup(bd.transport.disconnect) |
2896 | self.assertIsInstance(bd, _mod_remote.RemoteBzrDir) |
2897 | |
2898 | |
2899 | === modified file 'bzrlib/tests/test_import_tariff.py' |
2900 | --- bzrlib/tests/test_import_tariff.py 2011-12-19 00:55:07 +0000 |
2901 | +++ bzrlib/tests/test_import_tariff.py 2012-03-06 18:30:24 +0000 |
2902 | @@ -25,7 +25,7 @@ |
2903 | plugins as _mod_plugins, |
2904 | trace, |
2905 | ) |
2906 | -from bzrlib.bzrdir import BzrDir |
2907 | +from bzrlib.controldir import ControlDir |
2908 | from bzrlib.smart import medium |
2909 | from bzrlib.transport import remote |
2910 | |
2911 | @@ -223,7 +223,7 @@ |
2912 | client_medium = medium.SmartSimplePipesClientMedium( |
2913 | process.stdout, process.stdin, url) |
2914 | transport = remote.RemoteTransport(url, medium=client_medium) |
2915 | - branch = BzrDir.open_from_transport(transport).open_branch() |
2916 | + branch = ControlDir.open_from_transport(transport).open_branch() |
2917 | process.stdin.close() |
2918 | # Hide stdin from the subprocess module, so it won't fail to close it. |
2919 | process.stdin = None |
2920 | |
2921 | === modified file 'bzrlib/tests/test_merge_core.py' |
2922 | --- bzrlib/tests/test_merge_core.py 2012-01-25 21:13:15 +0000 |
2923 | +++ bzrlib/tests/test_merge_core.py 2012-03-06 18:30:24 +0000 |
2924 | @@ -19,6 +19,7 @@ |
2925 | |
2926 | import bzrlib |
2927 | from bzrlib import ( |
2928 | + controldir, |
2929 | errors, |
2930 | generate_ids, |
2931 | merge_directive, |
2932 | @@ -48,7 +49,7 @@ |
2933 | def wt(name): |
2934 | path = pathjoin(self.dir, name) |
2935 | os.mkdir(path) |
2936 | - wt = bzrlib.bzrdir.BzrDir.create_standalone_workingtree(path) |
2937 | + wt = controldir.ControlDir.create_standalone_workingtree(path) |
2938 | # the tests perform pulls, so need a branch that is writeable. |
2939 | wt.lock_write() |
2940 | wt.set_root_id(self.tree_root) |
2941 | |
2942 | === modified file 'bzrlib/tests/test_options.py' |
2943 | --- bzrlib/tests/test_options.py 2011-11-24 17:01:07 +0000 |
2944 | +++ bzrlib/tests/test_options.py 2012-03-06 18:30:24 +0000 |
2945 | @@ -160,14 +160,14 @@ |
2946 | |
2947 | def test_registry_converter(self): |
2948 | options = [option.RegistryOption('format', '', |
2949 | - bzrdir.format_registry, bzrdir.format_registry.make_bzrdir)] |
2950 | + controldir.format_registry, controldir.format_registry.make_bzrdir)] |
2951 | opts, args = self.parse(options, ['--format', 'knit']) |
2952 | self.assertIsInstance(opts.format.repository_format, |
2953 | knitrepo.RepositoryFormatKnit1) |
2954 | |
2955 | def test_lazy_registry(self): |
2956 | options = [option.RegistryOption('format', '', |
2957 | - lazy_registry=('bzrlib.bzrdir','format_registry'), |
2958 | + lazy_registry=('bzrlib.controldir','format_registry'), |
2959 | converter=str)] |
2960 | opts, args = self.parse(options, ['--format', 'knit']) |
2961 | self.assertEqual({'format': 'knit'}, opts) |
2962 | |
2963 | === modified file 'bzrlib/tests/test_permissions.py' |
2964 | --- bzrlib/tests/test_permissions.py 2012-01-25 21:13:15 +0000 |
2965 | +++ bzrlib/tests/test_permissions.py 2012-03-06 18:30:24 +0000 |
2966 | @@ -35,7 +35,7 @@ |
2967 | |
2968 | from bzrlib import urlutils |
2969 | from bzrlib.branch import Branch |
2970 | -from bzrlib.bzrdir import BzrDir |
2971 | +from bzrlib.controldir import ControlDir |
2972 | from bzrlib.tests import TestCaseWithTransport, TestSkipped |
2973 | from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer |
2974 | from bzrlib.workingtree import WorkingTree |
2975 | @@ -199,7 +199,7 @@ |
2976 | |
2977 | os.mkdir('sftp') |
2978 | sftp_url = self.get_url('sftp') |
2979 | - b_sftp = BzrDir.create_branch_and_repo(sftp_url) |
2980 | + b_sftp = ControlDir.create_branch_and_repo(sftp_url) |
2981 | |
2982 | b_sftp.pull(b_local) |
2983 | del b_sftp |
2984 | |
2985 | === modified file 'bzrlib/tests/test_reconfigure.py' |
2986 | --- bzrlib/tests/test_reconfigure.py 2012-01-18 14:09:19 +0000 |
2987 | +++ bzrlib/tests/test_reconfigure.py 2012-03-06 18:30:24 +0000 |
2988 | @@ -16,7 +16,7 @@ |
2989 | |
2990 | from bzrlib import ( |
2991 | branch as _mod_branch, |
2992 | - bzrdir, |
2993 | + controldir, |
2994 | errors, |
2995 | reconfigure, |
2996 | repository, |
2997 | @@ -72,7 +72,7 @@ |
2998 | checkout = branch.create_checkout('checkout') |
2999 | reconfiguration = reconfigure.Reconfigure.to_branch(checkout.bzrdir) |
3000 | reconfiguration.apply() |
3001 | - reconfigured = bzrdir.BzrDir.open('checkout').open_branch() |
3002 | + reconfigured = controldir.ControlDir.open('checkout').open_branch() |
3003 | self.assertIs(None, reconfigured.get_bound_location()) |
3004 | |
3005 | def prepare_lightweight_checkout_to_branch(self): |
3006 | @@ -445,7 +445,7 @@ |
3007 | r"Requested reconfiguration of '.*' is not supported.") |
3008 | |
3009 | def test_lightweight_checkout_to_tree_preserves_reference_locations(self): |
3010 | - format = bzrdir.format_registry.make_bzrdir('1.9') |
3011 | + format = controldir.format_registry.make_bzrdir('1.9') |
3012 | format.set_branch_format(_mod_branch.BzrBranchFormat8()) |
3013 | tree = self.make_branch_and_tree('tree', format=format) |
3014 | tree.branch.set_reference_info('file_id', 'path', '../location') |
3015 | |
3016 | === modified file 'bzrlib/tests/test_remote.py' |
3017 | --- bzrlib/tests/test_remote.py 2012-02-18 16:55:04 +0000 |
3018 | +++ bzrlib/tests/test_remote.py 2012-03-06 18:30:24 +0000 |
3019 | @@ -349,11 +349,11 @@ |
3020 | class TestRemote(tests.TestCaseWithMemoryTransport): |
3021 | |
3022 | def get_branch_format(self): |
3023 | - reference_bzrdir_format = bzrdir.format_registry.get('default')() |
3024 | + reference_bzrdir_format = controldir.format_registry.get('default')() |
3025 | return reference_bzrdir_format.get_branch_format() |
3026 | |
3027 | def get_repo_format(self): |
3028 | - reference_bzrdir_format = bzrdir.format_registry.get('default')() |
3029 | + reference_bzrdir_format = controldir.format_registry.get('default')() |
3030 | return reference_bzrdir_format.repository_format |
3031 | |
3032 | def assertFinished(self, fake_client): |
3033 | @@ -475,7 +475,7 @@ |
3034 | transport = transport.clone('quack') |
3035 | self.make_bzrdir('quack') |
3036 | client = FakeClient(transport.base) |
3037 | - reference_bzrdir_format = bzrdir.format_registry.get('default')() |
3038 | + reference_bzrdir_format = controldir.format_registry.get('default')() |
3039 | control_name = reference_bzrdir_format.network_name() |
3040 | client.add_expected_call( |
3041 | 'BzrDir.cloning_metadir', ('quack/', 'False'), |
3042 | @@ -509,7 +509,7 @@ |
3043 | def test__get_checkout_format(self): |
3044 | transport = MemoryTransport() |
3045 | client = FakeClient(transport.base) |
3046 | - reference_bzrdir_format = bzrdir.format_registry.get('default')() |
3047 | + reference_bzrdir_format = controldir.format_registry.get('default')() |
3048 | control_name = reference_bzrdir_format.network_name() |
3049 | client.add_expected_call( |
3050 | 'BzrDir.checkout_metadir', ('quack/', ), |
3051 | @@ -546,7 +546,7 @@ |
3052 | def test_get_branches(self): |
3053 | transport = MemoryTransport() |
3054 | client = FakeClient(transport.base) |
3055 | - reference_bzrdir_format = bzrdir.format_registry.get('default')() |
3056 | + reference_bzrdir_format = controldir.format_registry.get('default')() |
3057 | branch_name = reference_bzrdir_format.get_branch_format().network_name() |
3058 | client.add_success_response_with_body( |
3059 | bencode.bencode({ |
3060 | @@ -854,7 +854,7 @@ |
3061 | transport = transport.clone('quack') |
3062 | self.make_repository('quack') |
3063 | client = FakeClient(transport.base) |
3064 | - reference_bzrdir_format = bzrdir.format_registry.get('default')() |
3065 | + reference_bzrdir_format = controldir.format_registry.get('default')() |
3066 | reference_format = reference_bzrdir_format.get_branch_format() |
3067 | network_name = reference_format.network_name() |
3068 | reference_repo_fmt = reference_bzrdir_format.repository_format |
3069 | @@ -882,7 +882,7 @@ |
3070 | # Client's medium rooted a transport root (not at the bzrdir) |
3071 | client = FakeClient(transport.base) |
3072 | transport = transport.clone('quack') |
3073 | - reference_bzrdir_format = bzrdir.format_registry.get('default')() |
3074 | + reference_bzrdir_format = controldir.format_registry.get('default')() |
3075 | reference_format = reference_bzrdir_format.get_branch_format() |
3076 | network_name = reference_format.network_name() |
3077 | reference_repo_fmt = reference_bzrdir_format.repository_format |
3078 | @@ -918,7 +918,7 @@ |
3079 | transport = transport.clone('quack') |
3080 | self.make_bzrdir('quack') |
3081 | client = FakeClient(transport.base) |
3082 | - reference_bzrdir_format = bzrdir.format_registry.get('default')() |
3083 | + reference_bzrdir_format = controldir.format_registry.get('default')() |
3084 | reference_format = reference_bzrdir_format.repository_format |
3085 | network_name = reference_format.network_name() |
3086 | client.add_expected_call( |
3087 | @@ -3964,7 +3964,7 @@ |
3088 | :result: The revision ids in the stream, in the order seen, |
3089 | the topological order of revisions in the source. |
3090 | """ |
3091 | - unordered_format = bzrdir.format_registry.get(format)() |
3092 | + unordered_format = controldir.format_registry.get(format)() |
3093 | target_repository_format = unordered_format.repository_format |
3094 | # Cross check |
3095 | self.assertEqual(order, target_repository_format._fetch_order) |
3096 | @@ -4273,7 +4273,7 @@ |
3097 | def test_single_empty(self): |
3098 | transport_path = 'quack' |
3099 | repo, client = self.setup_fake_client_and_repository(transport_path) |
3100 | - fmt = bzrdir.format_registry.get('2a')().repository_format |
3101 | + fmt = controldir.format_registry.get('2a')().repository_format |
3102 | repo._format = fmt |
3103 | stream = [('inventory-deltas', [ |
3104 | versionedfile.FulltextContentFactory('somerevid', None, None, |
3105 | |
3106 | === modified file 'bzrlib/tests/test_repository.py' |
3107 | --- bzrlib/tests/test_repository.py 2012-01-24 16:19:04 +0000 |
3108 | +++ bzrlib/tests/test_repository.py 2012-03-06 18:30:24 +0000 |
3109 | @@ -45,6 +45,7 @@ |
3110 | ) |
3111 | from bzrlib import ( |
3112 | bzrdir, |
3113 | + controldir, |
3114 | errors, |
3115 | inventory, |
3116 | osutils, |
3117 | @@ -66,7 +67,7 @@ |
3118 | class TestDefaultFormat(TestCase): |
3119 | |
3120 | def test_get_set_default_format(self): |
3121 | - old_default = bzrdir.format_registry.get('default') |
3122 | + old_default = controldir.format_registry.get('default') |
3123 | private_default = old_default().repository_format.__class__ |
3124 | old_format = repository.format_registry.get_default() |
3125 | self.assertTrue(isinstance(old_format, private_default)) |
3126 | @@ -74,9 +75,9 @@ |
3127 | my_bzrdir = bzrdir.BzrDirMetaFormat1() |
3128 | my_bzrdir.repository_format = SampleRepositoryFormat() |
3129 | return my_bzrdir |
3130 | - bzrdir.format_registry.remove('default') |
3131 | - bzrdir.format_registry.register('sample', make_sample_bzrdir, '') |
3132 | - bzrdir.format_registry.set_default('sample') |
3133 | + controldir.format_registry.remove('default') |
3134 | + controldir.format_registry.register('sample', make_sample_bzrdir, '') |
3135 | + controldir.format_registry.set_default('sample') |
3136 | # creating a repository should now create an instrumented dir. |
3137 | try: |
3138 | # the default branch format is used by the meta dir format |
3139 | @@ -85,9 +86,9 @@ |
3140 | result = dir.create_repository() |
3141 | self.assertEqual(result, 'A bzr repository dir') |
3142 | finally: |
3143 | - bzrdir.format_registry.remove('default') |
3144 | - bzrdir.format_registry.remove('sample') |
3145 | - bzrdir.format_registry.register('default', old_default, '') |
3146 | + controldir.format_registry.remove('default') |
3147 | + controldir.format_registry.remove('sample') |
3148 | + controldir.format_registry.register('default', old_default, '') |
3149 | self.assertIsInstance(repository.format_registry.get_default(), |
3150 | old_format.__class__) |
3151 | |
3152 | @@ -236,13 +237,13 @@ |
3153 | def test_attribute__fetch_order(self): |
3154 | """Knits need topological data insertion.""" |
3155 | repo = self.make_repository('.', |
3156 | - format=bzrdir.format_registry.get('knit')()) |
3157 | + format=controldir.format_registry.get('knit')()) |
3158 | self.assertEqual('topological', repo._format._fetch_order) |
3159 | |
3160 | def test_attribute__fetch_uses_deltas(self): |
3161 | """Knits reuse deltas.""" |
3162 | repo = self.make_repository('.', |
3163 | - format=bzrdir.format_registry.get('knit')()) |
3164 | + format=controldir.format_registry.get('knit')()) |
3165 | self.assertEqual(True, repo._format._fetch_uses_deltas) |
3166 | |
3167 | def test_disk_layout(self): |
3168 | @@ -334,7 +335,7 @@ |
3169 | is valid when the api is not being abused. |
3170 | """ |
3171 | repo = self.make_repository('.', |
3172 | - format=bzrdir.format_registry.get('knit')()) |
3173 | + format=controldir.format_registry.get('knit')()) |
3174 | inv_xml = '<inventory format="5">\n</inventory>\n' |
3175 | inv = repo._deserialise_inventory('test-rev-id', inv_xml) |
3176 | self.assertEqual('test-rev-id', inv.root.revision) |
3177 | @@ -342,7 +343,7 @@ |
3178 | def test_deserialise_uses_global_revision_id(self): |
3179 | """If it is set, then we re-use the global revision id""" |
3180 | repo = self.make_repository('.', |
3181 | - format=bzrdir.format_registry.get('knit')()) |
3182 | + format=controldir.format_registry.get('knit')()) |
3183 | inv_xml = ('<inventory format="5" revision_id="other-rev-id">\n' |
3184 | '</inventory>\n') |
3185 | # Arguably, the deserialise_inventory should detect a mismatch, and |
3186 | @@ -355,7 +356,7 @@ |
3187 | |
3188 | def test_supports_external_lookups(self): |
3189 | repo = self.make_repository('.', |
3190 | - format=bzrdir.format_registry.get('knit')()) |
3191 | + format=controldir.format_registry.get('knit')()) |
3192 | self.assertFalse(repo._format.supports_external_lookups) |
3193 | |
3194 | |
3195 | @@ -994,7 +995,7 @@ |
3196 | class TestRepositoryPackCollection(TestCaseWithTransport): |
3197 | |
3198 | def get_format(self): |
3199 | - return bzrdir.format_registry.make_bzrdir('pack-0.92') |
3200 | + return controldir.format_registry.make_bzrdir('pack-0.92') |
3201 | |
3202 | def get_packs(self): |
3203 | format = self.get_format() |
3204 | |
3205 | === modified file 'bzrlib/tests/test_selftest.py' |
3206 | --- bzrlib/tests/test_selftest.py 2011-11-08 17:07:23 +0000 |
3207 | +++ bzrlib/tests/test_selftest.py 2012-03-06 18:30:24 +0000 |
3208 | @@ -43,6 +43,7 @@ |
3209 | from bzrlib import ( |
3210 | branchbuilder, |
3211 | bzrdir, |
3212 | + controldir, |
3213 | errors, |
3214 | hooks, |
3215 | lockdir, |
3216 | @@ -609,7 +610,7 @@ |
3217 | # Guard against regression into MemoryTransport leaking |
3218 | # files to disk instead of keeping them in memory. |
3219 | self.assertFalse(osutils.lexists('dir')) |
3220 | - dir_format = bzrdir.format_registry.make_bzrdir('knit') |
3221 | + dir_format = controldir.format_registry.make_bzrdir('knit') |
3222 | self.assertEqual(dir_format.repository_format.__class__, |
3223 | the_branch.repository._format.__class__) |
3224 | self.assertEqual('Bazaar-NG Knit Repository Format 1', |
3225 | @@ -678,7 +679,7 @@ |
3226 | builder = self.make_branch_builder('dir') |
3227 | rev_id = builder.build_commit() |
3228 | self.assertPathExists('dir') |
3229 | - a_dir = bzrdir.BzrDir.open('dir') |
3230 | + a_dir = controldir.ControlDir.open('dir') |
3231 | self.assertRaises(errors.NoWorkingTree, a_dir.open_workingtree) |
3232 | a_branch = a_dir.open_branch() |
3233 | builder_branch = builder.get_branch() |
3234 | @@ -1477,13 +1478,13 @@ |
3235 | transport_server.start_server() |
3236 | self.addCleanup(transport_server.stop_server) |
3237 | t = transport.get_transport_from_url(transport_server.get_url()) |
3238 | - bzrdir.BzrDir.create(t.base) |
3239 | + controldir.ControlDir.create(t.base) |
3240 | self.assertRaises(errors.BzrError, |
3241 | - bzrdir.BzrDir.open_from_transport, t) |
3242 | + controldir.ControlDir.open_from_transport, t) |
3243 | # But if we declare this as safe, we can open the bzrdir. |
3244 | self.permit_url(t.base) |
3245 | self._bzr_selftest_roots.append(t.base) |
3246 | - bzrdir.BzrDir.open_from_transport(t) |
3247 | + controldir.ControlDir.open_from_transport(t) |
3248 | |
3249 | def test_requireFeature_available(self): |
3250 | """self.requireFeature(available) is a no-op.""" |
3251 | @@ -1943,7 +1944,7 @@ |
3252 | def test_make_branch_and_tree_with_format(self): |
3253 | # we should be able to supply a format to make_branch_and_tree |
3254 | self.make_branch_and_tree('a', format=bzrlib.bzrdir.BzrDirMetaFormat1()) |
3255 | - self.assertIsInstance(bzrlib.bzrdir.BzrDir.open('a')._format, |
3256 | + self.assertIsInstance(bzrlib.controldir.ControlDir.open('a')._format, |
3257 | bzrlib.bzrdir.BzrDirMetaFormat1) |
3258 | |
3259 | def test_make_branch_and_memory_tree(self): |
3260 | |
3261 | === modified file 'bzrlib/tests/test_sftp_transport.py' |
3262 | --- bzrlib/tests/test_sftp_transport.py 2012-01-25 21:13:15 +0000 |
3263 | +++ bzrlib/tests/test_sftp_transport.py 2012-03-06 18:30:24 +0000 |
3264 | @@ -21,8 +21,8 @@ |
3265 | import time |
3266 | |
3267 | from bzrlib import ( |
3268 | - bzrdir, |
3269 | config, |
3270 | + controldir, |
3271 | errors, |
3272 | tests, |
3273 | transport as _mod_transport, |
3274 | @@ -191,12 +191,12 @@ |
3275 | |
3276 | def test_push_support(self): |
3277 | self.build_tree(['a/', 'a/foo']) |
3278 | - t = bzrdir.BzrDir.create_standalone_workingtree('a') |
3279 | + t = controldir.ControlDir.create_standalone_workingtree('a') |
3280 | b = t.branch |
3281 | t.add('foo') |
3282 | t.commit('foo', rev_id='a1') |
3283 | |
3284 | - b2 = bzrdir.BzrDir.create_branch_and_repo(self.get_url('/b')) |
3285 | + b2 = controldir.ControlDir.create_branch_and_repo(self.get_url('/b')) |
3286 | b2.pull(b) |
3287 | |
3288 | self.assertEquals(b2.last_revision(), 'a1') |
3289 | |
3290 | === modified file 'bzrlib/tests/test_smart.py' |
3291 | --- bzrlib/tests/test_smart.py 2012-02-14 17:22:37 +0000 |
3292 | +++ bzrlib/tests/test_smart.py 2012-03-06 18:30:24 +0000 |
3293 | @@ -30,7 +30,7 @@ |
3294 | from bzrlib import ( |
3295 | bencode, |
3296 | branch as _mod_branch, |
3297 | - bzrdir, |
3298 | + controldir, |
3299 | errors, |
3300 | gpg, |
3301 | inventory_delta, |
3302 | @@ -121,7 +121,7 @@ |
3303 | stream = [('text', [versionedfile.FulltextContentFactory(('k1',), None, |
3304 | None, 'foo')]),('text', [ |
3305 | versionedfile.FulltextContentFactory(('k2',), None, None, 'bar')])] |
3306 | - fmt = bzrdir.format_registry.get('pack-0.92')().repository_format |
3307 | + fmt = controldir.format_registry.get('pack-0.92')().repository_format |
3308 | bytes = smart_repo._stream_to_byte_stream(stream, fmt) |
3309 | streams = [] |
3310 | # Iterate the resulting iterable; checking that we get only one stream |
3311 | @@ -333,7 +333,7 @@ |
3312 | self.make_bzrdir('.') |
3313 | request_class = smart_dir.SmartServerRequestCreateRepository |
3314 | request = request_class(backing) |
3315 | - reference_bzrdir_format = bzrdir.format_registry.get('pack-0.92')() |
3316 | + reference_bzrdir_format = controldir.format_registry.get('pack-0.92')() |
3317 | reference_format = reference_bzrdir_format.repository_format |
3318 | network_name = reference_format.network_name() |
3319 | expected = smart_req.SuccessfulSmartServerResponse( |
3320 | @@ -493,7 +493,7 @@ |
3321 | request = smart_dir.SmartServerRequestInitializeBzrDir(backing) |
3322 | self.assertEqual(smart_req.SmartServerResponse(('ok', )), |
3323 | request.execute('')) |
3324 | - made_dir = bzrdir.BzrDir.open_from_transport(backing) |
3325 | + made_dir = controldir.ControlDir.open_from_transport(backing) |
3326 | # no branch, tree or repository is expected with the current |
3327 | # default formart. |
3328 | self.assertRaises(errors.NoWorkingTree, made_dir.open_workingtree) |
3329 | @@ -533,7 +533,7 @@ |
3330 | 'False', '', '', '')), |
3331 | request.execute(name, '', 'True', 'False', 'False', '', '', '', '', |
3332 | 'False')) |
3333 | - made_dir = bzrdir.BzrDir.open_from_transport(backing) |
3334 | + made_dir = controldir.ControlDir.open_from_transport(backing) |
3335 | # no branch, tree or repository is expected with the current |
3336 | # default format. |
3337 | self.assertRaises(errors.NoWorkingTree, made_dir.open_workingtree) |
3338 | @@ -2691,7 +2691,7 @@ |
3339 | versionedfile.FulltextContentFactory('somerev', None, None, |
3340 | self._get_serialized_inventory_delta( |
3341 | t.branch.repository, 'null:', 'somerev'))])] |
3342 | - fmt = bzrdir.format_registry.get('2a')().repository_format |
3343 | + fmt = controldir.format_registry.get('2a')().repository_format |
3344 | self.assertEquals( |
3345 | "".join(response.body_stream), |
3346 | "".join(smart_repo._stream_to_byte_stream(stream, fmt))) |
3347 | |
3348 | === modified file 'bzrlib/tests/test_smart_transport.py' |
3349 | --- bzrlib/tests/test_smart_transport.py 2011-11-25 17:54:52 +0000 |
3350 | +++ bzrlib/tests/test_smart_transport.py 2012-03-06 18:30:24 +0000 |
3351 | @@ -32,6 +32,7 @@ |
3352 | import bzrlib |
3353 | from bzrlib import ( |
3354 | bzrdir, |
3355 | + controldir, |
3356 | debug, |
3357 | errors, |
3358 | osutils, |
3359 | @@ -1628,7 +1629,8 @@ |
3360 | transport = self.transport |
3361 | t = self.backing_transport |
3362 | bzrdir.BzrDirFormat.get_default_format().initialize_on_transport(t) |
3363 | - result_dir = bzrdir.BzrDir.open_containing_from_transport(transport) |
3364 | + result_dir = controldir.ControlDir.open_containing_from_transport( |
3365 | + transport) |
3366 | |
3367 | |
3368 | class ReadOnlyEndToEndTests(SmartTCPTests): |
3369 | |
3370 | === modified file 'bzrlib/tests/test_tag.py' |
3371 | --- bzrlib/tests/test_tag.py 2011-09-22 13:26:14 +0000 |
3372 | +++ bzrlib/tests/test_tag.py 2012-03-06 18:30:24 +0000 |
3373 | @@ -18,7 +18,7 @@ |
3374 | |
3375 | |
3376 | from bzrlib import ( |
3377 | - bzrdir, |
3378 | + controldir, |
3379 | errors, |
3380 | ) |
3381 | from bzrlib.tag import ( |
3382 | @@ -69,8 +69,8 @@ |
3383 | class TestTagMerging(TestCaseWithTransport): |
3384 | |
3385 | def make_knit_branch(self, relpath): |
3386 | - old_bdf = bzrdir.format_registry.make_bzrdir('knit') |
3387 | - return bzrdir.BzrDir.create_branch_convenience(relpath, format=old_bdf) |
3388 | + old_bdf = controldir.format_registry.make_bzrdir('knit') |
3389 | + return controldir.ControlDir.create_branch_convenience(relpath, format=old_bdf) |
3390 | |
3391 | def make_branch_supporting_tags(self, relpath): |
3392 | return self.make_branch(relpath, format='dirstate-tags') |
3393 | |
3394 | === modified file 'bzrlib/tests/test_transform.py' |
3395 | --- bzrlib/tests/test_transform.py 2012-02-06 23:38:33 +0000 |
3396 | +++ bzrlib/tests/test_transform.py 2012-03-06 18:30:24 +0000 |
3397 | @@ -34,7 +34,6 @@ |
3398 | transform, |
3399 | urlutils, |
3400 | ) |
3401 | -from bzrlib.bzrdir import BzrDir |
3402 | from bzrlib.conflicts import ( |
3403 | DeletingParent, |
3404 | DuplicateEntry, |
3405 | @@ -44,6 +43,7 @@ |
3406 | ParentLoop, |
3407 | UnversionedParent, |
3408 | ) |
3409 | +from bzrlib.controldir import ControlDir |
3410 | from bzrlib.diff import show_diff_trees |
3411 | from bzrlib.errors import ( |
3412 | DuplicateKey, |
3413 | @@ -1645,7 +1645,7 @@ |
3414 | def __init__(self, dirname, root_id): |
3415 | self.name = dirname |
3416 | os.mkdir(dirname) |
3417 | - self.wt = BzrDir.create_standalone_workingtree(dirname) |
3418 | + self.wt = ControlDir.create_standalone_workingtree(dirname) |
3419 | self.wt.set_root_id(root_id) |
3420 | self.b = self.wt.branch |
3421 | self.tt = TreeTransform(self.wt) |
3422 | @@ -1881,13 +1881,13 @@ |
3423 | def test_build_tree_with_symlinks(self): |
3424 | self.requireFeature(SymlinkFeature) |
3425 | os.mkdir('a') |
3426 | - a = BzrDir.create_standalone_workingtree('a') |
3427 | + a = ControlDir.create_standalone_workingtree('a') |
3428 | os.mkdir('a/foo') |
3429 | with file('a/foo/bar', 'wb') as f: f.write('contents') |
3430 | os.symlink('a/foo/bar', 'a/foo/baz') |
3431 | a.add(['foo', 'foo/bar', 'foo/baz']) |
3432 | a.commit('initial commit') |
3433 | - b = BzrDir.create_standalone_workingtree('b') |
3434 | + b = ControlDir.create_standalone_workingtree('b') |
3435 | basis = a.basis_tree() |
3436 | basis.lock_read() |
3437 | self.addCleanup(basis.unlock) |
3438 | |
3439 | === modified file 'bzrlib/tests/test_upgrade.py' |
3440 | --- bzrlib/tests/test_upgrade.py 2012-01-04 17:12:42 +0000 |
3441 | +++ bzrlib/tests/test_upgrade.py 2012-03-06 18:30:24 +0000 |
3442 | @@ -24,7 +24,7 @@ |
3443 | |
3444 | from bzrlib import ( |
3445 | branch, |
3446 | - bzrdir, |
3447 | + controldir, |
3448 | tests, |
3449 | upgrade, |
3450 | workingtree, |
3451 | @@ -45,7 +45,7 @@ |
3452 | b.set_parent('file:///EF') |
3453 | b.set_bound_location('file:///GH') |
3454 | b.set_push_location('file:///IJ') |
3455 | - target = bzrdir.format_registry.make_bzrdir('dirstate-with-subtree') |
3456 | + target = controldir.format_registry.make_bzrdir('dirstate-with-subtree') |
3457 | converter = b.bzrdir._format.get_converter(target) |
3458 | converter.convert(b.bzrdir, None) |
3459 | new_branch = branch.Branch.open(self.get_url('branch')) |
3460 | @@ -64,7 +64,7 @@ |
3461 | |
3462 | def test_convert_branch7_branch8(self): |
3463 | b = self.make_branch('branch', format='1.9') |
3464 | - target = bzrdir.format_registry.make_bzrdir('1.9') |
3465 | + target = controldir.format_registry.make_bzrdir('1.9') |
3466 | target.set_branch_format(branch.BzrBranchFormat8()) |
3467 | converter = b.bzrdir._format.get_converter(target) |
3468 | converter.convert(b.bzrdir, None) |
3469 | @@ -75,7 +75,7 @@ |
3470 | def test_convert_knit_dirstate_empty(self): |
3471 | # test that asking for an upgrade from knit to dirstate works. |
3472 | tree = self.make_branch_and_tree('tree', format='knit') |
3473 | - target = bzrdir.format_registry.make_bzrdir('dirstate') |
3474 | + target = controldir.format_registry.make_bzrdir('dirstate') |
3475 | converter = tree.bzrdir._format.get_converter(target) |
3476 | converter.convert(tree.bzrdir, None) |
3477 | new_tree = workingtree.WorkingTree.open('tree') |
3478 | @@ -88,7 +88,7 @@ |
3479 | tree = self.make_branch_and_tree('tree', format='knit') |
3480 | self.build_tree(['tree/file']) |
3481 | tree.add(['file'], ['file-id']) |
3482 | - target = bzrdir.format_registry.make_bzrdir('dirstate') |
3483 | + target = controldir.format_registry.make_bzrdir('dirstate') |
3484 | converter = tree.bzrdir._format.get_converter(target) |
3485 | converter.convert(tree.bzrdir, None) |
3486 | new_tree = workingtree.WorkingTree.open('tree') |
3487 | @@ -99,7 +99,7 @@ |
3488 | # test that asking for an upgrade from knit to dirstate works. |
3489 | tree = self.make_branch_and_tree('tree', format='knit') |
3490 | rev_id = tree.commit('first post') |
3491 | - target = bzrdir.format_registry.make_bzrdir('dirstate') |
3492 | + target = controldir.format_registry.make_bzrdir('dirstate') |
3493 | converter = tree.bzrdir._format.get_converter(target) |
3494 | converter.convert(tree.bzrdir, None) |
3495 | new_tree = workingtree.WorkingTree.open('tree') |
3496 | @@ -116,7 +116,7 @@ |
3497 | rev_id2 = tree.commit('second post') |
3498 | rev_id3 = merge_tree.commit('second merge post') |
3499 | tree.merge_from_branch(merge_tree.branch) |
3500 | - target = bzrdir.format_registry.make_bzrdir('dirstate') |
3501 | + target = controldir.format_registry.make_bzrdir('dirstate') |
3502 | converter = tree.bzrdir._format.get_converter(target) |
3503 | converter.convert(tree.bzrdir, None) |
3504 | new_tree = workingtree.WorkingTree.open('tree') |
3505 | @@ -130,8 +130,8 @@ |
3506 | |
3507 | class TestSmartUpgrade(tests.TestCaseWithTransport): |
3508 | |
3509 | - from_format = bzrdir.format_registry.make_bzrdir("pack-0.92") |
3510 | - to_format = bzrdir.format_registry.make_bzrdir("2a") |
3511 | + from_format = controldir.format_registry.make_bzrdir("pack-0.92") |
3512 | + to_format = controldir.format_registry.make_bzrdir("2a") |
3513 | |
3514 | def make_standalone_branch(self): |
3515 | wt = self.make_branch_and_tree("branch1", format=self.from_format) |
3516 | @@ -170,9 +170,9 @@ |
3517 | format=self.from_format) |
3518 | # Note: self.make_branch() always creates a new repo at the location |
3519 | # so we need to avoid using that here ... |
3520 | - b1 = bzrdir.BzrDir.create_branch_convenience("repo/branch1", |
3521 | + b1 = controldir.ControlDir.create_branch_convenience("repo/branch1", |
3522 | format=self.from_format) |
3523 | - b2 = bzrdir.BzrDir.create_branch_convenience("repo/branch2", |
3524 | + b2 = controldir.ControlDir.create_branch_convenience("repo/branch2", |
3525 | format=self.from_format) |
3526 | return repo.bzrdir |
3527 | |
3528 | |
3529 | === modified file 'bzrlib/tests/test_upgrade_stacked.py' |
3530 | --- bzrlib/tests/test_upgrade_stacked.py 2011-01-10 22:20:12 +0000 |
3531 | +++ bzrlib/tests/test_upgrade_stacked.py 2012-03-06 18:30:24 +0000 |
3532 | @@ -18,7 +18,7 @@ |
3533 | """Tests for upgrades of various stacking situations.""" |
3534 | |
3535 | from bzrlib import ( |
3536 | - bzrdir, |
3537 | + controldir, |
3538 | check, |
3539 | errors, |
3540 | tests, |
3541 | @@ -71,7 +71,7 @@ |
3542 | self.assertTrue(stacked.open_branch().get_stacked_on_url()) |
3543 | # now we'll upgrade the underlying branch, then upgrade the stacked |
3544 | # branch, and this should still work. |
3545 | - new_format = bzrdir.format_registry.make_bzrdir( |
3546 | + new_format = controldir.format_registry.make_bzrdir( |
3547 | self.scenario_new_format) |
3548 | upgrade('base', new_format) |
3549 | # in some cases you'll get an error if the underlying model has |
3550 | @@ -81,10 +81,10 @@ |
3551 | stacked.open_branch) |
3552 | else: |
3553 | check.check_dwim('stacked', False, True, True) |
3554 | - stacked = bzrdir.BzrDir.open('stacked') |
3555 | + stacked = controldir.ControlDir.open('stacked') |
3556 | # but we can upgrade the stacked repository |
3557 | upgrade('stacked', new_format) |
3558 | # and now it opens ok |
3559 | - stacked = bzrdir.BzrDir.open('stacked') |
3560 | + stacked = controldir.ControlDir.open('stacked') |
3561 | # And passes check. |
3562 | check.check_dwim('stacked', False, True, True) |
3563 | |
3564 | === modified file 'bzrlib/tests/test_url_policy_open.py' |
3565 | --- bzrlib/tests/test_url_policy_open.py 2012-01-19 00:51:24 +0000 |
3566 | +++ bzrlib/tests/test_url_policy_open.py 2012-03-06 18:30:24 +0000 |
3567 | @@ -22,10 +22,12 @@ |
3568 | BranchReferenceFormat, |
3569 | ) |
3570 | from bzrlib.bzrdir import ( |
3571 | - BzrDir, |
3572 | BzrProber, |
3573 | ) |
3574 | -from bzrlib.controldir import ControlDirFormat |
3575 | +from bzrlib.controldir import ( |
3576 | + ControlDir, |
3577 | + ControlDirFormat, |
3578 | + ) |
3579 | from bzrlib.errors import NotBranchError |
3580 | from bzrlib.url_policy_open import ( |
3581 | BadUrl, |
3582 | @@ -182,9 +184,9 @@ |
3583 | self.assertRaises(NotBranchError, opener.open, ".") |
3584 | self.assertEquals(1, len(TrackingProber.seen_urls)) |
3585 | TrackingProber.seen_urls = [] |
3586 | - # And make sure it's registered in such a way that BzrDir.open would |
3587 | + # And make sure it's registered in such a way that ControlDir.open would |
3588 | # use it. |
3589 | - self.assertRaises(NotBranchError, BzrDir.open, ".") |
3590 | + self.assertRaises(NotBranchError, ControlDir.open, ".") |
3591 | self.assertEquals(1, len(TrackingProber.seen_urls)) |
3592 | |
3593 | def test_allowed_url(self): |
3594 | |
3595 | === modified file 'bzrlib/workingtree_4.py' |
3596 | --- bzrlib/workingtree_4.py 2012-02-06 23:38:33 +0000 |
3597 | +++ bzrlib/workingtree_4.py 2012-03-06 18:30:24 +0000 |
3598 | @@ -38,6 +38,7 @@ |
3599 | cache_utf8, |
3600 | config, |
3601 | conflicts as _mod_conflicts, |
3602 | + controldir, |
3603 | debug, |
3604 | dirstate, |
3605 | errors, |
3606 | @@ -1608,7 +1609,7 @@ |
3607 | def _get_matchingbzrdir(self): |
3608 | """Overrideable method to get a bzrdir for testing.""" |
3609 | # please test against something that will let us do tree references |
3610 | - return bzrdir.format_registry.make_bzrdir( |
3611 | + return controldir.format_registry.make_bzrdir( |
3612 | 'development-subtree') |
3613 | |
3614 | _matchingbzrdir = property(__get_matchingbzrdir) |
Note that this is all very simple renames, no changes in the logic.