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