Merge lp:~jelmer/bzr/use-bzr-controldir into lp:bzr

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
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.bzrdir.format_registry.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Note that this is all very simple renames, no changes in the logic.

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
=== modified file 'bzrlib/branch.py'
--- bzrlib/branch.py 2012-02-14 17:22:37 +0000
+++ bzrlib/branch.py 2012-03-06 18:30:24 +0000
@@ -2045,7 +2045,7 @@
20452045
2046 def _initialize_helper(self, a_bzrdir, utf8_files, name=None,2046 def _initialize_helper(self, a_bzrdir, utf8_files, name=None,
2047 repository=None):2047 repository=None):
2048 """Initialize a branch in a bzrdir, with specified files2048 """Initialize a branch in a control dir, with specified files
20492049
2050 :param a_bzrdir: The bzrdir to initialize the branch in2050 :param a_bzrdir: The bzrdir to initialize the branch in
2051 :param utf8_files: The files to create as a list of2051 :param utf8_files: The files to create as a list of
20522052
=== modified file 'bzrlib/builtins.py'
--- bzrlib/builtins.py 2012-03-06 18:11:05 +0000
+++ bzrlib/builtins.py 2012-03-06 18:30:24 +0000
@@ -2053,7 +2053,7 @@
2053 RegistryOption('format',2053 RegistryOption('format',
2054 help='Specify a format for this branch. '2054 help='Specify a format for this branch. '
2055 'See "help formats".',2055 'See "help formats".',
2056 lazy_registry=('bzrlib.bzrdir', 'format_registry'),2056 lazy_registry=('bzrlib.controldir', 'format_registry'),
2057 converter=lambda name: controldir.format_registry.make_bzrdir(name),2057 converter=lambda name: controldir.format_registry.make_bzrdir(name),
2058 value_switches=True,2058 value_switches=True,
2059 title="Branch format",2059 title="Branch format",
20602060
=== modified file 'bzrlib/bzrdir.py'
--- bzrlib/bzrdir.py 2012-01-31 15:43:17 +0000
+++ bzrlib/bzrdir.py 2012-03-06 18:30:24 +0000
@@ -1370,7 +1370,7 @@
1370 :param shared_repo: Control whether made repositories are shared or1370 :param shared_repo: Control whether made repositories are shared or
1371 not.1371 not.
1372 :param vfs_only: If True do not attempt to use a smart server1372 :param vfs_only: If True do not attempt to use a smart server
1373 :return: repo, bzrdir, require_stacking, repository_policy. repo is1373 :return: repo, controldir, require_stacking, repository_policy. repo is
1374 None if none was created or found, bzrdir is always valid.1374 None if none was created or found, bzrdir is always valid.
1375 require_stacking is the result of examining the stacked_on1375 require_stacking is the result of examining the stacked_on
1376 parameter and any stacking policy found for the target.1376 parameter and any stacking policy found for the target.
13771377
=== modified file 'bzrlib/config.py'
--- bzrlib/config.py 2012-02-20 17:38:11 +0000
+++ bzrlib/config.py 2012-03-06 18:30:24 +0000
@@ -2174,8 +2174,8 @@
21742174
2175 It may be set to a location, or None.2175 It may be set to a location, or None.
21762176
2177 This policy affects all branches contained by this bzrdir, except for2177 This policy affects all branches contained by this control dir, except
2178 those under repositories.2178 for those under repositories.
2179 """2179 """
2180 if self._config is None:2180 if self._config is None:
2181 raise errors.BzrError("Cannot set configuration in %s" % self._bzrdir)2181 raise errors.BzrError("Cannot set configuration in %s" % self._bzrdir)
@@ -2189,8 +2189,8 @@
21892189
2190 This will either be a location, or None.2190 This will either be a location, or None.
21912191
2192 This policy affects all branches contained by this bzrdir, except for2192 This policy affects all branches contained by this control dir, except
2193 those under repositories.2193 for those under repositories.
2194 """2194 """
2195 if self._config is None:2195 if self._config is None:
2196 return None2196 return None
21972197
=== modified file 'bzrlib/help_topics/__init__.py'
--- bzrlib/help_topics/__init__.py 2011-12-18 12:46:49 +0000
+++ bzrlib/help_topics/__init__.py 2012-03-06 18:30:24 +0000
@@ -739,13 +739,13 @@
739topic_registry.register('basic', _basic_help, "Basic commands", SECT_HIDDEN)739topic_registry.register('basic', _basic_help, "Basic commands", SECT_HIDDEN)
740topic_registry.register('topics', _help_on_topics, "Topics list", SECT_HIDDEN)740topic_registry.register('topics', _help_on_topics, "Topics list", SECT_HIDDEN)
741def get_current_formats_topic(topic):741def get_current_formats_topic(topic):
742 from bzrlib import bzrdir742 from bzrlib import controldir
743 return "Current Storage Formats\n\n" + \743 return "Current Storage Formats\n\n" + \
744 bzrdir.format_registry.help_topic(topic)744 controldir.format_registry.help_topic(topic)
745def get_other_formats_topic(topic):745def get_other_formats_topic(topic):
746 from bzrlib import bzrdir746 from bzrlib import controldir
747 return "Other Storage Formats\n\n" + \747 return "Other Storage Formats\n\n" + \
748 bzrdir.format_registry.help_topic(topic)748 controldir.format_registry.help_topic(topic)
749topic_registry.register('current-formats', get_current_formats_topic,749topic_registry.register('current-formats', get_current_formats_topic,
750 'Current storage formats')750 'Current storage formats')
751topic_registry.register('other-formats', get_other_formats_topic,751topic_registry.register('other-formats', get_other_formats_topic,
752752
=== modified file 'bzrlib/plugins/launchpad/__init__.py'
--- bzrlib/plugins/launchpad/__init__.py 2012-02-26 15:43:02 +0000
+++ bzrlib/plugins/launchpad/__init__.py 2012-03-06 18:30:24 +0000
@@ -53,8 +53,8 @@
5353
54from bzrlib import (54from bzrlib import (
55 branch as _mod_branch,55 branch as _mod_branch,
56 bzrdir,
57 config as _mod_config,56 config as _mod_config,
57 controldir,
58 lazy_regex,58 lazy_regex,
59 # Since we are a built-in plugin we share the bzrlib version59 # Since we are a built-in plugin we share the bzrlib version
60 version_info,60 version_info,
@@ -353,7 +353,7 @@
353 def run(self, submit_branch=None, review=None, staging=False,353 def run(self, submit_branch=None, review=None, staging=False,
354 message=None, approve=False, fixes=None):354 message=None, approve=False, fixes=None):
355 from bzrlib.plugins.launchpad import lp_propose355 from bzrlib.plugins.launchpad import lp_propose
356 tree, branch, relpath = bzrdir.BzrDir.open_containing_tree_or_branch(356 tree, branch, relpath = controldir.ControlDir.open_containing_tree_or_branch(
357 '.')357 '.')
358 if review is None:358 if review is None:
359 reviews = None359 reviews = None
360360
=== modified file 'bzrlib/plugins/weave_fmt/bzrdir.py'
--- bzrlib/plugins/weave_fmt/bzrdir.py 2012-01-18 19:08:55 +0000
+++ bzrlib/plugins/weave_fmt/bzrdir.py 2012-03-06 18:30:24 +0000
@@ -24,6 +24,7 @@
24 BzrDirMetaFormat1,24 BzrDirMetaFormat1,
25 )25 )
26from bzrlib.controldir import (26from bzrlib.controldir import (
27 ControlDir,
27 Converter,28 Converter,
28 format_registry,29 format_registry,
29 )30 )
@@ -66,7 +67,7 @@
66 create_prefix=False, force_new_repo=False, stacked_on=None,67 create_prefix=False, force_new_repo=False, stacked_on=None,
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,
68 shared_repo=False):69 shared_repo=False):
69 """See BzrDirFormat.initialize_on_transport_ex."""70 """See ControlDir.initialize_on_transport_ex."""
70 require_stacking = (stacked_on is not None)71 require_stacking = (stacked_on is not None)
71 # Format 5 cannot stack, but we've been asked to - actually init72 # Format 5 cannot stack, but we've been asked to - actually init
72 # a Meta1Dir73 # a Meta1Dir
@@ -116,11 +117,11 @@
116 return BzrBranchFormat4()117 return BzrBranchFormat4()
117118
118 def get_format_description(self):119 def get_format_description(self):
119 """See BzrDirFormat.get_format_description()."""120 """See ControlDirFormat.get_format_description()."""
120 return "All-in-one format 5"121 return "All-in-one format 5"
121122
122 def get_converter(self, format=None):123 def get_converter(self, format=None):
123 """See BzrDirFormat.get_converter()."""124 """See ControlDirFormat.get_converter()."""
124 # there is one and only one upgrade path here.125 # there is one and only one upgrade path here.
125 return ConvertBzrDir5To6()126 return ConvertBzrDir5To6()
126127
@@ -176,7 +177,7 @@
176 return "Bazaar-NG branch, format 6\n"177 return "Bazaar-NG branch, format 6\n"
177178
178 def get_format_description(self):179 def get_format_description(self):
179 """See BzrDirFormat.get_format_description()."""180 """See ControlDirFormat.get_format_description()."""
180 return "All-in-one format 6"181 return "All-in-one format 6"
181182
182 def get_branch_format(self):183 def get_branch_format(self):
@@ -184,7 +185,7 @@
184 return BzrBranchFormat4()185 return BzrBranchFormat4()
185186
186 def get_converter(self, format=None):187 def get_converter(self, format=None):
187 """See BzrDirFormat.get_converter()."""188 """See ControlDirFormat.get_converter()."""
188 # there is one and only one upgrade path here.189 # there is one and only one upgrade path here.
189 return ConvertBzrDir6ToMeta()190 return ConvertBzrDir6ToMeta()
190191
@@ -240,7 +241,7 @@
240 if isinstance(self.bzrdir.transport, local.LocalTransport):241 if isinstance(self.bzrdir.transport, local.LocalTransport):
241 self.bzrdir.get_workingtree_transport(None).delete('stat-cache')242 self.bzrdir.get_workingtree_transport(None).delete('stat-cache')
242 self._convert_to_weaves()243 self._convert_to_weaves()
243 return BzrDir.open(self.bzrdir.user_url)244 return ControlDir.open(self.bzrdir.user_url)
244 finally:245 finally:
245 self.pb.finished()246 self.pb.finished()
246247
@@ -505,7 +506,7 @@
505 try:506 try:
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'))
507 self._convert_to_prefixed()508 self._convert_to_prefixed()
508 return BzrDir.open(self.bzrdir.user_url)509 return ControlDir.open(self.bzrdir.user_url)
509 finally:510 finally:
510 pb.finished()511 pb.finished()
511512
@@ -633,7 +634,7 @@
633 BzrDirMetaFormat1().get_format_string(),634 BzrDirMetaFormat1().get_format_string(),
634 mode=self.file_mode)635 mode=self.file_mode)
635 self.pb.finished()636 self.pb.finished()
636 return BzrDir.open(self.bzrdir.user_url)637 return ControlDir.open(self.bzrdir.user_url)
637638
638 def make_lock(self, name):639 def make_lock(self, name):
639 """Make a lock for the new control dir name."""640 """Make a lock for the new control dir name."""
@@ -685,11 +686,11 @@
685 return "Bazaar-NG branch, format 0.0.4\n"686 return "Bazaar-NG branch, format 0.0.4\n"
686687
687 def get_format_description(self):688 def get_format_description(self):
688 """See BzrDirFormat.get_format_description()."""689 """See ControlDirFormat.get_format_description()."""
689 return "All-in-one format 4"690 return "All-in-one format 4"
690691
691 def get_converter(self, format=None):692 def get_converter(self, format=None):
692 """See BzrDirFormat.get_converter()."""693 """See ControlDirFormat.get_converter()."""
693 # there is one and only one upgrade path here.694 # there is one and only one upgrade path here.
694 return ConvertBzrDir4To5()695 return ConvertBzrDir4To5()
695696
@@ -730,7 +731,7 @@
730 """A common class for the all-in-one formats."""731 """A common class for the all-in-one formats."""
731732
732 def __init__(self, _transport, _format):733 def __init__(self, _transport, _format):
733 """See BzrDir.__init__."""734 """See ControlDir.__init__."""
734 super(BzrDirPreSplitOut, self).__init__(_transport, _format)735 super(BzrDirPreSplitOut, self).__init__(_transport, _format)
735 self._control_files = lockable_files.LockableFiles(736 self._control_files = lockable_files.LockableFiles(
736 self.get_branch_transport(None),737 self.get_branch_transport(None),
@@ -749,7 +750,7 @@
749750
750 def clone(self, url, revision_id=None, force_new_repo=False,751 def clone(self, url, revision_id=None, force_new_repo=False,
751 preserve_stacking=False):752 preserve_stacking=False):
752 """See BzrDir.clone().753 """See ControlDir.clone().
753754
754 force_new_repo has no effect, since this family of formats always755 force_new_repo has no effect, since this family of formats always
755 require a new repository.756 require a new repository.
@@ -772,7 +773,7 @@
772773
773 def create_branch(self, name=None, repository=None,774 def create_branch(self, name=None, repository=None,
774 append_revisions_only=None):775 append_revisions_only=None):
775 """See BzrDir.create_branch."""776 """See ControlDir.create_branch."""
776 if repository is not None:777 if repository is not None:
777 raise NotImplementedError(778 raise NotImplementedError(
778 "create_branch(repository=<not None>) on %r" % (self,))779 "create_branch(repository=<not None>) on %r" % (self,))
@@ -780,22 +781,22 @@
780 append_revisions_only=append_revisions_only)781 append_revisions_only=append_revisions_only)
781782
782 def destroy_branch(self, name=None):783 def destroy_branch(self, name=None):
783 """See BzrDir.destroy_branch."""784 """See ControlDir.destroy_branch."""
784 raise errors.UnsupportedOperation(self.destroy_branch, self)785 raise errors.UnsupportedOperation(self.destroy_branch, self)
785786
786 def create_repository(self, shared=False):787 def create_repository(self, shared=False):
787 """See BzrDir.create_repository."""788 """See ControlDir.create_repository."""
788 if shared:789 if shared:
789 raise errors.IncompatibleFormat('shared repository', self._format)790 raise errors.IncompatibleFormat('shared repository', self._format)
790 return self.open_repository()791 return self.open_repository()
791792
792 def destroy_repository(self):793 def destroy_repository(self):
793 """See BzrDir.destroy_repository."""794 """See ControlDir.destroy_repository."""
794 raise errors.UnsupportedOperation(self.destroy_repository, self)795 raise errors.UnsupportedOperation(self.destroy_repository, self)
795796
796 def create_workingtree(self, revision_id=None, from_branch=None,797 def create_workingtree(self, revision_id=None, from_branch=None,
797 accelerator_tree=None, hardlink=False):798 accelerator_tree=None, hardlink=False):
798 """See BzrDir.create_workingtree."""799 """See ControlDir.create_workingtree."""
799 # The workingtree is sometimes created when the bzrdir is created,800 # The workingtree is sometimes created when the bzrdir is created,
800 # but not when cloning.801 # but not when cloning.
801802
@@ -833,11 +834,11 @@
833 self.transport, self._control_files._file_mode)834 self.transport, self._control_files._file_mode)
834835
835 def destroy_workingtree(self):836 def destroy_workingtree(self):
836 """See BzrDir.destroy_workingtree."""837 """See ControlDir.destroy_workingtree."""
837 raise errors.UnsupportedOperation(self.destroy_workingtree, self)838 raise errors.UnsupportedOperation(self.destroy_workingtree, self)
838839
839 def destroy_workingtree_metadata(self):840 def destroy_workingtree_metadata(self):
840 """See BzrDir.destroy_workingtree_metadata."""841 """See ControlDir.destroy_workingtree_metadata."""
841 raise errors.UnsupportedOperation(self.destroy_workingtree_metadata,842 raise errors.UnsupportedOperation(self.destroy_workingtree_metadata,
842 self)843 self)
843844
@@ -874,7 +875,7 @@
874 raise errors.IncompatibleFormat(workingtree_format, self._format)875 raise errors.IncompatibleFormat(workingtree_format, self._format)
875876
876 def needs_format_conversion(self, format=None):877 def needs_format_conversion(self, format=None):
877 """See BzrDir.needs_format_conversion()."""878 """See ControlDir.needs_format_conversion()."""
878 # if the format is not the same as the system default,879 # if the format is not the same as the system default,
879 # an upgrade is needed.880 # an upgrade is needed.
880 if format is None:881 if format is None:
@@ -885,7 +886,7 @@
885886
886 def open_branch(self, name=None, unsupported=False,887 def open_branch(self, name=None, unsupported=False,
887 ignore_fallbacks=False, possible_transports=None):888 ignore_fallbacks=False, possible_transports=None):
888 """See BzrDir.open_branch."""889 """See ControlDir.open_branch."""
889 from bzrlib.plugins.weave_fmt.branch import BzrBranchFormat4890 from bzrlib.plugins.weave_fmt.branch import BzrBranchFormat4
890 format = BzrBranchFormat4()891 format = BzrBranchFormat4()
891 format.check_support_status(unsupported)892 format.check_support_status(unsupported)
@@ -896,7 +897,7 @@
896 possible_transports=None, accelerator_tree=None,897 possible_transports=None, accelerator_tree=None,
897 hardlink=False, stacked=False, create_tree_if_local=True,898 hardlink=False, stacked=False, create_tree_if_local=True,
898 source_branch=None):899 source_branch=None):
899 """See BzrDir.sprout()."""900 """See ControlDir.sprout()."""
900 if source_branch is not None:901 if source_branch is not None:
901 my_branch = self.open_branch()902 my_branch = self.open_branch()
902 if source_branch.base != my_branch.base:903 if source_branch.base != my_branch.base:
@@ -941,7 +942,7 @@
941 """942 """
942943
943 def create_repository(self, shared=False):944 def create_repository(self, shared=False):
944 """See BzrDir.create_repository."""945 """See ControlDir.create_repository."""
945 return self._format.repository_format.initialize(self, shared)946 return self._format.repository_format.initialize(self, shared)
946947
947 def needs_format_conversion(self, format=None):948 def needs_format_conversion(self, format=None):
@@ -952,7 +953,7 @@
952 return True953 return True
953954
954 def open_repository(self):955 def open_repository(self):
955 """See BzrDir.open_repository."""956 """See ControlDir.open_repository."""
956 from bzrlib.plugins.weave_fmt.repository import RepositoryFormat4957 from bzrlib.plugins.weave_fmt.repository import RepositoryFormat4
957 return RepositoryFormat4().open(self, _found=True)958 return RepositoryFormat4().open(self, _found=True)
958959
@@ -964,17 +965,17 @@
964 """965 """
965966
966 def has_workingtree(self):967 def has_workingtree(self):
967 """See BzrDir.has_workingtree."""968 """See ControlDir.has_workingtree."""
968 return True969 return True
969 970
970 def open_repository(self):971 def open_repository(self):
971 """See BzrDir.open_repository."""972 """See ControlDir.open_repository."""
972 from bzrlib.plugins.weave_fmt.repository import RepositoryFormat5973 from bzrlib.plugins.weave_fmt.repository import RepositoryFormat5
973 return RepositoryFormat5().open(self, _found=True)974 return RepositoryFormat5().open(self, _found=True)
974975
975 def open_workingtree(self, unsupported=False,976 def open_workingtree(self, unsupported=False,
976 recommend_upgrade=True):977 recommend_upgrade=True):
977 """See BzrDir.create_workingtree."""978 """See ControlDir.create_workingtree."""
978 from bzrlib.plugins.weave_fmt.workingtree import WorkingTreeFormat2979 from bzrlib.plugins.weave_fmt.workingtree import WorkingTreeFormat2
979 wt_format = WorkingTreeFormat2()980 wt_format = WorkingTreeFormat2()
980 # we don't warn here about upgrades; that ought to be handled for the981 # we don't warn here about upgrades; that ought to be handled for the
@@ -989,16 +990,16 @@
989 """990 """
990991
991 def has_workingtree(self):992 def has_workingtree(self):
992 """See BzrDir.has_workingtree."""993 """See ControlDir.has_workingtree."""
993 return True994 return True
994995
995 def open_repository(self):996 def open_repository(self):
996 """See BzrDir.open_repository."""997 """See ControlDir.open_repository."""
997 from bzrlib.plugins.weave_fmt.repository import RepositoryFormat6998 from bzrlib.plugins.weave_fmt.repository import RepositoryFormat6
998 return RepositoryFormat6().open(self, _found=True)999 return RepositoryFormat6().open(self, _found=True)
9991000
1000 def open_workingtree(self, unsupported=False, recommend_upgrade=True):1001 def open_workingtree(self, unsupported=False, recommend_upgrade=True):
1001 """See BzrDir.create_workingtree."""1002 """See ControlDir.create_workingtree."""
1002 # we don't warn here about upgrades; that ought to be handled for the1003 # we don't warn here about upgrades; that ought to be handled for the
1003 # bzrdir as a whole1004 # bzrdir as a whole
1004 from bzrlib.plugins.weave_fmt.workingtree import WorkingTreeFormat21005 from bzrlib.plugins.weave_fmt.workingtree import WorkingTreeFormat2
10051006
=== modified file 'bzrlib/plugins/weave_fmt/test_bzrdir.py'
--- bzrlib/plugins/weave_fmt/test_bzrdir.py 2011-12-19 13:23:58 +0000
+++ bzrlib/plugins/weave_fmt/test_bzrdir.py 2012-03-06 18:30:24 +0000
@@ -27,6 +27,7 @@
27from bzrlib import (27from bzrlib import (
28 branch,28 branch,
29 bzrdir,29 bzrdir,
30 controldir,
30 errors,31 errors,
31 repository,32 repository,
32 upgrade,33 upgrade,
@@ -66,7 +67,7 @@
66 self.assertTrue(ctrl_2 is ctrl_3)67 self.assertTrue(ctrl_2 is ctrl_3)
67 check_dir_components_use_same_lock(dir)68 check_dir_components_use_same_lock(dir)
68 # and if we open it normally.69 # and if we open it normally.
69 dir = bzrdir.BzrDir.open(self.get_url())70 dir = controldir.ControlDir.open(self.get_url())
70 check_dir_components_use_same_lock(dir)71 check_dir_components_use_same_lock(dir)
7172
72 def test_can_convert(self):73 def test_can_convert(self):
@@ -100,7 +101,7 @@
100 self.assertTrue(ctrl_2 is ctrl_3)101 self.assertTrue(ctrl_2 is ctrl_3)
101 check_dir_components_use_same_lock(dir)102 check_dir_components_use_same_lock(dir)
102 # and if we open it normally.103 # and if we open it normally.
103 dir = bzrdir.BzrDir.open(self.get_url())104 dir = controldir.ControlDir.open(self.get_url())
104 check_dir_components_use_same_lock(dir)105 check_dir_components_use_same_lock(dir)
105106
106 def test_can_convert(self):107 def test_can_convert(self):
@@ -302,7 +303,7 @@
302 # At this point, we have a format6 branch without checkout files.303 # At this point, we have a format6 branch without checkout files.
303 upgrade.upgrade('.', bzrdir.BzrDirMetaFormat1())304 upgrade.upgrade('.', bzrdir.BzrDirMetaFormat1())
304 # The upgrade should not have set up a working tree.305 # The upgrade should not have set up a working tree.
305 control = bzrdir.BzrDir.open('.')306 control = controldir.ControlDir.open('.')
306 self.assertFalse(control.has_workingtree())307 self.assertFalse(control.has_workingtree())
307 # We have covered the scope of this test, we may as well check that308 # We have covered the scope of this test, we may as well check that
308 # upgrade has not eaten our data, even if it's a bit redundant with309 # upgrade has not eaten our data, even if it's a bit redundant with
@@ -319,7 +320,7 @@
319 eq = self.assertEquals320 eq = self.assertEquals
320 self.build_tree_contents(_upgrade1_template)321 self.build_tree_contents(_upgrade1_template)
321 upgrade.upgrade(u'.')322 upgrade.upgrade(u'.')
322 control = bzrdir.BzrDir.open('.')323 control = controldir.ControlDir.open('.')
323 b = control.open_branch()324 b = control.open_branch()
324 # tsk, peeking under the covers.325 # tsk, peeking under the covers.
325 self.assertIsInstance(326 self.assertIsInstance(
@@ -389,7 +390,7 @@
389390
390 def test_upgrade_makes_dir_weaves(self):391 def test_upgrade_makes_dir_weaves(self):
391 self.build_tree_contents(_upgrade_dir_template)392 self.build_tree_contents(_upgrade_dir_template)
392 old_repodir = bzrdir.BzrDir.open_unsupported('.')393 old_repodir = controldir.ControlDir.open_unsupported('.')
393 old_repo_format = old_repodir.open_repository()._format394 old_repo_format = old_repodir.open_repository()._format
394 upgrade.upgrade('.')395 upgrade.upgrade('.')
395 # this is the path to the literal file. As format changes396 # this is the path to the literal file. As format changes
@@ -544,7 +545,7 @@
544 self.build_tree(['master/', 'child/'])545 self.build_tree(['master/', 'child/'])
545 self.make_branch_and_tree('master')546 self.make_branch_and_tree('master')
546 self.make_branch_and_tree('child',547 self.make_branch_and_tree('child',
547 format=bzrdir.format_registry.make_bzrdir('weave'))548 format=controldir.format_registry.make_bzrdir('weave'))
548 os.chdir('child')549 os.chdir('child')
549550
550 def test_bind_format_6_bzrdir(self):551 def test_bind_format_6_bzrdir(self):
551552
=== modified file 'bzrlib/remote.py'
--- bzrlib/remote.py 2012-02-14 17:22:37 +0000
+++ bzrlib/remote.py 2012-03-06 18:30:24 +0000
@@ -1051,7 +1051,7 @@
1051 network_name = self._network_name1051 network_name = self._network_name
1052 else:1052 else:
1053 # Select the current bzrlib default and ask for that.1053 # Select the current bzrlib default and ask for that.
1054 reference_bzrdir_format = _mod_bzrdir.format_registry.get('default')()1054 reference_bzrdir_format = controldir.format_registry.get('default')()
1055 reference_format = reference_bzrdir_format.repository_format1055 reference_format = reference_bzrdir_format.repository_format
1056 network_name = reference_format.network_name()1056 network_name = reference_format.network_name()
1057 # 2) try direct creation via RPC1057 # 2) try direct creation via RPC
@@ -3157,7 +3157,7 @@
3157 network_name = self._custom_format.network_name()3157 network_name = self._custom_format.network_name()
3158 else:3158 else:
3159 # Select the current bzrlib default and ask for that.3159 # Select the current bzrlib default and ask for that.
3160 reference_bzrdir_format = _mod_bzrdir.format_registry.get('default')()3160 reference_bzrdir_format = controldir.format_registry.get('default')()
3161 reference_format = reference_bzrdir_format.get_branch_format()3161 reference_format = reference_bzrdir_format.get_branch_format()
3162 self._custom_format = reference_format3162 self._custom_format = reference_format
3163 network_name = reference_format.network_name()3163 network_name = reference_format.network_name()
31643164
=== modified file 'bzrlib/repofmt/groupcompress_repo.py'
--- bzrlib/repofmt/groupcompress_repo.py 2012-01-24 00:16:15 +0000
+++ bzrlib/repofmt/groupcompress_repo.py 2012-03-06 18:30:24 +0000
@@ -21,7 +21,7 @@
21import time21import time
2222
23from bzrlib import (23from bzrlib import (
24 bzrdir,24 controldir,
25 chk_map,25 chk_map,
26 chk_serializer,26 chk_serializer,
27 debug,27 debug,
@@ -1383,7 +1383,7 @@
1383 pack_compresses = True1383 pack_compresses = True
13841384
1385 def _get_matching_bzrdir(self):1385 def _get_matching_bzrdir(self):
1386 return bzrdir.format_registry.make_bzrdir('2a')1386 return controldir.format_registry.make_bzrdir('2a')
13871387
1388 def _ignore_setting_bzrdir(self, format):1388 def _ignore_setting_bzrdir(self, format):
1389 pass1389 pass
@@ -1406,7 +1406,7 @@
1406 """1406 """
14071407
1408 def _get_matching_bzrdir(self):1408 def _get_matching_bzrdir(self):
1409 return bzrdir.format_registry.make_bzrdir('development-subtree')1409 return controldir.format_registry.make_bzrdir('development-subtree')
14101410
1411 def _ignore_setting_bzrdir(self, format):1411 def _ignore_setting_bzrdir(self, format):
1412 pass1412 pass
14131413
=== modified file 'bzrlib/repofmt/knitpack_repo.py'
--- bzrlib/repofmt/knitpack_repo.py 2011-12-19 19:15:58 +0000
+++ bzrlib/repofmt/knitpack_repo.py 2012-03-06 18:30:24 +0000
@@ -24,7 +24,7 @@
24import time24import time
2525
26from bzrlib import (26from bzrlib import (
27 bzrdir,27 controldir,
28 debug,28 debug,
29 errors,29 errors,
30 knit,30 knit,
@@ -155,7 +155,7 @@
155 index_class = GraphIndex155 index_class = GraphIndex
156156
157 def _get_matching_bzrdir(self):157 def _get_matching_bzrdir(self):
158 return bzrdir.format_registry.make_bzrdir('pack-0.92')158 return controldir.format_registry.make_bzrdir('pack-0.92')
159159
160 def _ignore_setting_bzrdir(self, format):160 def _ignore_setting_bzrdir(self, format):
161 pass161 pass
@@ -195,7 +195,7 @@
195 index_class = GraphIndex195 index_class = GraphIndex
196196
197 def _get_matching_bzrdir(self):197 def _get_matching_bzrdir(self):
198 return bzrdir.format_registry.make_bzrdir(198 return controldir.format_registry.make_bzrdir(
199 'pack-0.92-subtree')199 'pack-0.92-subtree')
200200
201 def _ignore_setting_bzrdir(self, format):201 def _ignore_setting_bzrdir(self, format):
@@ -234,7 +234,7 @@
234 index_class = GraphIndex234 index_class = GraphIndex
235235
236 def _get_matching_bzrdir(self):236 def _get_matching_bzrdir(self):
237 return bzrdir.format_registry.make_bzrdir(237 return controldir.format_registry.make_bzrdir(
238 'rich-root-pack')238 'rich-root-pack')
239239
240 def _ignore_setting_bzrdir(self, format):240 def _ignore_setting_bzrdir(self, format):
@@ -274,7 +274,7 @@
274 return xml5.serializer_v5274 return xml5.serializer_v5
275275
276 def _get_matching_bzrdir(self):276 def _get_matching_bzrdir(self):
277 return bzrdir.format_registry.make_bzrdir('1.6')277 return controldir.format_registry.make_bzrdir('1.6')
278278
279 def _ignore_setting_bzrdir(self, format):279 def _ignore_setting_bzrdir(self, format):
280 pass280 pass
@@ -314,7 +314,7 @@
314 return xml6.serializer_v6314 return xml6.serializer_v6
315315
316 def _get_matching_bzrdir(self):316 def _get_matching_bzrdir(self):
317 return bzrdir.format_registry.make_bzrdir(317 return controldir.format_registry.make_bzrdir(
318 '1.6.1-rich-root')318 '1.6.1-rich-root')
319319
320 def _ignore_setting_bzrdir(self, format):320 def _ignore_setting_bzrdir(self, format):
@@ -359,7 +359,7 @@
359 return xml7.serializer_v7359 return xml7.serializer_v7
360360
361 def _get_matching_bzrdir(self):361 def _get_matching_bzrdir(self):
362 matching = bzrdir.format_registry.make_bzrdir(362 matching = controldir.format_registry.make_bzrdir(
363 '1.6.1-rich-root')363 '1.6.1-rich-root')
364 matching.repository_format = self364 matching.repository_format = self
365 return matching365 return matching
@@ -401,7 +401,7 @@
401 return xml5.serializer_v5401 return xml5.serializer_v5
402402
403 def _get_matching_bzrdir(self):403 def _get_matching_bzrdir(self):
404 return bzrdir.format_registry.make_bzrdir('1.9')404 return controldir.format_registry.make_bzrdir('1.9')
405405
406 def _ignore_setting_bzrdir(self, format):406 def _ignore_setting_bzrdir(self, format):
407 pass407 pass
@@ -438,7 +438,7 @@
438 return xml6.serializer_v6438 return xml6.serializer_v6
439439
440 def _get_matching_bzrdir(self):440 def _get_matching_bzrdir(self):
441 return bzrdir.format_registry.make_bzrdir(441 return controldir.format_registry.make_bzrdir(
442 '1.9-rich-root')442 '1.9-rich-root')
443443
444 def _ignore_setting_bzrdir(self, format):444 def _ignore_setting_bzrdir(self, format):
@@ -479,7 +479,7 @@
479 return xml7.serializer_v7479 return xml7.serializer_v7
480480
481 def _get_matching_bzrdir(self):481 def _get_matching_bzrdir(self):
482 return bzrdir.format_registry.make_bzrdir(482 return controldir.format_registry.make_bzrdir(
483 'development5-subtree')483 'development5-subtree')
484484
485 def _ignore_setting_bzrdir(self, format):485 def _ignore_setting_bzrdir(self, format):
486486
=== modified file 'bzrlib/repofmt/knitrepo.py'
--- bzrlib/repofmt/knitrepo.py 2011-12-19 19:15:58 +0000
+++ bzrlib/repofmt/knitrepo.py 2012-03-06 18:30:24 +0000
@@ -21,7 +21,7 @@
21import itertools21import itertools
2222
23from bzrlib import (23from bzrlib import (
24 bzrdir,24 controldir,
25 errors,25 errors,
26 knit as _mod_knit,26 knit as _mod_knit,
27 lockable_files,27 lockable_files,
@@ -405,7 +405,7 @@
405 return xml7.serializer_v7405 return xml7.serializer_v7
406406
407 def _get_matching_bzrdir(self):407 def _get_matching_bzrdir(self):
408 return bzrdir.format_registry.make_bzrdir('dirstate-with-subtree')408 return controldir.format_registry.make_bzrdir('dirstate-with-subtree')
409409
410 def _ignore_setting_bzrdir(self, format):410 def _ignore_setting_bzrdir(self, format):
411 pass411 pass
@@ -447,7 +447,7 @@
447 return xml6.serializer_v6447 return xml6.serializer_v6
448448
449 def _get_matching_bzrdir(self):449 def _get_matching_bzrdir(self):
450 return bzrdir.format_registry.make_bzrdir('rich-root')450 return controldir.format_registry.make_bzrdir('rich-root')
451451
452 def _ignore_setting_bzrdir(self, format):452 def _ignore_setting_bzrdir(self, format):
453 pass453 pass
454454
=== modified file 'bzrlib/smart/request.py'
--- bzrlib/smart/request.py 2012-01-06 22:06:36 +0000
+++ bzrlib/smart/request.py 2012-03-06 18:30:24 +0000
@@ -36,7 +36,6 @@
36import threading36import threading
3737
38from bzrlib import (38from bzrlib import (
39 bzrdir,
40 debug,39 debug,
41 errors,40 errors,
42 osutils,41 osutils,
@@ -47,6 +46,7 @@
47 )46 )
48from bzrlib.lazy_import import lazy_import47from bzrlib.lazy_import import lazy_import
49lazy_import(globals(), """48lazy_import(globals(), """
49from bzrlib import bzrdir
50from bzrlib.bundle import serializer50from bzrlib.bundle import serializer
5151
52import tempfile52import tempfile
5353
=== modified file 'bzrlib/tests/__init__.py'
--- bzrlib/tests/__init__.py 2012-02-18 16:55:04 +0000
+++ bzrlib/tests/__init__.py 2012-03-06 18:30:24 +0000
@@ -60,7 +60,7 @@
60import bzrlib60import bzrlib
61from bzrlib import (61from bzrlib import (
62 branchbuilder,62 branchbuilder,
63 bzrdir,63 controldir,
64 chk_map,64 chk_map,
65 commands as _mod_commands,65 commands as _mod_commands,
66 config,66 config,
@@ -1328,7 +1328,7 @@
1328 # hook into bzr dir opening. This leaves a small window of error for1328 # hook into bzr dir opening. This leaves a small window of error for
1329 # transport tests, but they are well known, and we can improve on this1329 # transport tests, but they are well known, and we can improve on this
1330 # step.1330 # step.
1331 bzrdir.BzrDir.hooks.install_named_hook("pre_open",1331 controldir.ControlDir.hooks.install_named_hook("pre_open",
1332 self._preopen_isolate_transport, "Check bzr directories are safe.")1332 self._preopen_isolate_transport, "Check bzr directories are safe.")
13331333
1334 def _ndiff_strings(self, a, b):1334 def _ndiff_strings(self, a, b):
@@ -2603,7 +2603,7 @@
2603 # http://pad.lv/825027).2603 # http://pad.lv/825027).
2604 self.assertIs(None, os.environ.get('BZR_HOME', None))2604 self.assertIs(None, os.environ.get('BZR_HOME', None))
2605 os.environ['BZR_HOME'] = root2605 os.environ['BZR_HOME'] = root
2606 wt = bzrdir.BzrDir.create_standalone_workingtree(root)2606 wt = controldir.ControlDir.create_standalone_workingtree(root)
2607 del os.environ['BZR_HOME']2607 del os.environ['BZR_HOME']
2608 # Hack for speed: remember the raw bytes of the dirstate file so that2608 # Hack for speed: remember the raw bytes of the dirstate file so that
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.
@@ -2680,7 +2680,7 @@
2680 if format is None:2680 if format is None:
2681 format = self.get_default_format()2681 format = self.get_default_format()
2682 if isinstance(format, basestring):2682 if isinstance(format, basestring):
2683 format = bzrdir.format_registry.make_bzrdir(format)2683 format = controldir.format_registry.make_bzrdir(format)
2684 return format2684 return format
26852685
2686 def make_bzrdir(self, relpath, format=None):2686 def make_bzrdir(self, relpath, format=None):
@@ -2854,7 +2854,7 @@
2854 # stacking policy to honour; create a bzr dir with an unshared2854 # stacking policy to honour; create a bzr dir with an unshared
2855 # repository (but not a branch - our code would be trying to escape2855 # repository (but not a branch - our code would be trying to escape
2856 # then!) to stop them, and permit it to be read.2856 # then!) to stop them, and permit it to be read.
2857 # control = bzrdir.BzrDir.create(self.test_base_dir)2857 # control = controldir.ControlDir.create(self.test_base_dir)
2858 # control.create_repository()2858 # control.create_repository()
2859 self.test_home_dir = self.test_base_dir + '/home'2859 self.test_home_dir = self.test_base_dir + '/home'
2860 os.mkdir(self.test_home_dir)2860 os.mkdir(self.test_home_dir)
@@ -3000,7 +3000,8 @@
3000 if self.vfs_transport_factory is test_server.LocalURLServer:3000 if self.vfs_transport_factory is test_server.LocalURLServer:
3001 # the branch is colocated on disk, we cannot create a checkout.3001 # the branch is colocated on disk, we cannot create a checkout.
3002 # hopefully callers will expect this.3002 # hopefully callers will expect this.
3003 local_controldir= bzrdir.BzrDir.open(self.get_vfs_only_url(relpath))3003 local_controldir = controldir.ControlDir.open(
3004 self.get_vfs_only_url(relpath))
3004 wt = local_controldir.create_workingtree()3005 wt = local_controldir.create_workingtree()
3005 if wt.branch._format != b._format:3006 if wt.branch._format != b._format:
3006 wt._branch = b3007 wt._branch = b
30073008
=== modified file 'bzrlib/tests/blackbox/test_bound_branches.py'
--- bzrlib/tests/blackbox/test_bound_branches.py 2012-01-18 14:09:19 +0000
+++ bzrlib/tests/blackbox/test_bound_branches.py 2012-03-06 18:30:24 +0000
@@ -19,7 +19,7 @@
1919
20from bzrlib import (20from bzrlib import (
21 branch,21 branch,
22 bzrdir,22 controldir,
23 errors,23 errors,
24 tests,24 tests,
25 )25 )
@@ -35,19 +35,18 @@
35 base_tree.add(['a', 'b'])35 base_tree.add(['a', 'b'])
36 base_tree.commit('init')36 base_tree.commit('init')
37 base_tree.unlock()37 base_tree.unlock()
38 branch = base_tree.branch
3938
40 child_tree = branch.create_checkout('child')39 child_tree = base_tree.branch.create_checkout('child')
4140
42 self.check_revno(1, 'child')41 self.check_revno(1, 'child')
43 d = bzrdir.BzrDir.open('child')42 d = controldir.ControlDir.open('child')
44 self.assertNotEqual(None, d.open_branch().get_master_branch())43 self.assertNotEqual(None, d.open_branch().get_master_branch())
4544
46 return base_tree, child_tree45 return base_tree, child_tree
4746
48 def check_revno(self, val, loc='.'):47 def check_revno(self, val, loc='.'):
49 self.assertEqual(48 self.assertEqual(
50 val, bzrdir.BzrDir.open(loc).open_branch().last_revision_info()[0])49 val, controldir.ControlDir.open(loc).open_branch().last_revision_info()[0])
5150
52 def test_simple_binding(self):51 def test_simple_binding(self):
53 tree = self.make_branch_and_tree('base')52 tree = self.make_branch_and_tree('base')
@@ -59,7 +58,7 @@
5958
60 self.run_bzr('bind ../base', working_dir='child')59 self.run_bzr('bind ../base', working_dir='child')
6160
62 d = bzrdir.BzrDir.open('child')61 d = controldir.ControlDir.open('child')
63 self.assertNotEqual(None, d.open_branch().get_master_branch())62 self.assertNotEqual(None, d.open_branch().get_master_branch())
6463
65 self.run_bzr('unbind', working_dir='child')64 self.run_bzr('unbind', working_dir='child')
@@ -133,7 +132,7 @@
133 self.run_bzr('bind ../child', working_dir='child2')132 self.run_bzr('bind ../child', working_dir='child2')
134133
135 # Refresh the child tree object as 'unbind' modified it134 # Refresh the child tree object as 'unbind' modified it
136 child2_tree = bzrdir.BzrDir.open('child2').open_workingtree()135 child2_tree = controldir.ControlDir.open('child2').open_workingtree()
137 self.assertRaises(errors.CommitToDoubleBoundBranch,136 self.assertRaises(errors.CommitToDoubleBoundBranch,
138 child2_tree.commit, message='child2', allow_pointless=True)137 child2_tree.commit, message='child2', allow_pointless=True)
139138
@@ -356,7 +355,7 @@
356 branch = tree.branch355 branch = tree.branch
357 tree.bzrdir.sprout('child')356 tree.bzrdir.sprout('child')
358 self.run_bzr('bind --directory=child base')357 self.run_bzr('bind --directory=child base')
359 d = bzrdir.BzrDir.open('child')358 d = controldir.ControlDir.open('child')
360 self.assertNotEqual(None, d.open_branch().get_master_branch())359 self.assertNotEqual(None, d.open_branch().get_master_branch())
361 self.run_bzr('unbind -d child')360 self.run_bzr('unbind -d child')
362 self.assertEqual(None, d.open_branch().get_master_branch())361 self.assertEqual(None, d.open_branch().get_master_branch())
363362
=== modified file 'bzrlib/tests/blackbox/test_branch.py'
--- bzrlib/tests/blackbox/test_branch.py 2012-02-14 17:22:37 +0000
+++ bzrlib/tests/blackbox/test_branch.py 2012-03-06 18:30:24 +0000
@@ -363,12 +363,12 @@
363363
364 def assertRevisionInRepository(self, repo_path, revid):364 def assertRevisionInRepository(self, repo_path, revid):
365 """Check that a revision is in a repo, disregarding stacking."""365 """Check that a revision is in a repo, disregarding stacking."""
366 repo = bzrdir.BzrDir.open(repo_path).open_repository()366 repo = controldir.ControlDir.open(repo_path).open_repository()
367 self.assertTrue(repo.has_revision(revid))367 self.assertTrue(repo.has_revision(revid))
368368
369 def assertRevisionNotInRepository(self, repo_path, revid):369 def assertRevisionNotInRepository(self, repo_path, revid):
370 """Check that a revision is not in a repo, disregarding stacking."""370 """Check that a revision is not in a repo, disregarding stacking."""
371 repo = bzrdir.BzrDir.open(repo_path).open_repository()371 repo = controldir.ControlDir.open(repo_path).open_repository()
372 self.assertFalse(repo.has_revision(revid))372 self.assertFalse(repo.has_revision(revid))
373373
374 def assertRevisionsInBranchRepository(self, revid_list, branch_path):374 def assertRevisionsInBranchRepository(self, revid_list, branch_path):
@@ -400,7 +400,7 @@
400 # capable of supporting stacking, but not actually have a stacked_on400 # capable of supporting stacking, but not actually have a stacked_on
401 # branch configured401 # branch configured
402 self.assertRaises(errors.NotStacked,402 self.assertRaises(errors.NotStacked,
403 bzrdir.BzrDir.open('newbranch').open_branch().get_stacked_on_url)403 controldir.ControlDir.open('newbranch').open_branch().get_stacked_on_url)
404404
405 def test_branch_stacked_branch_stacked(self):405 def test_branch_stacked_branch_stacked(self):
406 """Asking to stack on a stacked branch does work"""406 """Asking to stack on a stacked branch does work"""
407407
=== modified file 'bzrlib/tests/blackbox/test_break_lock.py'
--- bzrlib/tests/blackbox/test_break_lock.py 2012-01-18 17:47:06 +0000
+++ bzrlib/tests/blackbox/test_break_lock.py 2012-03-06 18:30:24 +0000
@@ -18,8 +18,8 @@
1818
19from bzrlib import (19from bzrlib import (
20 branch,20 branch,
21 bzrdir,
22 config,21 config,
22 controldir,
23 errors,23 errors,
24 osutils,24 osutils,
25 tests,25 tests,
@@ -54,13 +54,13 @@
54 'repo/',54 'repo/',
55 'repo/branch/',55 'repo/branch/',
56 'checkout/'])56 'checkout/'])
57 bzrdir.BzrDir.create('master-repo').create_repository()57 controldir.ControlDir.create('master-repo').create_repository()
58 self.master_branch = bzrdir.BzrDir.create_branch_convenience(58 self.master_branch = controldir.ControlDir.create_branch_convenience(
59 'master-repo/master-branch')59 'master-repo/master-branch')
60 bzrdir.BzrDir.create('repo').create_repository()60 controldir.ControlDir.create('repo').create_repository()
61 local_branch = bzrdir.BzrDir.create_branch_convenience('repo/branch')61 local_branch = controldir.ControlDir.create_branch_convenience('repo/branch')
62 local_branch.bind(self.master_branch)62 local_branch.bind(self.master_branch)
63 checkoutdir = bzrdir.BzrDir.create('checkout')63 checkoutdir = controldir.ControlDir.create('checkout')
64 checkoutdir.set_branch_reference(local_branch)64 checkoutdir.set_branch_reference(local_branch)
65 self.wt = checkoutdir.create_workingtree()65 self.wt = checkoutdir.create_workingtree()
6666
6767
=== modified file 'bzrlib/tests/blackbox/test_checkout.py'
--- bzrlib/tests/blackbox/test_checkout.py 2012-02-14 17:22:37 +0000
+++ bzrlib/tests/blackbox/test_checkout.py 2012-03-06 18:30:24 +0000
@@ -21,6 +21,7 @@
21from bzrlib import (21from bzrlib import (
22 branch as _mod_branch,22 branch as _mod_branch,
23 bzrdir,23 bzrdir,
24 controldir,
24 errors,25 errors,
25 workingtree,26 workingtree,
26 )27 )
@@ -37,7 +38,7 @@
3738
38 def setUp(self):39 def setUp(self):
39 super(TestCheckout, self).setUp()40 super(TestCheckout, self).setUp()
40 tree = bzrdir.BzrDir.create_standalone_workingtree('branch')41 tree = controldir.ControlDir.create_standalone_workingtree('branch')
41 tree.commit('1', rev_id='1', allow_pointless=True)42 tree.commit('1', rev_id='1', allow_pointless=True)
42 self.build_tree(['branch/added_in_2'])43 self.build_tree(['branch/added_in_2'])
43 tree.add('added_in_2')44 tree.add('added_in_2')
@@ -46,16 +47,16 @@
46 def test_checkout_makes_bound_branch(self):47 def test_checkout_makes_bound_branch(self):
47 self.run_bzr('checkout branch checkout')48 self.run_bzr('checkout branch checkout')
48 # if we have a checkout, the branch base should be 'branch'49 # if we have a checkout, the branch base should be 'branch'
49 source = bzrdir.BzrDir.open('branch')50 source = controldir.ControlDir.open('branch')
50 result = bzrdir.BzrDir.open('checkout')51 result = controldir.ControlDir.open('checkout')
51 self.assertEqual(source.open_branch().bzrdir.root_transport.base,52 self.assertEqual(source.open_branch().bzrdir.root_transport.base,
52 result.open_branch().get_bound_location())53 result.open_branch().get_bound_location())
5354
54 def test_checkout_light_makes_checkout(self):55 def test_checkout_light_makes_checkout(self):
55 self.run_bzr('checkout --lightweight branch checkout')56 self.run_bzr('checkout --lightweight branch checkout')
56 # if we have a checkout, the branch base should be 'branch'57 # if we have a checkout, the branch base should be 'branch'
57 source = bzrdir.BzrDir.open('branch')58 source = controldir.ControlDir.open('branch')
58 result = bzrdir.BzrDir.open('checkout')59 result = controldir.ControlDir.open('checkout')
59 self.assertEqual(source.open_branch().bzrdir.root_transport.base,60 self.assertEqual(source.open_branch().bzrdir.root_transport.base,
60 result.open_branch().bzrdir.root_transport.base)61 result.open_branch().bzrdir.root_transport.base)
6162
@@ -63,7 +64,7 @@
63 out, err = self.run_bzr(['checkout', '-r', '-2', 'branch', 'checkout'])64 out, err = self.run_bzr(['checkout', '-r', '-2', 'branch', 'checkout'])
64 # the working tree should now be at revision '1' with the content65 # the working tree should now be at revision '1' with the content
65 # from 1.66 # from 1.
66 result = bzrdir.BzrDir.open('checkout')67 result = controldir.ControlDir.open('checkout')
67 self.assertEqual(['1'], result.open_workingtree().get_parent_ids())68 self.assertEqual(['1'], result.open_workingtree().get_parent_ids())
68 self.assertPathDoesNotExist('checkout/added_in_2')69 self.assertPathDoesNotExist('checkout/added_in_2')
6970
@@ -72,14 +73,14 @@
72 'branch', 'checkout'])73 'branch', 'checkout'])
73 # the working tree should now be at revision '1' with the content74 # the working tree should now be at revision '1' with the content
74 # from 1.75 # from 1.
75 result = bzrdir.BzrDir.open('checkout')76 result = controldir.ControlDir.open('checkout')
76 self.assertEqual(['1'], result.open_workingtree().get_parent_ids())77 self.assertEqual(['1'], result.open_workingtree().get_parent_ids())
77 self.assertPathDoesNotExist('checkout/added_in_2')78 self.assertPathDoesNotExist('checkout/added_in_2')
7879
79 def test_checkout_into_empty_dir(self):80 def test_checkout_into_empty_dir(self):
80 self.make_bzrdir('checkout')81 self.make_bzrdir('checkout')
81 out, err = self.run_bzr(['checkout', 'branch', 'checkout'])82 out, err = self.run_bzr(['checkout', 'branch', 'checkout'])
82 result = bzrdir.BzrDir.open('checkout')83 result = controldir.ControlDir.open('checkout')
83 tree = result.open_workingtree()84 tree = result.open_workingtree()
84 branch = result.open_branch()85 branch = result.open_branch()
8586
@@ -88,7 +89,7 @@
88 # or a 'bzr checkout path' with path the name of a directory with89 # or a 'bzr checkout path' with path the name of a directory with
89 # a branch with no tree will reconsistute the tree.90 # a branch with no tree will reconsistute the tree.
90 os.mkdir('treeless-branch')91 os.mkdir('treeless-branch')
91 branch = bzrdir.BzrDir.create_branch_convenience(92 branch = controldir.ControlDir.create_branch_convenience(
92 'treeless-branch',93 'treeless-branch',
93 force_new_tree=False,94 force_new_tree=False,
94 format=bzrdir.BzrDirMetaFormat1())95 format=bzrdir.BzrDirMetaFormat1())
@@ -101,7 +102,7 @@
101 out, err = self.run_bzr('diff treeless-branch')102 out, err = self.run_bzr('diff treeless-branch')
102103
103 # now test with no parameters104 # now test with no parameters
104 branch = bzrdir.BzrDir.create_branch_convenience(105 branch = controldir.ControlDir.create_branch_convenience(
105 '.',106 '.',
106 force_new_tree=False,107 force_new_tree=False,
107 format=bzrdir.BzrDirMetaFormat1())108 format=bzrdir.BzrDirMetaFormat1())
108109
=== modified file 'bzrlib/tests/blackbox/test_commit.py'
--- bzrlib/tests/blackbox/test_commit.py 2012-02-14 17:22:37 +0000
+++ bzrlib/tests/blackbox/test_commit.py 2012-03-06 18:30:24 +0000
@@ -30,7 +30,7 @@
30 ignores,30 ignores,
31 msgeditor,31 msgeditor,
32 )32 )
33from bzrlib.bzrdir import BzrDir33from bzrlib.controldir import ControlDir
34from bzrlib.tests import (34from bzrlib.tests import (
35 test_foreign,35 test_foreign,
36 features,36 features,
@@ -117,7 +117,7 @@
117 def prepare_simple_history(self):117 def prepare_simple_history(self):
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"""
119 # Commit with modified file should say so119 # Commit with modified file should say so
120 wt = BzrDir.create_standalone_workingtree('.')120 wt = ControlDir.create_standalone_workingtree('.')
121 self.build_tree(['hello.txt', 'extra.txt'])121 self.build_tree(['hello.txt', 'extra.txt'])
122 wt.add(['hello.txt'])122 wt.add(['hello.txt'])
123 wt.commit(message='added')123 wt.commit(message='added')
@@ -225,7 +225,7 @@
225 def test_verbose_commit_with_unknown(self):225 def test_verbose_commit_with_unknown(self):
226 """Unknown files should not be listed by default in verbose output"""226 """Unknown files should not be listed by default in verbose output"""
227 # Is that really the best policy?227 # Is that really the best policy?
228 wt = BzrDir.create_standalone_workingtree('.')228 wt = ControlDir.create_standalone_workingtree('.')
229 self.build_tree(['hello.txt', 'extra.txt'])229 self.build_tree(['hello.txt', 'extra.txt'])
230 wt.add(['hello.txt'])230 wt.add(['hello.txt'])
231 out,err = self.run_bzr('commit -m added')231 out,err = self.run_bzr('commit -m added')
@@ -757,7 +757,7 @@
757 # "UnlockableTransport error trying to commit in checkout of readonly757 # "UnlockableTransport error trying to commit in checkout of readonly
758 # branch"758 # branch"
759 self.make_branch('master')759 self.make_branch('master')
760 master = BzrDir.open_from_transport(760 master = ControlDir.open_from_transport(
761 self.get_readonly_transport('master')).open_branch()761 self.get_readonly_transport('master')).open_branch()
762 master.create_checkout('checkout')762 master.create_checkout('checkout')
763 out, err = self.run_bzr(['commit', '--unchanged', '-mfoo', 'checkout'],763 out, err = self.run_bzr(['commit', '--unchanged', '-mfoo', 'checkout'],
764764
=== modified file 'bzrlib/tests/blackbox/test_filtered_view_ops.py'
--- bzrlib/tests/blackbox/test_filtered_view_ops.py 2010-11-22 03:35:24 +0000
+++ bzrlib/tests/blackbox/test_filtered_view_ops.py 2012-03-06 18:30:24 +0000
@@ -16,10 +16,7 @@
1616
17"""Tests that an enabled view is reported and impacts expected commands."""17"""Tests that an enabled view is reported and impacts expected commands."""
1818
19import os
20
21from bzrlib import (19from bzrlib import (
22 bzrdir,
23 osutils,20 osutils,
24 tests,21 tests,
25 )22 )
2623
=== modified file 'bzrlib/tests/blackbox/test_info.py'
--- bzrlib/tests/blackbox/test_info.py 2012-02-23 18:19:18 +0000
+++ bzrlib/tests/blackbox/test_info.py 2012-03-06 18:30:24 +0000
@@ -231,7 +231,7 @@
231 # Branch and bind to standalone, needs upgrade to metadir231 # Branch and bind to standalone, needs upgrade to metadir
232 # (creates backup as unknown)232 # (creates backup as unknown)
233 branch1.bzrdir.sprout('bound')233 branch1.bzrdir.sprout('bound')
234 knit1_format = bzrdir.format_registry.make_bzrdir('knit')234 knit1_format = controldir.format_registry.make_bzrdir('knit')
235 upgrade.upgrade('bound', knit1_format)235 upgrade.upgrade('bound', knit1_format)
236 branch3 = controldir.ControlDir.open('bound').open_branch()236 branch3 = controldir.ControlDir.open('bound').open_branch()
237 branch3.bind(branch1)237 branch3.bind(branch1)
@@ -328,7 +328,7 @@
328 tree5 = branch1.create_checkout('lightcheckout', lightweight=True)328 tree5 = branch1.create_checkout('lightcheckout', lightweight=True)
329 branch5 = tree5.branch329 branch5 = tree5.branch
330 out, err = self.run_bzr('info -v lightcheckout')330 out, err = self.run_bzr('info -v lightcheckout')
331 if "metaweave" in bzrdir.format_registry:331 if "metaweave" in controldir.format_registry:
332 format_description = "knit or metaweave"332 format_description = "knit or metaweave"
333 else:333 else:
334 format_description = "knit"334 format_description = "knit"
@@ -546,7 +546,7 @@
546546
547 def test_info_standalone_no_tree(self):547 def test_info_standalone_no_tree(self):
548 # create standalone branch without a working tree548 # create standalone branch without a working tree
549 format = bzrdir.format_registry.make_bzrdir('default')549 format = controldir.format_registry.make_bzrdir('default')
550 branch = self.make_branch('branch')550 branch = self.make_branch('branch')
551 repo = branch.repository551 repo = branch.repository
552 out, err = self.run_bzr('info branch -v')552 out, err = self.run_bzr('info branch -v')
@@ -575,7 +575,7 @@
575 self.assertEqual('', err)575 self.assertEqual('', err)
576576
577 def test_info_shared_repository(self):577 def test_info_shared_repository(self):
578 format = bzrdir.format_registry.make_bzrdir('knit')578 format = controldir.format_registry.make_bzrdir('knit')
579 transport = self.get_transport()579 transport = self.get_transport()
580580
581 # Create shared repository581 # Create shared repository
@@ -871,7 +871,7 @@
871 self.assertEqual('', err)871 self.assertEqual('', err)
872872
873 def test_info_shared_repository_with_trees(self):873 def test_info_shared_repository_with_trees(self):
874 format = bzrdir.format_registry.make_bzrdir('knit')874 format = controldir.format_registry.make_bzrdir('knit')
875 transport = self.get_transport()875 transport = self.get_transport()
876876
877 # Create shared repository with working trees877 # Create shared repository with working trees
@@ -1098,7 +1098,7 @@
1098 self.assertEqual('', err)1098 self.assertEqual('', err)
10991099
1100 def test_info_shared_repository_with_tree_in_root(self):1100 def test_info_shared_repository_with_tree_in_root(self):
1101 format = bzrdir.format_registry.make_bzrdir('knit')1101 format = controldir.format_registry.make_bzrdir('knit')
1102 transport = self.get_transport()1102 transport = self.get_transport()
11031103
1104 # Create shared repository with working trees1104 # Create shared repository with working trees
@@ -1166,7 +1166,7 @@
1166 self.assertEqual('', err)1166 self.assertEqual('', err)
11671167
1168 def test_info_repository_hook(self):1168 def test_info_repository_hook(self):
1169 format = bzrdir.format_registry.make_bzrdir('knit')1169 format = controldir.format_registry.make_bzrdir('knit')
1170 def repo_info(repo, stats, outf):1170 def repo_info(repo, stats, outf):
1171 outf.write("more info\n")1171 outf.write("more info\n")
1172 info.hooks.install_named_hook('repository', repo_info, None)1172 info.hooks.install_named_hook('repository', repo_info, None)
@@ -1195,7 +1195,7 @@
1195 self.assertEqual('', err)1195 self.assertEqual('', err)
11961196
1197 def test_info_unshared_repository_with_colocated_branches(self):1197 def test_info_unshared_repository_with_colocated_branches(self):
1198 format = bzrdir.format_registry.make_bzrdir('development-colo')1198 format = controldir.format_registry.make_bzrdir('development-colo')
1199 transport = self.get_transport()1199 transport = self.get_transport()
12001200
1201 # Create unshared repository1201 # Create unshared repository
12021202
=== modified file 'bzrlib/tests/blackbox/test_join.py'
--- bzrlib/tests/blackbox/test_join.py 2012-01-27 16:27:26 +0000
+++ bzrlib/tests/blackbox/test_join.py 2012-03-06 18:30:24 +0000
@@ -18,9 +18,7 @@
18import os18import os
1919
20from bzrlib import (20from bzrlib import (
21 bzrdir,
22 osutils,21 osutils,
23 repository,
24 tests,22 tests,
25 workingtree,23 workingtree,
26 )24 )
2725
=== modified file 'bzrlib/tests/blackbox/test_merge.py'
--- bzrlib/tests/blackbox/test_merge.py 2012-01-05 17:56:30 +0000
+++ bzrlib/tests/blackbox/test_merge.py 2012-03-06 18:30:24 +0000
@@ -26,8 +26,8 @@
2626
27from bzrlib import (27from bzrlib import (
28 branch,28 branch,
29 bzrdir,
30 conflicts,29 conflicts,
30 controldir,
31 merge_directive,31 merge_directive,
32 osutils,32 osutils,
33 tests,33 tests,
@@ -75,7 +75,7 @@
75 return tree, other75 return tree, other
7676
77 def test_merge_reprocess(self):77 def test_merge_reprocess(self):
78 d = bzrdir.BzrDir.create_standalone_workingtree('.')78 d = controldir.ControlDir.create_standalone_workingtree('.')
79 d.commit('h')79 d.commit('h')
80 self.run_bzr('merge . --reprocess --merge-type weave')80 self.run_bzr('merge . --reprocess --merge-type weave')
8181
8282
=== modified file 'bzrlib/tests/blackbox/test_re_sign.py'
--- bzrlib/tests/blackbox/test_re_sign.py 2011-12-09 12:05:47 +0000
+++ bzrlib/tests/blackbox/test_re_sign.py 2012-03-06 18:30:24 +0000
@@ -23,7 +23,7 @@
23 gpg,23 gpg,
24 tests,24 tests,
25 )25 )
26from bzrlib.bzrdir import BzrDir26from bzrlib.controldir import ControlDir
27from bzrlib.testament import Testament27from bzrlib.testament import Testament
2828
2929
@@ -39,7 +39,7 @@
39 self.overrideAttr(gpg, 'GPGStrategy', gpg.LoopbackGPGStrategy)39 self.overrideAttr(gpg, 'GPGStrategy', gpg.LoopbackGPGStrategy)
4040
41 def setup_tree(self):41 def setup_tree(self):
42 wt = BzrDir.create_standalone_workingtree('.')42 wt = ControlDir.create_standalone_workingtree('.')
43 wt.commit("base A", allow_pointless=True, rev_id='A')43 wt.commit("base A", allow_pointless=True, rev_id='A')
44 wt.commit("base B", allow_pointless=True, rev_id='B')44 wt.commit("base B", allow_pointless=True, rev_id='B')
45 wt.commit("base C", allow_pointless=True, rev_id='C')45 wt.commit("base C", allow_pointless=True, rev_id='C')
@@ -89,7 +89,7 @@
8989
90 def test_resign_directory(self):90 def test_resign_directory(self):
91 """Test --directory option"""91 """Test --directory option"""
92 wt = BzrDir.create_standalone_workingtree('a')92 wt = ControlDir.create_standalone_workingtree('a')
93 wt.commit("base A", allow_pointless=True, rev_id='A')93 wt.commit("base A", allow_pointless=True, rev_id='A')
94 wt.commit("base B", allow_pointless=True, rev_id='B')94 wt.commit("base B", allow_pointless=True, rev_id='B')
95 wt.commit("base C", allow_pointless=True, rev_id='C')95 wt.commit("base C", allow_pointless=True, rev_id='C')
9696
=== modified file 'bzrlib/tests/blackbox/test_reconcile.py'
--- bzrlib/tests/blackbox/test_reconcile.py 2011-12-14 20:21:52 +0000
+++ bzrlib/tests/blackbox/test_reconcile.py 2012-03-06 18:30:24 +0000
@@ -18,7 +18,7 @@
1818
1919
20from bzrlib import (20from bzrlib import (
21 bzrdir,21 controldir,
22 inventory,22 inventory,
23 tests,23 tests,
24 )24 )
@@ -28,7 +28,7 @@
28class TrivialTest(tests.TestCaseWithTransport):28class TrivialTest(tests.TestCaseWithTransport):
2929
30 def test_trivial_reconcile(self):30 def test_trivial_reconcile(self):
31 t = bzrdir.BzrDir.create_standalone_workingtree('.')31 t = controldir.ControlDir.create_standalone_workingtree('.')
32 (out, err) = self.run_bzr('reconcile')32 (out, err) = self.run_bzr('reconcile')
33 if t.branch.repository._reconcile_backsup_inventory:33 if t.branch.repository._reconcile_backsup_inventory:
34 does_backup_text = "Inventory ok.\n"34 does_backup_text = "Inventory ok.\n"
@@ -45,7 +45,7 @@
45 self.assertEqualDiff(err, "")45 self.assertEqualDiff(err, "")
4646
47 def test_does_something_reconcile(self):47 def test_does_something_reconcile(self):
48 t = bzrdir.BzrDir.create_standalone_workingtree('.')48 t = controldir.ControlDir.create_standalone_workingtree('.')
49 # an empty inventory with no revision will trigger reconciliation.49 # an empty inventory with no revision will trigger reconciliation.
50 repo = t.branch.repository50 repo = t.branch.repository
51 inv = inventory.Inventory(revision_id='missing')51 inv = inventory.Inventory(revision_id='missing')
5252
=== modified file 'bzrlib/tests/blackbox/test_reconfigure.py'
--- bzrlib/tests/blackbox/test_reconfigure.py 2012-01-09 20:55:07 +0000
+++ bzrlib/tests/blackbox/test_reconfigure.py 2012-03-06 18:30:24 +0000
@@ -15,12 +15,11 @@
15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1616
17from bzrlib import (17from bzrlib import (
18 bzrdir,18 controldir,
19 errors,19 errors,
20 tests,20 tests,
21 workingtree,21 workingtree,
22 )22 )
23from bzrlib.branchbuilder import BranchBuilder
24from bzrlib.tests.script import TestCaseWithTransportAndScript23from bzrlib.tests.script import TestCaseWithTransportAndScript
2524
2625
@@ -86,7 +85,7 @@
8685
87 def test_use_shared_to_standalone(self):86 def test_use_shared_to_standalone(self):
88 repo = self.make_repository('repo', shared=True)87 repo = self.make_repository('repo', shared=True)
89 branch = bzrdir.BzrDir.create_branch_convenience('repo/tree')88 branch = controldir.ControlDir.create_branch_convenience('repo/tree')
90 self.assertNotEqual(branch.bzrdir.root_transport.base,89 self.assertNotEqual(branch.bzrdir.root_transport.base,
91 branch.repository.bzrdir.root_transport.base)90 branch.repository.bzrdir.root_transport.base)
92 self.run_bzr('reconfigure --standalone', working_dir='repo/tree')91 self.run_bzr('reconfigure --standalone', working_dir='repo/tree')
@@ -126,7 +125,7 @@
126125
127 def test_make_without_trees_leaves_tree_alone(self):126 def test_make_without_trees_leaves_tree_alone(self):
128 repo = self.make_repository('repo', shared=True)127 repo = self.make_repository('repo', shared=True)
129 branch = bzrdir.BzrDir.create_branch_convenience('repo/branch')128 branch = controldir.ControlDir.create_branch_convenience('repo/branch')
130 tree = workingtree.WorkingTree.open('repo/branch')129 tree = workingtree.WorkingTree.open('repo/branch')
131 self.build_tree(['repo/branch/foo'])130 self.build_tree(['repo/branch/foo'])
132 tree.add('foo')131 tree.add('foo')
@@ -137,7 +136,7 @@
137136
138 def test_shared_format_to_standalone(self, format=None):137 def test_shared_format_to_standalone(self, format=None):
139 repo = self.make_repository('repo', shared=True, format=format)138 repo = self.make_repository('repo', shared=True, format=format)
140 branch = bzrdir.BzrDir.create_branch_convenience('repo/tree')139 branch = controldir.ControlDir.create_branch_convenience('repo/tree')
141 self.assertNotEqual(branch.bzrdir.root_transport.base,140 self.assertNotEqual(branch.bzrdir.root_transport.base,
142 branch.repository.bzrdir.root_transport.base)141 branch.repository.bzrdir.root_transport.base)
143 tree = workingtree.WorkingTree.open('repo/tree')142 tree = workingtree.WorkingTree.open('repo/tree')
144143
=== modified file 'bzrlib/tests/blackbox/test_reference.py'
--- bzrlib/tests/blackbox/test_reference.py 2011-09-21 20:29:48 +0000
+++ bzrlib/tests/blackbox/test_reference.py 2012-03-06 18:30:24 +0000
@@ -17,7 +17,7 @@
1717
18from bzrlib import (18from bzrlib import (
19 branch as _mod_branch,19 branch as _mod_branch,
20 bzrdir,20 controldir,
21 )21 )
22from bzrlib.tests import TestCaseWithTransport22from bzrlib.tests import TestCaseWithTransport
2323
@@ -25,7 +25,7 @@
25class TestReference(TestCaseWithTransport):25class TestReference(TestCaseWithTransport):
2626
27 def get_default_format(self):27 def get_default_format(self):
28 format = bzrdir.format_registry.make_bzrdir('1.9')28 format = controldir.format_registry.make_bzrdir('1.9')
29 format.set_branch_format(_mod_branch.BzrBranchFormat8())29 format.set_branch_format(_mod_branch.BzrBranchFormat8())
30 return format30 return format
3131
3232
=== modified file 'bzrlib/tests/blackbox/test_rmbranch.py'
--- bzrlib/tests/blackbox/test_rmbranch.py 2012-02-28 10:10:24 +0000
+++ bzrlib/tests/blackbox/test_rmbranch.py 2012-03-06 18:30:24 +0000
@@ -18,7 +18,7 @@
18"""Black-box tests for bzr rmbranch."""18"""Black-box tests for bzr rmbranch."""
1919
20from bzrlib import (20from bzrlib import (
21 bzrdir,21 controldir,
22 )22 )
23from bzrlib.tests import (23from bzrlib.tests import (
24 TestCaseWithTransport,24 TestCaseWithTransport,
@@ -44,7 +44,7 @@
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'],
45 'rmbranch a')45 'rmbranch a')
46 self.run_bzr('rmbranch --force a')46 self.run_bzr('rmbranch --force a')
47 dir = bzrdir.BzrDir.open('a')47 dir = controldir.ControlDir.open('a')
48 self.assertFalse(dir.has_branch())48 self.assertFalse(dir.has_branch())
49 self.assertPathExists('a/hello')49 self.assertPathExists('a/hello')
50 self.assertPathExists('a/goodbye')50 self.assertPathExists('a/goodbye')
@@ -60,7 +60,7 @@
60 tree = self.example_tree('a')60 tree = self.example_tree('a')
61 tree.bzrdir.destroy_workingtree()61 tree.bzrdir.destroy_workingtree()
62 self.run_bzr('rmbranch', working_dir='a')62 self.run_bzr('rmbranch', working_dir='a')
63 dir = bzrdir.BzrDir.open('a')63 dir = controldir.ControlDir.open('a')
64 self.assertFalse(dir.has_branch())64 self.assertFalse(dir.has_branch())
6565
66 def test_no_arg(self):66 def test_no_arg(self):
@@ -69,7 +69,7 @@
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'],
70 'rmbranch a')70 'rmbranch a')
71 self.run_bzr('rmbranch --force', working_dir='a')71 self.run_bzr('rmbranch --force', working_dir='a')
72 dir = bzrdir.BzrDir.open('a')72 dir = controldir.ControlDir.open('a')
73 self.assertFalse(dir.has_branch())73 self.assertFalse(dir.has_branch())
7474
75 def test_remove_colo(self):75 def test_remove_colo(self):
@@ -78,7 +78,7 @@
78 tree.bzrdir.create_branch(name="otherbranch")78 tree.bzrdir.create_branch(name="otherbranch")
79 self.assertTrue(tree.bzrdir.has_branch('otherbranch'))79 self.assertTrue(tree.bzrdir.has_branch('otherbranch'))
80 self.run_bzr('rmbranch %s,branch=otherbranch' % tree.bzrdir.user_url)80 self.run_bzr('rmbranch %s,branch=otherbranch' % tree.bzrdir.user_url)
81 dir = bzrdir.BzrDir.open('a')81 dir = controldir.ControlDir.open('a')
82 self.assertFalse(dir.has_branch('otherbranch'))82 self.assertFalse(dir.has_branch('otherbranch'))
83 self.assertTrue(dir.has_branch())83 self.assertTrue(dir.has_branch())
8484
@@ -88,7 +88,7 @@
88 tree.bzrdir.create_branch(name="otherbranch")88 tree.bzrdir.create_branch(name="otherbranch")
89 self.assertTrue(tree.bzrdir.has_branch('otherbranch'))89 self.assertTrue(tree.bzrdir.has_branch('otherbranch'))
90 self.run_bzr('rmbranch otherbranch -d %s' % tree.bzrdir.user_url)90 self.run_bzr('rmbranch otherbranch -d %s' % tree.bzrdir.user_url)
91 dir = bzrdir.BzrDir.open('a')91 dir = controldir.ControlDir.open('a')
92 self.assertFalse(dir.has_branch('otherbranch'))92 self.assertFalse(dir.has_branch('otherbranch'))
93 self.assertTrue(dir.has_branch())93 self.assertTrue(dir.has_branch())
9494
9595
=== modified file 'bzrlib/tests/blackbox/test_send.py'
--- bzrlib/tests/blackbox/test_send.py 2012-02-14 17:22:37 +0000
+++ bzrlib/tests/blackbox/test_send.py 2012-03-06 18:30:24 +0000
@@ -20,7 +20,6 @@
2020
21from bzrlib import (21from bzrlib import (
22 branch,22 branch,
23 bzrdir,
24 merge_directive,23 merge_directive,
25 tests,24 tests,
26 )25 )
@@ -63,7 +62,7 @@
6362
64 def setUp(self):63 def setUp(self):
65 super(TestSend, self).setUp()64 super(TestSend, self).setUp()
66 grandparent_tree = bzrdir.BzrDir.create_standalone_workingtree(65 grandparent_tree = ControlDir.create_standalone_workingtree(
67 'grandparent')66 'grandparent')
68 self.build_tree_contents([('grandparent/file1', 'grandparent')])67 self.build_tree_contents([('grandparent/file1', 'grandparent')])
69 grandparent_tree.add('file1')68 grandparent_tree.add('file1')
@@ -275,7 +274,7 @@
275274
276 def make_parent_and_local_branches(self):275 def make_parent_and_local_branches(self):
277 # Create a 'parent' branch as the base276 # Create a 'parent' branch as the base
278 self.parent_tree = bzrdir.BzrDir.create_standalone_workingtree('parent')277 self.parent_tree = ControlDir.create_standalone_workingtree('parent')
279 self.build_tree_contents([('parent/file', 'parent')])278 self.build_tree_contents([('parent/file', 'parent')])
280 self.parent_tree.add('file')279 self.parent_tree.add('file')
281 self.parent_tree.commit('first commit', rev_id='parent')280 self.parent_tree.commit('first commit', rev_id='parent')
282281
=== modified file 'bzrlib/tests/blackbox/test_serve.py'
--- bzrlib/tests/blackbox/test_serve.py 2012-02-24 20:22:06 +0000
+++ bzrlib/tests/blackbox/test_serve.py 2012-03-06 18:30:24 +0000
@@ -34,7 +34,7 @@
34 urlutils,34 urlutils,
35 )35 )
36from bzrlib.branch import Branch36from bzrlib.branch import Branch
37from bzrlib.bzrdir import BzrDir37from bzrlib.controldir import ControlDir
38from bzrlib.smart import client, medium38from bzrlib.smart import client, medium
39from bzrlib.smart.server import (39from bzrlib.smart.server import (
40 BzrServerFactory,40 BzrServerFactory,
@@ -221,7 +221,7 @@
221 process, transport = self.start_server_inet(['--allow-writes'])221 process, transport = self.start_server_inet(['--allow-writes'])
222222
223 # We get a working branch, and can create a directory223 # We get a working branch, and can create a directory
224 branch = BzrDir.open_from_transport(transport).open_branch()224 branch = ControlDir.open_from_transport(transport).open_branch()
225 self.make_read_requests(branch)225 self.make_read_requests(branch)
226 transport.mkdir('adir')226 transport.mkdir('adir')
227 self.assertInetServerShutsdownCleanly(process)227 self.assertInetServerShutsdownCleanly(process)
@@ -263,7 +263,7 @@
263 log_fname = os.getcwd() + '/server.log'263 log_fname = os.getcwd() + '/server.log'
264 self.overrideEnv('BZR_LOG', log_fname)264 self.overrideEnv('BZR_LOG', log_fname)
265 process, transport = self.start_server_inet(['-Dhpss'])265 process, transport = self.start_server_inet(['-Dhpss'])
266 branch = BzrDir.open_from_transport(transport).open_branch()266 branch = ControlDir.open_from_transport(transport).open_branch()
267 self.make_read_requests(branch)267 self.make_read_requests(branch)
268 self.assertInetServerShutsdownCleanly(process)268 self.assertInetServerShutsdownCleanly(process)
269 f = open(log_fname, 'rb')269 f = open(log_fname, 'rb')
270270
=== modified file 'bzrlib/tests/blackbox/test_shared_repository.py'
--- bzrlib/tests/blackbox/test_shared_repository.py 2012-01-25 21:13:15 +0000
+++ bzrlib/tests/blackbox/test_shared_repository.py 2012-03-06 18:30:24 +0000
@@ -18,7 +18,8 @@
1818
19import os19import os
2020
21from bzrlib.bzrdir import BzrDir, BzrDirMetaFormat121from bzrlib.bzrdir import BzrDirMetaFormat1
22from bzrlib.controldir import ControlDir
22import bzrlib.errors as errors23import bzrlib.errors as errors
23from bzrlib.tests import TestCaseInTempDir24from bzrlib.tests import TestCaseInTempDir
24from bzrlib.tests.matchers import ContainsNoVfsCalls25from bzrlib.tests.matchers import ContainsNoVfsCalls
@@ -34,7 +35,7 @@
34 shared repository: a35 shared repository: a
35""")36""")
36 self.assertEqual(err, "")37 self.assertEqual(err, "")
37 dir = BzrDir.open('a')38 dir = ControlDir.open('a')
38 self.assertIs(dir.open_repository().is_shared(), True)39 self.assertIs(dir.open_repository().is_shared(), True)
39 self.assertRaises(errors.NotBranchError, dir.open_branch)40 self.assertRaises(errors.NotBranchError, dir.open_branch)
40 self.assertRaises(errors.NoWorkingTree, dir.open_workingtree)41 self.assertRaises(errors.NoWorkingTree, dir.open_workingtree)
@@ -43,7 +44,7 @@
43 out, err = self.run_bzr("init-repository a -q")44 out, err = self.run_bzr("init-repository a -q")
44 self.assertEqual(out, "")45 self.assertEqual(out, "")
45 self.assertEqual(err, "")46 self.assertEqual(err, "")
46 dir = BzrDir.open('a')47 dir = ControlDir.open('a')
47 self.assertIs(dir.open_repository().is_shared(), True)48 self.assertIs(dir.open_repository().is_shared(), True)
48 self.assertRaises(errors.NotBranchError, dir.open_branch)49 self.assertRaises(errors.NotBranchError, dir.open_branch)
49 self.assertRaises(errors.NoWorkingTree, dir.open_workingtree)50 self.assertRaises(errors.NoWorkingTree, dir.open_workingtree)
@@ -54,17 +55,17 @@
54 (Malone #38331)55 (Malone #38331)
55 """56 """
56 out, err = self.run_bzr("init-repository .")57 out, err = self.run_bzr("init-repository .")
57 dir = BzrDir.open('.')58 dir = ControlDir.open('.')
58 self.assertTrue(dir.open_repository())59 self.assertTrue(dir.open_repository())
5960
60 def test_init(self):61 def test_init(self):
61 self.run_bzr("init-repo a")62 self.run_bzr("init-repo a")
62 self.run_bzr("init --format=default a/b")63 self.run_bzr("init --format=default a/b")
63 dir = BzrDir.open('a')64 dir = ControlDir.open('a')
64 self.assertIs(dir.open_repository().is_shared(), True)65 self.assertIs(dir.open_repository().is_shared(), True)
65 self.assertRaises(errors.NotBranchError, dir.open_branch)66 self.assertRaises(errors.NotBranchError, dir.open_branch)
66 self.assertRaises(errors.NoWorkingTree, dir.open_workingtree)67 self.assertRaises(errors.NoWorkingTree, dir.open_workingtree)
67 bdir = BzrDir.open('a/b')68 bdir = ControlDir.open('a/b')
68 bdir.open_branch()69 bdir.open_branch()
69 self.assertRaises(errors.NoRepositoryPresent, bdir.open_repository)70 self.assertRaises(errors.NoRepositoryPresent, bdir.open_repository)
70 wt = bdir.open_workingtree()71 wt = bdir.open_workingtree()
@@ -73,7 +74,7 @@
73 self.run_bzr("init-repo a")74 self.run_bzr("init-repo a")
74 self.run_bzr("init --format=default a/b")75 self.run_bzr("init --format=default a/b")
75 self.run_bzr('branch a/b a/c')76 self.run_bzr('branch a/b a/c')
76 cdir = BzrDir.open('a/c')77 cdir = ControlDir.open('a/c')
77 cdir.open_branch()78 cdir.open_branch()
78 self.assertRaises(errors.NoRepositoryPresent, cdir.open_repository)79 self.assertRaises(errors.NoRepositoryPresent, cdir.open_repository)
79 cdir.open_workingtree()80 cdir.open_workingtree()
@@ -86,7 +87,7 @@
86 self.run_bzr("commit -m bar b/hello")87 self.run_bzr("commit -m bar b/hello")
8788
88 self.run_bzr('branch b a/c')89 self.run_bzr('branch b a/c')
89 cdir = BzrDir.open('a/c')90 cdir = ControlDir.open('a/c')
90 cdir.open_branch()91 cdir.open_branch()
91 self.assertRaises(errors.NoRepositoryPresent, cdir.open_repository)92 self.assertRaises(errors.NoRepositoryPresent, cdir.open_repository)
92 self.assertPathExists('a/c/hello')93 self.assertPathExists('a/c/hello')
@@ -95,20 +96,20 @@
95 def test_trees_default(self):96 def test_trees_default(self):
96 # 0.15 switched to trees by default97 # 0.15 switched to trees by default
97 self.run_bzr("init-repo repo")98 self.run_bzr("init-repo repo")
98 repo = BzrDir.open("repo").open_repository()99 repo = ControlDir.open("repo").open_repository()
99 self.assertEqual(True, repo.make_working_trees())100 self.assertEqual(True, repo.make_working_trees())
100101
101 def test_trees_argument(self):102 def test_trees_argument(self):
102 # Supplying the --trees argument should be harmless,103 # Supplying the --trees argument should be harmless,
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.
104 self.run_bzr("init-repo --trees trees")105 self.run_bzr("init-repo --trees trees")
105 repo = BzrDir.open("trees").open_repository()106 repo = ControlDir.open("trees").open_repository()
106 self.assertEqual(True, repo.make_working_trees())107 self.assertEqual(True, repo.make_working_trees())
107108
108 def test_no_trees_argument(self):109 def test_no_trees_argument(self):
109 # --no-trees should make it so that there is no working tree110 # --no-trees should make it so that there is no working tree
110 self.run_bzr("init-repo --no-trees notrees")111 self.run_bzr("init-repo --no-trees notrees")
111 repo = BzrDir.open("notrees").open_repository()112 repo = ControlDir.open("notrees").open_repository()
112 self.assertEqual(False, repo.make_working_trees())113 self.assertEqual(False, repo.make_working_trees())
113114
114 def test_init_repo_smart_acceptance(self):115 def test_init_repo_smart_acceptance(self):
@@ -129,7 +130,7 @@
129 out, err = self.run_bzr("init-repository -q a")130 out, err = self.run_bzr("init-repository -q a")
130 self.assertEqual(out, "")131 self.assertEqual(out, "")
131 self.assertEqual(err, "")132 self.assertEqual(err, "")
132 dir = BzrDir.open('a')133 dir = ControlDir.open('a')
133 dir.open_repository() # there is a repository there134 dir.open_repository() # there is a repository there
134 e = self.assertRaises(errors.NotBranchError, dir.open_branch)135 e = self.assertRaises(errors.NotBranchError, dir.open_branch)
135 self.assertContainsRe(str(e), "location is a repository")136 self.assertContainsRe(str(e), "location is a repository")
@@ -145,7 +146,7 @@
145146
146 def test_init_repo_with_post_repo_init_hook(self):147 def test_init_repo_with_post_repo_init_hook(self):
147 calls = []148 calls = []
148 BzrDir.hooks.install_named_hook('post_repo_init', calls.append, None)149 ControlDir.hooks.install_named_hook('post_repo_init', calls.append, None)
149 self.assertLength(0, calls)150 self.assertLength(0, calls)
150 self.run_bzr("init-repository a")151 self.run_bzr("init-repository a")
151 self.assertLength(1, calls)152 self.assertLength(1, calls)
152153
=== modified file 'bzrlib/tests/blackbox/test_switch.py'
--- bzrlib/tests/blackbox/test_switch.py 2012-02-28 10:02:24 +0000
+++ bzrlib/tests/blackbox/test_switch.py 2012-03-06 18:30:24 +0000
@@ -20,17 +20,17 @@
2020
21import os21import os
2222
23from bzrlib.bzrdir import BzrDir23from bzrlib.controldir import ControlDir
24from bzrlib import (24from bzrlib import (
25 osutils,25 osutils,
26 urlutils,26 urlutils,
27 branch,27 branch,
28 )28 )
29from bzrlib.workingtree import WorkingTree29from bzrlib.workingtree import WorkingTree
30from bzrlib.tests import (30from bzrlib.tests import (
31 TestCaseWithTransport,31 TestCaseWithTransport,
32 script,32 script,
33 )33 )
34from bzrlib.tests.features import UnicodeFilenameFeature34from bzrlib.tests.features import UnicodeFilenameFeature
35from bzrlib.directory_service import directories35from bzrlib.directory_service import directories
3636
@@ -237,7 +237,7 @@
237 tree.add('file-1')237 tree.add('file-1')
238 revid1 = tree.commit('rev1')238 revid1 = tree.commit('rev1')
239 self.run_bzr(['switch', '-b', 'anotherbranch'], working_dir='branch-1')239 self.run_bzr(['switch', '-b', 'anotherbranch'], working_dir='branch-1')
240 bzrdir = BzrDir.open("branch-1")240 bzrdir = ControlDir.open("branch-1")
241 self.assertEquals(241 self.assertEquals(
242 set([b.name for b in bzrdir.list_branches()]),242 set([b.name for b in bzrdir.list_branches()]),
243 set(["foo", "anotherbranch"]))243 set(["foo", "anotherbranch"]))
@@ -256,7 +256,7 @@
256 tree.add('file-1')256 tree.add('file-1')
257 revid1 = tree.commit('rev1')257 revid1 = tree.commit('rev1')
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')
259 bzrdir = BzrDir.open("branch-1")259 bzrdir = ControlDir.open("branch-1")
260 self.assertEquals(260 self.assertEquals(
261 set([b.name for b in bzrdir.list_branches()]),261 set([b.name for b in bzrdir.list_branches()]),
262 set(["foo", u"branch\xe9"]))262 set(["foo", u"branch\xe9"]))
263263
=== modified file 'bzrlib/tests/blackbox/test_upgrade.py'
--- bzrlib/tests/blackbox/test_upgrade.py 2011-12-07 14:16:12 +0000
+++ bzrlib/tests/blackbox/test_upgrade.py 2012-03-06 18:30:24 +0000
@@ -49,7 +49,7 @@
49 'branch-format',49 'branch-format',
50 bzrdir.BzrDirMetaFormat1().get_format_string(),50 bzrdir.BzrDirMetaFormat1().get_format_string(),
51 mode=to_convert._get_file_mode())51 mode=to_convert._get_file_mode())
52 return bzrdir.BzrDir.open(to_convert.user_url)52 return controldir.ControlDir.open(to_convert.user_url)
5353
5454
55class OldBzrDirFormat(bzrdir.BzrDirMetaFormat1):55class OldBzrDirFormat(bzrdir.BzrDirMetaFormat1):
@@ -155,7 +155,7 @@
155""" % (display_url, display_url, display_url, display_url, backup_dir), out)155""" % (display_url, display_url, display_url, display_url, backup_dir), out)
156 self.assertEqualDiff("", err)156 self.assertEqualDiff("", err)
157 self.assertTrue(isinstance(157 self.assertTrue(isinstance(
158 bzrdir.BzrDir.open(self.get_url(path))._format,158 controldir.ControlDir.open(self.get_url(path))._format,
159 bzrdir.BzrDirMetaFormat1))159 bzrdir.BzrDirMetaFormat1))
160160
161 def test_upgrade_explicit_knit(self):161 def test_upgrade_explicit_knit(self):
@@ -179,7 +179,7 @@
179""" % (display_url, display_url, display_url, display_url, backup_dir),179""" % (display_url, display_url, display_url, display_url, backup_dir),
180 out)180 out)
181 self.assertEqualDiff("", err)181 self.assertEqualDiff("", err)
182 converted_dir = bzrdir.BzrDir.open(self.get_url('branch'))182 converted_dir = controldir.ControlDir.open(self.get_url('branch'))
183 self.assertTrue(isinstance(converted_dir._format,183 self.assertTrue(isinstance(converted_dir._format,
184 bzrdir.BzrDirMetaFormat1))184 bzrdir.BzrDirMetaFormat1))
185 self.assertTrue(isinstance(converted_dir.open_repository()._format,185 self.assertTrue(isinstance(converted_dir.open_repository()._format,
@@ -196,9 +196,9 @@
196 self.run_bzr('upgrade --format=2a branch-foo %s' % (option_str,))196 self.run_bzr('upgrade --format=2a branch-foo %s' % (option_str,))
197197
198 def assertBranchFormat(self, dir, format):198 def assertBranchFormat(self, dir, format):
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]
200 branch_format = branch._format200 branch_format = branch._format
201 meta_format = bzrdir.format_registry.make_bzrdir(format)201 meta_format = controldir.format_registry.make_bzrdir(format)
202 expected_format = meta_format.get_branch_format()202 expected_format = meta_format.get_branch_format()
203 self.assertEqual(expected_format, branch_format)203 self.assertEqual(expected_format, branch_format)
204204
@@ -245,7 +245,7 @@
245""" % (display_url, display_url, display_url, display_url, backup_dir2), out)245""" % (display_url, display_url, display_url, display_url, backup_dir2), out)
246 self.assertEqualDiff("", err)246 self.assertEqualDiff("", err)
247 self.assertTrue(isinstance(247 self.assertTrue(isinstance(
248 bzrdir.BzrDir.open(self.get_url("old_format_branch"))._format,248 controldir.ControlDir.open(self.get_url("old_format_branch"))._format,
249 bzrdir.BzrDirMetaFormat1))249 bzrdir.BzrDirMetaFormat1))
250 self.assertTrue(t.has(backup_dir2))250 self.assertTrue(t.has(backup_dir2))
251251
252252
=== modified file 'bzrlib/tests/per_branch/test_bound_sftp.py'
--- bzrlib/tests/per_branch/test_bound_sftp.py 2012-01-25 21:13:15 +0000
+++ bzrlib/tests/per_branch/test_bound_sftp.py 2012-03-06 18:30:24 +0000
@@ -21,7 +21,7 @@
2121
22from bzrlib import (22from bzrlib import (
23 branch,23 branch,
24 bzrdir,24 controldir,
25 errors,25 errors,
26 tests,26 tests,
27 )27 )
@@ -39,9 +39,9 @@
3939
40 def create_branches(self):40 def create_branches(self):
41 self.build_tree(['base/', 'base/a', 'base/b'])41 self.build_tree(['base/', 'base/a', 'base/b'])
42 format = bzrdir.format_registry.make_bzrdir('knit')42 format = controldir.format_registry.make_bzrdir('knit')
43 try:43 try:
44 wt_base = bzrdir.BzrDir.create_standalone_workingtree(44 wt_base = controldir.ControlDir.create_standalone_workingtree(
45 self.get_url('base'), format=format)45 self.get_url('base'), format=format)
46 except errors.NotLocalUrl:46 except errors.NotLocalUrl:
47 raise tests.TestSkipped('Not a local URL')47 raise tests.TestSkipped('Not a local URL')
@@ -63,7 +63,7 @@
63 def test_simple_binding(self):63 def test_simple_binding(self):
64 self.build_tree(['base/', 'base/a', 'base/b', 'child/'])64 self.build_tree(['base/', 'base/a', 'base/b', 'child/'])
65 try:65 try:
66 wt_base = bzrdir.BzrDir.create_standalone_workingtree(66 wt_base = controldir.ControlDir.create_standalone_workingtree(
67 self.get_url('base'))67 self.get_url('base'))
68 except errors.NotLocalUrl:68 except errors.NotLocalUrl:
69 raise tests.TestSkipped('Not a local URL')69 raise tests.TestSkipped('Not a local URL')
@@ -76,8 +76,8 @@
76 # manually make a branch we can bind, because the default format76 # manually make a branch we can bind, because the default format
77 # may not be bindable-from, and we want to test the side effects etc77 # may not be bindable-from, and we want to test the side effects etc
78 # of bondage.78 # of bondage.
79 format = bzrdir.format_registry.make_bzrdir('knit')79 format = controldir.format_registry.make_bzrdir('knit')
80 b_child = bzrdir.BzrDir.create_branch_convenience(80 b_child = controldir.ControlDir.create_branch_convenience(
81 'child', format=format)81 'child', format=format)
82 self.assertEqual(None, b_child.get_bound_location())82 self.assertEqual(None, b_child.get_bound_location())
83 self.assertEqual(None, b_child.get_master_branch())83 self.assertEqual(None, b_child.get_master_branch())
@@ -144,7 +144,6 @@
144 wt_child2.commit, 'child2', rev_id='r@d-2')144 wt_child2.commit, 'child2', rev_id='r@d-2')
145145
146 def test_unbinding(self):146 def test_unbinding(self):
147 from bzrlib import transport
148 b_base, wt_child = self.create_branches()147 b_base, wt_child = self.create_branches()
149148
150 # TestCaseWithSFTPServer only allows you to connect one time149 # TestCaseWithSFTPServer only allows you to connect one time
151150
=== modified file 'bzrlib/tests/per_branch/test_branch.py'
--- bzrlib/tests/per_branch/test_branch.py 2012-02-14 17:22:37 +0000
+++ bzrlib/tests/per_branch/test_branch.py 2012-03-06 18:30:24 +0000
@@ -18,7 +18,7 @@
1818
19from bzrlib import (19from bzrlib import (
20 branch as _mod_branch,20 branch as _mod_branch,
21 bzrdir,21 controldir,
22 config,22 config,
23 delta as _mod_delta,23 delta as _mod_delta,
24 errors,24 errors,
@@ -708,7 +708,7 @@
708 self.assertIsInstance(made_branch, _mod_branch.Branch)708 self.assertIsInstance(made_branch, _mod_branch.Branch)
709709
710 # find it via bzrdir opening:710 # find it via bzrdir opening:
711 opened_control = bzrdir.BzrDir.open(readonly_t.base)711 opened_control = controldir.ControlDir.open(readonly_t.base)
712 direct_opened_branch = opened_control.open_branch()712 direct_opened_branch = opened_control.open_branch()
713 self.assertEqual(direct_opened_branch.__class__, made_branch.__class__)713 self.assertEqual(direct_opened_branch.__class__, made_branch.__class__)
714 self.assertEqual(opened_control, direct_opened_branch.bzrdir)714 self.assertEqual(opened_control, direct_opened_branch.bzrdir)
@@ -849,13 +849,13 @@
849 def test_fallbacks_not_opened(self):849 def test_fallbacks_not_opened(self):
850 stacked = self.make_branch_with_fallback()850 stacked = self.make_branch_with_fallback()
851 self.get_transport('').rename('fallback', 'moved')851 self.get_transport('').rename('fallback', 'moved')
852 reopened_dir = bzrdir.BzrDir.open(stacked.base)852 reopened_dir = controldir.ControlDir.open(stacked.base)
853 reopened = reopened_dir.open_branch(ignore_fallbacks=True)853 reopened = reopened_dir.open_branch(ignore_fallbacks=True)
854 self.assertEqual([], reopened.repository._fallback_repositories)854 self.assertEqual([], reopened.repository._fallback_repositories)
855855
856 def test_fallbacks_are_opened(self):856 def test_fallbacks_are_opened(self):
857 stacked = self.make_branch_with_fallback()857 stacked = self.make_branch_with_fallback()
858 reopened_dir = bzrdir.BzrDir.open(stacked.base)858 reopened_dir = controldir.ControlDir.open(stacked.base)
859 reopened = reopened_dir.open_branch(ignore_fallbacks=False)859 reopened = reopened_dir.open_branch(ignore_fallbacks=False)
860 self.assertLength(1, reopened.repository._fallback_repositories)860 self.assertLength(1, reopened.repository._fallback_repositories)
861861
862862
=== modified file 'bzrlib/tests/per_branch/test_permissions.py'
--- bzrlib/tests/per_branch/test_permissions.py 2011-09-12 09:51:52 +0000
+++ bzrlib/tests/per_branch/test_permissions.py 2012-03-06 18:30:24 +0000
@@ -32,7 +32,7 @@
3232
33from bzrlib import tests33from bzrlib import tests
34from bzrlib.branch import BzrBranch34from bzrlib.branch import BzrBranch
35from bzrlib.bzrdir import BzrDir35from bzrlib.controldir import ControlDir
36from bzrlib.remote import RemoteBranchFormat36from bzrlib.remote import RemoteBranchFormat
37from bzrlib.tests.test_permissions import check_mode_r37from bzrlib.tests.test_permissions import check_mode_r
3838
@@ -126,7 +126,7 @@
126 raise tests.TestNotApplicable('Remote branches have no'126 raise tests.TestNotApplicable('Remote branches have no'
127 ' permission logic')127 ' permission logic')
128 self.make_branch_and_tree('.')128 self.make_branch_and_tree('.')
129 bzrdir = BzrDir.open('.')129 bzrdir = ControlDir.open('.')
130 # Monkey patch the transport130 # Monkey patch the transport
131 _orig_stat = bzrdir.transport.stat131 _orig_stat = bzrdir.transport.stat
132 def null_perms_stat(*args, **kwargs):132 def null_perms_stat(*args, **kwargs):
133133
=== modified file 'bzrlib/tests/per_branch/test_pull.py'
--- bzrlib/tests/per_branch/test_pull.py 2011-12-27 12:18:36 +0000
+++ bzrlib/tests/per_branch/test_pull.py 2012-03-06 18:30:24 +0000
@@ -18,7 +18,7 @@
1818
19from bzrlib import (19from bzrlib import (
20 branch,20 branch,
21 bzrdir,21 controldir,
22 errors,22 errors,
23 memorytree,23 memorytree,
24 revision,24 revision,
@@ -238,7 +238,7 @@
238 # remotebranches can't be bound. Let's instead make a new local238 # remotebranches can't be bound. Let's instead make a new local
239 # branch of the default type, which does allow binding.239 # branch of the default type, which does allow binding.
240 # See https://bugs.launchpad.net/bzr/+bug/112020240 # See https://bugs.launchpad.net/bzr/+bug/112020
241 local = bzrdir.BzrDir.create_branch_convenience('local2')241 local = controldir.ControlDir.create_branch_convenience('local2')
242 local.bind(target)242 local.bind(target)
243 source = self.make_branch('source')243 source = self.make_branch('source')
244 branch.Branch.hooks.install_named_hook(244 branch.Branch.hooks.install_named_hook(
245245
=== modified file 'bzrlib/tests/per_branch/test_push.py'
--- bzrlib/tests/per_branch/test_push.py 2011-09-26 15:21:01 +0000
+++ bzrlib/tests/per_branch/test_push.py 2012-03-06 18:30:24 +0000
@@ -22,7 +22,7 @@
22from bzrlib import (22from bzrlib import (
23 branch,23 branch,
24 builtins,24 builtins,
25 bzrdir,25 controldir,
26 check,26 check,
27 errors,27 errors,
28 memorytree,28 memorytree,
@@ -173,7 +173,7 @@
173 if self.vfs_transport_factory is test_server.LocalURLServer:173 if self.vfs_transport_factory is test_server.LocalURLServer:
174 # the branch is colocated on disk, we cannot create a checkout.174 # the branch is colocated on disk, we cannot create a checkout.
175 # hopefully callers will expect this.175 # hopefully callers will expect this.
176 local_controldir= bzrdir.BzrDir.open(176 local_controldir = controldir.ControlDir.open(
177 self.get_vfs_only_url('repo/tree'))177 self.get_vfs_only_url('repo/tree'))
178 tree = local_controldir.create_workingtree()178 tree = local_controldir.create_workingtree()
179 else:179 else:
@@ -355,7 +355,7 @@
355 # remotebranches can't be bound. Let's instead make a new local355 # remotebranches can't be bound. Let's instead make a new local
356 # branch of the default type, which does allow binding.356 # branch of the default type, which does allow binding.
357 # See https://bugs.launchpad.net/bzr/+bug/112020357 # See https://bugs.launchpad.net/bzr/+bug/112020
358 local = bzrdir.BzrDir.create_branch_convenience('local2')358 local = controldir.ControlDir.create_branch_convenience('local2')
359 local.bind(target)359 local.bind(target)
360 source = self.make_branch('source')360 source = self.make_branch('source')
361 branch.Branch.hooks.install_named_hook(361 branch.Branch.hooks.install_named_hook(
362362
=== modified file 'bzrlib/tests/per_branch/test_stacking.py'
--- bzrlib/tests/per_branch/test_stacking.py 2011-11-24 17:24:21 +0000
+++ bzrlib/tests/per_branch/test_stacking.py 2012-03-06 18:30:24 +0000
@@ -18,7 +18,7 @@
1818
19from bzrlib import (19from bzrlib import (
20 branch,20 branch,
21 bzrdir,21 controldir,
22 check,22 check,
23 errors,23 errors,
24 )24 )
@@ -107,12 +107,12 @@
107107
108 def assertRevisionInRepository(self, repo_path, revid):108 def assertRevisionInRepository(self, repo_path, revid):
109 """Check that a revision is in a repository, disregarding stacking."""109 """Check that a revision is in a repository, disregarding stacking."""
110 repo = bzrdir.BzrDir.open(repo_path).open_repository()110 repo = controldir.ControlDir.open(repo_path).open_repository()
111 self.assertTrue(repo.has_revision(revid))111 self.assertTrue(repo.has_revision(revid))
112112
113 def assertRevisionNotInRepository(self, repo_path, revid):113 def assertRevisionNotInRepository(self, repo_path, revid):
114 """Check that a revision is not in a repository, disregarding stacking."""114 """Check that a revision is not in a repository, disregarding stacking."""
115 repo = bzrdir.BzrDir.open(repo_path).open_repository()115 repo = controldir.ControlDir.open(repo_path).open_repository()
116 self.assertFalse(repo.has_revision(revid))116 self.assertFalse(repo.has_revision(revid))
117117
118 def test_get_graph_stacked(self):118 def test_get_graph_stacked(self):
@@ -165,7 +165,7 @@
165 raise TestNotApplicable(e)165 raise TestNotApplicable(e)
166 # Now serve the original mainline from a smart server166 # Now serve the original mainline from a smart server
167 remote_transport = self.make_smart_server('mainline')167 remote_transport = self.make_smart_server('mainline')
168 remote_bzrdir = bzrdir.BzrDir.open_from_transport(remote_transport)168 remote_bzrdir = controldir.ControlDir.open_from_transport(remote_transport)
169 # and make branch from the smart server which is stacked169 # and make branch from the smart server which is stacked
170 new_dir = remote_bzrdir.sprout('newbranch', stacked=True)170 new_dir = remote_bzrdir.sprout('newbranch', stacked=True)
171 # stacked repository171 # stacked repository
172172
=== modified file 'bzrlib/tests/per_branch/test_tags.py'
--- bzrlib/tests/per_branch/test_tags.py 2011-09-12 09:51:52 +0000
+++ bzrlib/tests/per_branch/test_tags.py 2012-03-06 18:30:24 +0000
@@ -22,7 +22,7 @@
2222
23from bzrlib import (23from bzrlib import (
24 branch,24 branch,
25 bzrdir as _mod_bzrdir,25 controldir,
26 errors,26 errors,
27 tests,27 tests,
28 )28 )
@@ -170,7 +170,7 @@
170 b1 = self.make_branch_with_revisions('b',170 b1 = self.make_branch_with_revisions('b',
171 ['rev-1', 'rev-1-changed', 'rev-2'])171 ['rev-1', 'rev-1-changed', 'rev-2'])
172 b1.tags.set_tag('one', 'rev-1')172 b1.tags.set_tag('one', 'rev-1')
173 b2 = _mod_bzrdir.BzrDir.open('b').open_branch()173 b2 = controldir.ControlDir.open('b').open_branch()
174 b1.lock_read()174 b1.lock_read()
175 self.assertEqual({'one': 'rev-1'}, b1.tags.get_tag_dict())175 self.assertEqual({'one': 'rev-1'}, b1.tags.get_tag_dict())
176 # Add a tag and modify a tag in b2. b1 is read-locked and has already176 # Add a tag and modify a tag in b2. b1 is read-locked and has already
177177
=== modified file 'bzrlib/tests/per_bzrdir/test_bzrdir.py'
--- bzrlib/tests/per_bzrdir/test_bzrdir.py 2012-01-28 00:41:30 +0000
+++ bzrlib/tests/per_bzrdir/test_bzrdir.py 2012-03-06 18:30:24 +0000
@@ -21,8 +21,8 @@
2121
22import bzrlib.branch22import bzrlib.branch
23from bzrlib import (23from bzrlib import (
24 branch,
25 bzrdir,24 bzrdir,
25 controldir,
26 errors,26 errors,
27 repository,27 repository,
28 revision as _mod_revision,28 revision as _mod_revision,
@@ -657,7 +657,7 @@
657 raise TestNotApplicable('Only relevant for stackable formats.')657 raise TestNotApplicable('Only relevant for stackable formats.')
658 # Initialize a bzrdir subject to the policy.658 # Initialize a bzrdir subject to the policy.
659 t = self.get_transport('stacked')659 t = self.get_transport('stacked')
660 repo_fmt = bzrdir.format_registry.make_bzrdir('1.9')660 repo_fmt = controldir.format_registry.make_bzrdir('1.9')
661 repo_name = repo_fmt.repository_format.network_name()661 repo_name = repo_fmt.repository_format.network_name()
662 repo, control = self.assertInitializeEx(662 repo, control = self.assertInitializeEx(
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)
664664
=== modified file 'bzrlib/tests/per_controldir/test_controldir.py'
--- bzrlib/tests/per_controldir/test_controldir.py 2012-02-14 17:22:37 +0000
+++ bzrlib/tests/per_controldir/test_controldir.py 2012-03-06 18:30:24 +0000
@@ -20,18 +20,18 @@
2020
21import bzrlib.branch21import bzrlib.branch
22from bzrlib import (22from bzrlib import (
23 bzrdir,23 bzrdir as _mod_bzrdir,
24 check,24 check,
25 controldir,25 controldir,
26 errors,26 errors,
27 gpg,27 gpg,
28 osutils,28 osutils,
29 revision as _mod_revision,
29 transport,30 transport,
30 ui,31 ui,
31 urlutils,32 urlutils,
32 workingtree,33 workingtree,
33 )34 )
34import bzrlib.revision
35from bzrlib.tests import (35from bzrlib.tests import (
36 fixtures,36 fixtures,
37 ChrootedTestCase,37 ChrootedTestCase,
@@ -124,7 +124,7 @@
124 dir.create_repository()124 dir.create_repository()
125 dir.create_branch()125 dir.create_branch()
126 try:126 try:
127 wt = dir.create_workingtree(revision_id=bzrlib.revision.NULL_REVISION)127 wt = dir.create_workingtree(revision_id=_mod_revision.NULL_REVISION)
128 except (errors.NotLocalUrl, errors.UnsupportedOperation):128 except (errors.NotLocalUrl, errors.UnsupportedOperation):
129 raise TestSkipped("cannot make working tree with transport %r"129 raise TestSkipped("cannot make working tree with transport %r"
130 % dir.transport)130 % dir.transport)
@@ -186,7 +186,7 @@
186 e.g. NotLocalUrl) if there is no working tree.186 e.g. NotLocalUrl) if there is no working tree.
187 """187 """
188 dir = self.make_bzrdir('source')188 dir = self.make_bzrdir('source')
189 vfs_dir = bzrdir.BzrDir.open(self.get_vfs_only_url('source'))189 vfs_dir = controldir.ControlDir.open(self.get_vfs_only_url('source'))
190 if vfs_dir.has_workingtree():190 if vfs_dir.has_workingtree():
191 # This ControlDir format doesn't support ControlDirs without191 # This ControlDir format doesn't support ControlDirs without
192 # working trees, so this test is irrelevant.192 # working trees, so this test is irrelevant.
@@ -232,7 +232,7 @@
232 tree.add('foo')232 tree.add('foo')
233 tree.commit('revision 1', rev_id='1')233 tree.commit('revision 1', rev_id='1')
234 tree.bzrdir.open_branch().generate_revision_history(234 tree.bzrdir.open_branch().generate_revision_history(
235 bzrlib.revision.NULL_REVISION)235 _mod_revision.NULL_REVISION)
236 tree.set_parent_trees([])236 tree.set_parent_trees([])
237 tree.commit('revision 2', rev_id='2')237 tree.commit('revision 2', rev_id='2')
238 # Copy the content (i.e. revisions) from the 'commit_tree' branch's238 # Copy the content (i.e. revisions) from the 'commit_tree' branch's
@@ -265,7 +265,7 @@
265 tree.add('foo')265 tree.add('foo')
266 tree.commit('revision 1', rev_id='1')266 tree.commit('revision 1', rev_id='1')
267 tree.branch.bzrdir.open_branch().generate_revision_history(267 tree.branch.bzrdir.open_branch().generate_revision_history(
268 bzrlib.revision.NULL_REVISION)268 _mod_revision.NULL_REVISION)
269 tree.set_parent_trees([])269 tree.set_parent_trees([])
270 tree.commit('revision 2', rev_id='2')270 tree.commit('revision 2', rev_id='2')
271 tree.branch.repository.copy_content_into(shared_repo)271 tree.branch.repository.copy_content_into(shared_repo)
@@ -293,7 +293,7 @@
293 tree.add('foo')293 tree.add('foo')
294 tree.commit('revision 1', rev_id='1')294 tree.commit('revision 1', rev_id='1')
295 tree.branch.bzrdir.open_branch().generate_revision_history(295 tree.branch.bzrdir.open_branch().generate_revision_history(
296 bzrlib.revision.NULL_REVISION)296 _mod_revision.NULL_REVISION)
297 tree.set_parent_trees([])297 tree.set_parent_trees([])
298 tree.commit('revision 2', rev_id='2')298 tree.commit('revision 2', rev_id='2')
299 source = self.make_repository('source')299 source = self.make_repository('source')
@@ -365,7 +365,7 @@
365 self.assertEqual('1', target.open_branch().last_revision())365 self.assertEqual('1', target.open_branch().last_revision())
366366
367 def test_clone_on_transport_preserves_repo_format(self):367 def test_clone_on_transport_preserves_repo_format(self):
368 if self.bzrdir_format == bzrdir.format_registry.make_bzrdir('default'):368 if self.bzrdir_format == controldir.format_registry.make_bzrdir('default'):
369 format = 'knit'369 format = 'knit'
370 else:370 else:
371 format = None371 format = None
@@ -552,7 +552,7 @@
552 tree.add('foo')552 tree.add('foo')
553 tree.commit('revision 1', rev_id='1')553 tree.commit('revision 1', rev_id='1')
554 tree.bzrdir.open_branch().generate_revision_history(554 tree.bzrdir.open_branch().generate_revision_history(
555 bzrlib.revision.NULL_REVISION)555 _mod_revision.NULL_REVISION)
556 tree.set_parent_trees([])556 tree.set_parent_trees([])
557 tree.commit('revision 2', rev_id='2')557 tree.commit('revision 2', rev_id='2')
558 source = self.make_repository('source')558 source = self.make_repository('source')
@@ -581,7 +581,7 @@
581 tree.add('foo')581 tree.add('foo')
582 tree.commit('revision 1', rev_id='1')582 tree.commit('revision 1', rev_id='1')
583 tree.bzrdir.open_branch().generate_revision_history(583 tree.bzrdir.open_branch().generate_revision_history(
584 bzrlib.revision.NULL_REVISION)584 _mod_revision.NULL_REVISION)
585 tree.set_parent_trees([])585 tree.set_parent_trees([])
586 tree.commit('revision 2', rev_id='2')586 tree.commit('revision 2', rev_id='2')
587 tree.branch.repository.copy_content_into(shared_repo)587 tree.branch.repository.copy_content_into(shared_repo)
@@ -606,7 +606,7 @@
606 tree.add('foo')606 tree.add('foo')
607 tree.commit('revision 1', rev_id='1')607 tree.commit('revision 1', rev_id='1')
608 tree.bzrdir.open_branch().generate_revision_history(608 tree.bzrdir.open_branch().generate_revision_history(
609 bzrlib.revision.NULL_REVISION)609 _mod_revision.NULL_REVISION)
610 tree.set_parent_trees([])610 tree.set_parent_trees([])
611 tree.commit('revision 2', rev_id='2')611 tree.commit('revision 2', rev_id='2')
612 tree.branch.repository.copy_content_into(shared_repo)612 tree.branch.repository.copy_content_into(shared_repo)
@@ -634,7 +634,7 @@
634 tree.add('foo')634 tree.add('foo')
635 tree.commit('revision 1', rev_id='1')635 tree.commit('revision 1', rev_id='1')
636 tree.bzrdir.open_branch().generate_revision_history(636 tree.bzrdir.open_branch().generate_revision_history(
637 bzrlib.revision.NULL_REVISION)637 _mod_revision.NULL_REVISION)
638 tree.set_parent_trees([])638 tree.set_parent_trees([])
639 tree.commit('revision 2', rev_id='2')639 tree.commit('revision 2', rev_id='2')
640 source = self.make_repository('source')640 source = self.make_repository('source')
@@ -661,7 +661,7 @@
661 tree.add('foo')661 tree.add('foo')
662 tree.commit('revision 1', rev_id='1')662 tree.commit('revision 1', rev_id='1')
663 br = tree.bzrdir.open_branch()663 br = tree.bzrdir.open_branch()
664 br.set_last_revision_info(0, bzrlib.revision.NULL_REVISION)664 br.set_last_revision_info(0, _mod_revision.NULL_REVISION)
665 tree.set_parent_trees([])665 tree.set_parent_trees([])
666 tree.commit('revision 2', rev_id='2')666 tree.commit('revision 2', rev_id='2')
667 source = self.make_repository('source')667 source = self.make_repository('source')
@@ -1048,7 +1048,7 @@
1048 self.assertEqual(self.bzrdir_format,1048 self.assertEqual(self.bzrdir_format,
1049 controldir.ControlDirFormat.find_format(readonly_t))1049 controldir.ControlDirFormat.find_format(readonly_t))
1050 direct_opened_dir = self.bzrdir_format.open(readonly_t)1050 direct_opened_dir = self.bzrdir_format.open(readonly_t)
1051 opened_dir = bzrdir.BzrDir.open(t.base)1051 opened_dir = controldir.ControlDir.open(t.base)
1052 self.assertEqual(made_control._format,1052 self.assertEqual(made_control._format,
1053 opened_dir._format)1053 opened_dir._format)
1054 self.assertEqual(direct_opened_dir._format,1054 self.assertEqual(direct_opened_dir._format,
@@ -1086,7 +1086,7 @@
10861086
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):
1088 t = self.get_transport('repo')1088 t = self.get_transport('repo')
1089 repo_fmt = bzrdir.format_registry.make_bzrdir('1.9')1089 repo_fmt = controldir.format_registry.make_bzrdir('1.9')
1090 repo_name = repo_fmt.repository_format.network_name()1090 repo_name = repo_fmt.repository_format.network_name()
1091 repo = repo_fmt.initialize_on_transport_ex(t,1091 repo = repo_fmt.initialize_on_transport_ex(t,
1092 repo_format_name=repo_name, shared_repo=True)[0]1092 repo_format_name=repo_name, shared_repo=True)[0]
@@ -1097,7 +1097,7 @@
10971097
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):
1099 t = self.get_transport('repo')1099 t = self.get_transport('repo')
1100 repo_fmt = bzrdir.format_registry.make_bzrdir('1.9')1100 repo_fmt = controldir.format_registry.make_bzrdir('1.9')
1101 repo_name = repo_fmt.repository_format.network_name()1101 repo_name = repo_fmt.repository_format.network_name()
1102 repo = repo_fmt.initialize_on_transport_ex(t,1102 repo = repo_fmt.initialize_on_transport_ex(t,
1103 repo_format_name=repo_name, shared_repo=True)[0]1103 repo_format_name=repo_name, shared_repo=True)[0]
@@ -1115,7 +1115,7 @@
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):
1116 t = self.get_transport('dir')1116 t = self.get_transport('dir')
1117 # 1.6 is likely to never be default1117 # 1.6 is likely to never be default
1118 fmt = bzrdir.format_registry.make_bzrdir('1.6')1118 fmt = controldir.format_registry.make_bzrdir('1.6')
1119 repo_name = fmt.repository_format.network_name()1119 repo_name = fmt.repository_format.network_name()
1120 repo, control = self.assertInitializeEx(t, repo_format_name=repo_name)1120 repo, control = self.assertInitializeEx(t, repo_format_name=repo_name)
1121 if self.bzrdir_format.fixed_components:1121 if self.bzrdir_format.fixed_components:
@@ -1144,7 +1144,7 @@
1144 self.assertTrue(repo.is_write_locked())1144 self.assertTrue(repo.is_write_locked())
1145 self.addCleanup(repo.unlock)1145 self.addCleanup(repo.unlock)
1146 self.assertIsInstance(control, controldir.ControlDir)1146 self.assertIsInstance(control, controldir.ControlDir)
1147 opened = bzrdir.BzrDir.open(t.base)1147 opened = controldir.ControlDir.open(t.base)
1148 expected_format = self.bzrdir_format1148 expected_format = self.bzrdir_format
1149 if not isinstance(expected_format, RemoteBzrDirFormat):1149 if not isinstance(expected_format, RemoteBzrDirFormat):
1150 self.assertEqual(control._format.network_name(),1150 self.assertEqual(control._format.network_name(),
@@ -1383,7 +1383,7 @@
1383 except (errors.NotLocalUrl, errors.UnsupportedOperation):1383 except (errors.NotLocalUrl, errors.UnsupportedOperation):
1384 raise TestSkipped("Can't initialize %r on transport %r"1384 raise TestSkipped("Can't initialize %r on transport %r"
1385 % (self.bzrdir_format, t))1385 % (self.bzrdir_format, t))
1386 dir = bzrdir.BzrDir.open(t.base+",branch=foo")1386 dir = controldir.ControlDir.open(t.base+",branch=foo")
1387 self.assertEquals({"branch": "foo"},1387 self.assertEquals({"branch": "foo"},
1388 dir.user_transport.get_segment_parameters())1388 dir.user_transport.get_segment_parameters())
1389 self.assertEquals("foo", dir._get_selected_branch())1389 self.assertEquals("foo", dir._get_selected_branch())
@@ -1398,7 +1398,7 @@
1398 except (errors.NotLocalUrl, errors.UnsupportedOperation):1398 except (errors.NotLocalUrl, errors.UnsupportedOperation):
1399 raise TestSkipped("Can't initialize %r on transport %r"1399 raise TestSkipped("Can't initialize %r on transport %r"
1400 % (self.bzrdir_format, t))1400 % (self.bzrdir_format, t))
1401 dir = bzrdir.BzrDir.open(t.base)1401 dir = controldir.ControlDir.open(t.base)
1402 self.assertEqual(u"", dir._get_selected_branch())1402 self.assertEqual(u"", dir._get_selected_branch())
14031403
1404 def test_root_transport(self):1404 def test_root_transport(self):
@@ -1473,7 +1473,7 @@
1473 raise TestNotApplicable("format does not support "1473 raise TestNotApplicable("format does not support "
1474 "nesting repositories")1474 "nesting repositories")
1475 child_repo = self.make_repository('childrepo')1475 child_repo = self.make_repository('childrepo')
1476 opened_control = bzrdir.BzrDir.open(self.get_url('childrepo'))1476 opened_control = controldir.ControlDir.open(self.get_url('childrepo'))
1477 found_repo = opened_control.find_repository()1477 found_repo = opened_control.find_repository()
1478 self.assertEqual(child_repo.bzrdir.root_transport.base,1478 self.assertEqual(child_repo.bzrdir.root_transport.base,
1479 found_repo.bzrdir.root_transport.base)1479 found_repo.bzrdir.root_transport.base)
@@ -1493,7 +1493,7 @@
1493 self.get_transport().mkdir('childrepo')1493 self.get_transport().mkdir('childrepo')
1494 child_control = self.bzrdir_format.initialize(url)1494 child_control = self.bzrdir_format.initialize(url)
1495 child_repo = child_control.create_repository(shared=True)1495 child_repo = child_control.create_repository(shared=True)
1496 opened_control = bzrdir.BzrDir.open(self.get_url('childrepo'))1496 opened_control = controldir.ControlDir.open(self.get_url('childrepo'))
1497 found_repo = opened_control.find_repository()1497 found_repo = opened_control.find_repository()
1498 self.assertEqual(child_repo.bzrdir.root_transport.base,1498 self.assertEqual(child_repo.bzrdir.root_transport.base,
1499 found_repo.bzrdir.root_transport.base)1499 found_repo.bzrdir.root_transport.base)
@@ -1713,14 +1713,14 @@
1713 except errors.BzrError, e:1713 except errors.BzrError, e:
1714 if 'Cannot set config' in str(e):1714 if 'Cannot set config' in str(e):
1715 self.assertFalse(1715 self.assertFalse(
1716 isinstance(my_dir, (bzrdir.BzrDirMeta1, RemoteBzrDir)),1716 isinstance(my_dir, (_mod_bzrdir.BzrDirMeta1, RemoteBzrDir)),
1717 "%r should support configs" % my_dir)1717 "%r should support configs" % my_dir)
1718 raise TestNotApplicable(1718 raise TestNotApplicable(
1719 'This BzrDir format does not support configs.')1719 'This BzrDir format does not support configs.')
1720 else:1720 else:
1721 raise1721 raise
1722 self.assertEqual('http://example.com', config.get_default_stack_on())1722 self.assertEqual('http://example.com', config.get_default_stack_on())
1723 my_dir2 = bzrdir.BzrDir.open(self.get_url('.'))1723 my_dir2 = controldir.ControlDir.open(self.get_url('.'))
1724 config2 = my_dir2.get_config()1724 config2 = my_dir2.get_config()
1725 self.assertEqual('http://example.com', config2.get_default_stack_on())1725 self.assertEqual('http://example.com', config2.get_default_stack_on())
17261726
@@ -1748,7 +1748,7 @@
1748 return1748 return
1749 except errors.NoRepositoryPresent:1749 except errors.NoRepositoryPresent:
1750 pass1750 pass
1751 made_control = bzrdir.BzrDir.open(self.get_readonly_url('subdir'))1751 made_control = controldir.ControlDir.open(self.get_readonly_url('subdir'))
1752 self.assertRaises(errors.NoRepositoryPresent,1752 self.assertRaises(errors.NoRepositoryPresent,
1753 made_control.find_repository)1753 made_control.find_repository)
17541754
17551755
=== modified file 'bzrlib/tests/per_interbranch/test_pull.py'
--- bzrlib/tests/per_interbranch/test_pull.py 2011-10-17 08:45:09 +0000
+++ bzrlib/tests/per_interbranch/test_pull.py 2012-03-06 18:30:24 +0000
@@ -17,7 +17,7 @@
17"""Tests for InterBranch.pull behaviour."""17"""Tests for InterBranch.pull behaviour."""
1818
19from bzrlib.branch import Branch19from bzrlib.branch import Branch
20from bzrlib.bzrdir import BzrDir20from bzrlib.controldir import ControlDir
21from bzrlib import errors21from bzrlib import errors
22from bzrlib.memorytree import MemoryTree22from bzrlib.memorytree import MemoryTree
23from bzrlib.revision import NULL_REVISION23from bzrlib.revision import NULL_REVISION
@@ -175,7 +175,7 @@
175 # remotebranches can't be bound. Let's instead make a new local175 # remotebranches can't be bound. Let's instead make a new local
176 # branch of the default type, which does allow binding.176 # branch of the default type, which does allow binding.
177 # See https://bugs.launchpad.net/bzr/+bug/112020177 # See https://bugs.launchpad.net/bzr/+bug/112020
178 local = BzrDir.create_branch_convenience('local2')178 local = ControlDir.create_branch_convenience('local2')
179 local.bind(target)179 local.bind(target)
180 source = self.make_from_branch('source')180 source = self.make_from_branch('source')
181 Branch.hooks.install_named_hook('post_pull',181 Branch.hooks.install_named_hook('post_pull',
182182
=== modified file 'bzrlib/tests/per_interbranch/test_push.py'
--- bzrlib/tests/per_interbranch/test_push.py 2011-12-11 15:42:02 +0000
+++ bzrlib/tests/per_interbranch/test_push.py 2012-03-06 18:30:24 +0000
@@ -25,8 +25,8 @@
2525
26from bzrlib import (26from bzrlib import (
27 branch,27 branch,
28 bzrdir,
29 check,28 check,
29 controldir,
30 errors,30 errors,
31 push,31 push,
32 symbol_versioning,32 symbol_versioning,
@@ -34,7 +34,7 @@
34 vf_repository,34 vf_repository,
35 )35 )
36from bzrlib.branch import Branch36from bzrlib.branch import Branch
37from bzrlib.bzrdir import BzrDir37from bzrlib.controldir import ControlDir
38from bzrlib.memorytree import MemoryTree38from bzrlib.memorytree import MemoryTree
39from bzrlib.revision import NULL_REVISION39from bzrlib.revision import NULL_REVISION
40from bzrlib.smart.repository import SmartServerRepositoryGetParentMap40from bzrlib.smart.repository import SmartServerRepositoryGetParentMap
@@ -165,7 +165,7 @@
165 if self.vfs_transport_factory is test_server.LocalURLServer:165 if self.vfs_transport_factory is test_server.LocalURLServer:
166 # the branch is colocated on disk, we cannot create a checkout.166 # the branch is colocated on disk, we cannot create a checkout.
167 # hopefully callers will expect this.167 # hopefully callers will expect this.
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'))
169 tree = local_controldir.create_workingtree()169 tree = local_controldir.create_workingtree()
170 else:170 else:
171 tree = a_branch.create_checkout('repo/tree', lightweight=True)171 tree = a_branch.create_checkout('repo/tree', lightweight=True)
@@ -349,7 +349,7 @@
349 # remotebranches can't be bound. Let's instead make a new local349 # remotebranches can't be bound. Let's instead make a new local
350 # branch of the default type, which does allow binding.350 # branch of the default type, which does allow binding.
351 # See https://bugs.launchpad.net/bzr/+bug/112020351 # See https://bugs.launchpad.net/bzr/+bug/112020
352 local = BzrDir.create_branch_convenience('local2')352 local = ControlDir.create_branch_convenience('local2')
353 local.bind(target)353 local.bind(target)
354 source = self.make_from_branch('source')354 source = self.make_from_branch('source')
355 Branch.hooks.install_named_hook('post_push',355 Branch.hooks.install_named_hook('post_push',
356356
=== modified file 'bzrlib/tests/per_intertree/__init__.py'
--- bzrlib/tests/per_intertree/__init__.py 2011-08-04 14:01:47 +0000
+++ bzrlib/tests/per_intertree/__init__.py 2012-03-06 18:30:24 +0000
@@ -135,7 +135,7 @@
135 # -- vila 20090311135 # -- vila 20090311
136 chk_tree_format = WorkingTreeFormat4()136 chk_tree_format = WorkingTreeFormat4()
137 chk_tree_format._get_matchingbzrdir = \137 chk_tree_format._get_matchingbzrdir = \
138 lambda:bzrlib.bzrdir.format_registry.make_bzrdir('2a')138 lambda:bzrlib.controldir.format_registry.make_bzrdir('2a')
139 test_intertree_permutations.append(139 test_intertree_permutations.append(
140 (InterTree.__name__ + "(CHKInventory)",140 (InterTree.__name__ + "(CHKInventory)",
141 InterTree,141 InterTree,
142142
=== modified file 'bzrlib/tests/per_pack_repository.py'
--- bzrlib/tests/per_pack_repository.py 2011-08-19 22:34:02 +0000
+++ bzrlib/tests/per_pack_repository.py 2012-03-06 18:30:24 +0000
@@ -24,7 +24,7 @@
24from bzrlib.btree_index import BTreeGraphIndex24from bzrlib.btree_index import BTreeGraphIndex
25from bzrlib.index import GraphIndex25from bzrlib.index import GraphIndex
26from bzrlib import (26from bzrlib import (
27 bzrdir,27 controldir,
28 errors,28 errors,
29 inventory,29 inventory,
30 osutils,30 osutils,
@@ -59,7 +59,7 @@
59 """59 """
6060
61 def get_format(self):61 def get_format(self):
62 return bzrdir.format_registry.make_bzrdir(self.format_name)62 return controldir.format_registry.make_bzrdir(self.format_name)
6363
64 def test_attribute__fetch_order(self):64 def test_attribute__fetch_order(self):
65 """Packs do not need ordered data retrieval."""65 """Packs do not need ordered data retrieval."""
@@ -869,7 +869,7 @@
869 super(TestPackRepositoryStacking, self).setUp()869 super(TestPackRepositoryStacking, self).setUp()
870870
871 def get_format(self):871 def get_format(self):
872 return bzrdir.format_registry.make_bzrdir(self.format_name)872 return controldir.format_registry.make_bzrdir(self.format_name)
873873
874 def test_stack_checks_rich_root_compatibility(self):874 def test_stack_checks_rich_root_compatibility(self):
875 # early versions of the packing code relied on pack internals to875 # early versions of the packing code relied on pack internals to
@@ -1000,7 +1000,7 @@
1000class TestKeyDependencies(TestCaseWithTransport):1000class TestKeyDependencies(TestCaseWithTransport):
10011001
1002 def get_format(self):1002 def get_format(self):
1003 return bzrdir.format_registry.make_bzrdir(self.format_name)1003 return controldir.format_registry.make_bzrdir(self.format_name)
10041004
1005 def create_source_and_target(self):1005 def create_source_and_target(self):
1006 builder = self.make_branch_builder('source', format=self.get_format())1006 builder = self.make_branch_builder('source', format=self.get_format())
@@ -1085,7 +1085,7 @@
1085 self.hpss_calls.append(params.method)1085 self.hpss_calls.append(params.method)
10861086
1087 def get_format(self):1087 def get_format(self):
1088 return bzrdir.format_registry.make_bzrdir(self.format_name)1088 return controldir.format_registry.make_bzrdir(self.format_name)
10891089
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):
1091 # Make local and remote repos1091 # Make local and remote repos
@@ -1093,7 +1093,7 @@
1093 tree = self.make_branch_and_tree('local', format=format)1093 tree = self.make_branch_and_tree('local', format=format)
1094 self.make_branch_and_tree('remote', format=format)1094 self.make_branch_and_tree('remote', format=format)
1095 remote_branch_url = self.smart_server.get_url() + 'remote'1095 remote_branch_url = self.smart_server.get_url() + 'remote'
1096 remote_branch = bzrdir.BzrDir.open(remote_branch_url).open_branch()1096 remote_branch = controldir.ControlDir.open(remote_branch_url).open_branch()
1097 # Make 9 local revisions, and push them one at a time to the remote1097 # Make 9 local revisions, and push them one at a time to the remote
1098 # repo to produce 9 pack files.1098 # repo to produce 9 pack files.
1099 for x in range(9):1099 for x in range(9):
11001100
=== modified file 'bzrlib/tests/per_repository/__init__.py'
--- bzrlib/tests/per_repository/__init__.py 2011-10-10 14:03:32 +0000
+++ bzrlib/tests/per_repository/__init__.py 2012-03-06 18:30:24 +0000
@@ -25,7 +25,6 @@
25"""25"""
2626
27from bzrlib import (27from bzrlib import (
28 bzrdir,
29 repository,28 repository,
30 )29 )
31from bzrlib.remote import RemoteRepositoryFormat30from bzrlib.remote import RemoteRepositoryFormat
3231
=== modified file 'bzrlib/tests/per_repository/test_fetch.py'
--- bzrlib/tests/per_repository/test_fetch.py 2012-01-30 14:18:22 +0000
+++ bzrlib/tests/per_repository/test_fetch.py 2012-03-06 18:30:24 +0000
@@ -17,7 +17,7 @@
17"""Tests for fetch between repositories of the same type."""17"""Tests for fetch between repositories of the same type."""
1818
19from bzrlib import (19from bzrlib import (
20 bzrdir,20 controldir,
21 errors,21 errors,
22 gpg,22 gpg,
23 remote,23 remote,
@@ -67,7 +67,7 @@
67 tree_a.add('foo', 'file1')67 tree_a.add('foo', 'file1')
68 tree_a.commit('rev1', rev_id='rev1')68 tree_a.commit('rev1', rev_id='rev1')
69 # create a knit-3 based format to fetch into69 # create a knit-3 based format to fetch into
70 f = bzrdir.format_registry.make_bzrdir('development-subtree')70 f = controldir.format_registry.make_bzrdir('development-subtree')
71 try:71 try:
72 format = tree_a.branch.repository._format72 format = tree_a.branch.repository._format
73 format.check_conversion_target(f.repository_format)73 format.check_conversion_target(f.repository_format)
7474
=== modified file 'bzrlib/tests/per_repository/test_has_same_location.py'
--- bzrlib/tests/per_repository/test_has_same_location.py 2011-08-19 22:34:02 +0000
+++ bzrlib/tests/per_repository/test_has_same_location.py 2012-03-06 18:30:24 +0000
@@ -17,7 +17,7 @@
17"""Tests for implementations of Repository.has_same_location."""17"""Tests for implementations of Repository.has_same_location."""
1818
19from bzrlib import (19from bzrlib import (
20 bzrdir,20 controldir,
21 transport,21 transport,
22 )22 )
23from bzrlib.remote import (23from bzrlib.remote import (
@@ -119,7 +119,7 @@
119 self.get_vfs_only_url()).delete_tree('other')119 self.get_vfs_only_url()).delete_tree('other')
120 other_repo = self.make_repository('other', format='knit')120 other_repo = self.make_repository('other', format='knit')
121 # Make sure the other_repo is not a RemoteRepository.121 # Make sure the other_repo is not a RemoteRepository.
122 other_bzrdir = bzrdir.BzrDir.open(self.get_vfs_only_url('other'))122 other_bzrdir = controldir.ControlDir.open(self.get_vfs_only_url('other'))
123 other_repo = other_bzrdir.open_repository()123 other_repo = other_bzrdir.open_repository()
124 self.assertDifferentRepo(repo, other_repo)124 self.assertDifferentRepo(repo, other_repo)
125125
126126
=== modified file 'bzrlib/tests/per_repository_reference/__init__.py'
--- bzrlib/tests/per_repository_reference/__init__.py 2011-10-01 11:54:46 +0000
+++ bzrlib/tests/per_repository_reference/__init__.py 2012-03-06 18:30:24 +0000
@@ -27,7 +27,7 @@
27 remote,27 remote,
28 urlutils,28 urlutils,
29 )29 )
30from bzrlib.bzrdir import BzrDir30from bzrlib.controldir import ControlDir
31from bzrlib.tests import multiply_tests31from bzrlib.tests import multiply_tests
32from bzrlib.tests.per_repository import (32from bzrlib.tests.per_repository import (
33 all_repository_format_scenarios,33 all_repository_format_scenarios,
@@ -49,7 +49,7 @@
4949
50 def readonly_repository(self, repo):50 def readonly_repository(self, repo):
51 relpath = urlutils.basename(repo.bzrdir.user_url.rstrip('/'))51 relpath = urlutils.basename(repo.bzrdir.user_url.rstrip('/'))
52 return BzrDir.open_from_transport(52 return ControlDir.open_from_transport(
53 self.get_readonly_transport(relpath)).open_repository()53 self.get_readonly_transport(relpath)).open_repository()
5454
5555
5656
=== modified file 'bzrlib/tests/per_repository_vf/test_reconcile.py'
--- bzrlib/tests/per_repository_vf/test_reconcile.py 2011-10-01 11:36:04 +0000
+++ bzrlib/tests/per_repository_vf/test_reconcile.py 2012-03-06 18:30:24 +0000
@@ -17,7 +17,10 @@
17"""Tests for reconciliation of repositories."""17"""Tests for reconciliation of repositories."""
1818
19import bzrlib19import bzrlib
20from bzrlib import errors20from bzrlib import (
21 errors,
22 )
23from bzrlib.bzrdir import BzrDir
21from bzrlib.inventory import Inventory24from bzrlib.inventory import Inventory
22from bzrlib.reconcile import reconcile, Reconciler25from bzrlib.reconcile import reconcile, Reconciler
23from bzrlib.revision import Revision26from bzrlib.revision import Revision
@@ -135,14 +138,14 @@
135 # a inventory with a ghost that can be corrected now.138 # a inventory with a ghost that can be corrected now.
136 t.copy_tree('inventory_one_ghost', 'inventory_ghost_present')139 t.copy_tree('inventory_one_ghost', 'inventory_ghost_present')
137 bzrdir_url = self.get_url('inventory_ghost_present')140 bzrdir_url = self.get_url('inventory_ghost_present')
138 bzrdir = bzrlib.bzrdir.BzrDir.open(bzrdir_url)141 bzrdir = BzrDir.open(bzrdir_url)
139 repo = bzrdir.open_repository()142 repo = bzrdir.open_repository()
140 add_commit(repo, 'the_ghost', [])143 add_commit(repo, 'the_ghost', [])
141144
142 def checkEmptyReconcile(self, **kwargs):145 def checkEmptyReconcile(self, **kwargs):
143 """Check a reconcile on an empty repository."""146 """Check a reconcile on an empty repository."""
144 self.make_repository('empty')147 self.make_repository('empty')
145 d = bzrlib.bzrdir.BzrDir.open(self.get_url('empty'))148 d = BzrDir.open(self.get_url('empty'))
146 # calling on a empty repository should do nothing149 # calling on a empty repository should do nothing
147 reconciler = d.find_repository().reconcile(**kwargs)150 reconciler = d.find_repository().reconcile(**kwargs)
148 # no inconsistent parents should have been found151 # no inconsistent parents should have been found
@@ -167,7 +170,7 @@
167 def test_convenience_reconcile_inventory_without_revision_reconcile(self):170 def test_convenience_reconcile_inventory_without_revision_reconcile(self):
168 # smoke test for the all in one ui tool171 # smoke test for the all in one ui tool
169 bzrdir_url = self.get_url('inventory_without_revision')172 bzrdir_url = self.get_url('inventory_without_revision')
170 bzrdir = bzrlib.bzrdir.BzrDir.open(bzrdir_url)173 bzrdir = BzrDir.open(bzrdir_url)
171 repo = bzrdir.open_repository()174 repo = bzrdir.open_repository()
172 if not repo._reconcile_does_inventory_gc:175 if not repo._reconcile_does_inventory_gc:
173 raise TestSkipped('Irrelevant test')176 raise TestSkipped('Irrelevant test')
@@ -179,7 +182,7 @@
179 def test_reweave_inventory_without_revision(self):182 def test_reweave_inventory_without_revision(self):
180 # an excess inventory on its own is only reconciled by using thorough183 # an excess inventory on its own is only reconciled by using thorough
181 d_url = self.get_url('inventory_without_revision')184 d_url = self.get_url('inventory_without_revision')
182 d = bzrlib.bzrdir.BzrDir.open(d_url)185 d = BzrDir.open(d_url)
183 repo = d.open_repository()186 repo = d.open_repository()
184 if not repo._reconcile_does_inventory_gc:187 if not repo._reconcile_does_inventory_gc:
185 raise TestSkipped('Irrelevant test')188 raise TestSkipped('Irrelevant test')
@@ -232,7 +235,7 @@
232 # smoke test for the all in one Reconciler class,235 # smoke test for the all in one Reconciler class,
233 # other tests use the lower level repo.reconcile()236 # other tests use the lower level repo.reconcile()
234 d_url = self.get_url('inventory_without_revision_and_ghost')237 d_url = self.get_url('inventory_without_revision_and_ghost')
235 d = bzrlib.bzrdir.BzrDir.open(d_url)238 d = BzrDir.open(d_url)
236 if not d.open_repository()._reconcile_does_inventory_gc:239 if not d.open_repository()._reconcile_does_inventory_gc:
237 raise TestSkipped('Irrelevant test')240 raise TestSkipped('Irrelevant test')
238 def reconcile():241 def reconcile():
@@ -244,7 +247,7 @@
244 def test_reweave_inventory_without_revision_and_ghost(self):247 def test_reweave_inventory_without_revision_and_ghost(self):
245 # actual low level test.248 # actual low level test.
246 d_url = self.get_url('inventory_without_revision_and_ghost')249 d_url = self.get_url('inventory_without_revision_and_ghost')
247 d = bzrlib.bzrdir.BzrDir.open(d_url)250 d = BzrDir.open(d_url)
248 repo = d.open_repository()251 repo = d.open_repository()
249 if not repo._reconcile_does_inventory_gc:252 if not repo._reconcile_does_inventory_gc:
250 raise TestSkipped('Irrelevant test')253 raise TestSkipped('Irrelevant test')
@@ -254,7 +257,7 @@
254 thorough=True)257 thorough=True)
255258
256 def test_reweave_inventory_preserves_a_revision_with_ghosts(self):259 def test_reweave_inventory_preserves_a_revision_with_ghosts(self):
257 d = bzrlib.bzrdir.BzrDir.open(self.get_url('inventory_one_ghost'))260 d = BzrDir.open(self.get_url('inventory_one_ghost'))
258 reconciler = d.open_repository().reconcile(thorough=True)261 reconciler = d.open_repository().reconcile(thorough=True)
259 # no inconsistent parents should have been found:262 # no inconsistent parents should have been found:
260 # the lack of a parent for ghost is normal263 # the lack of a parent for ghost is normal
@@ -267,7 +270,7 @@
267 self.assertThat(['ghost', 'the_ghost'], MatchesAncestry(repo, 'ghost'))270 self.assertThat(['ghost', 'the_ghost'], MatchesAncestry(repo, 'ghost'))
268271
269 def test_reweave_inventory_fixes_ancestryfor_a_present_ghost(self):272 def test_reweave_inventory_fixes_ancestryfor_a_present_ghost(self):
270 d = bzrlib.bzrdir.BzrDir.open(self.get_url('inventory_ghost_present'))273 d = BzrDir.open(self.get_url('inventory_ghost_present'))
271 repo = d.open_repository()274 repo = d.open_repository()
272 m = MatchesAncestry(repo, 'ghost')275 m = MatchesAncestry(repo, 'ghost')
273 if m.match(['the_ghost', 'ghost']) is None:276 if m.match(['the_ghost', 'ghost']) is None:
274277
=== modified file 'bzrlib/tests/per_repository_vf/test_write_group.py'
--- bzrlib/tests/per_repository_vf/test_write_group.py 2011-05-09 20:08:47 +0000
+++ bzrlib/tests/per_repository_vf/test_write_group.py 2012-03-06 18:30:24 +0000
@@ -20,7 +20,7 @@
2020
21from bzrlib import (21from bzrlib import (
22 branch,22 branch,
23 bzrdir,23 controldir,
24 errors,24 errors,
25 memorytree,25 memorytree,
26 remote,26 remote,
@@ -87,7 +87,8 @@
87 # repository, but the default format is unstackble. So explicitly87 # repository, but the default format is unstackble. So explicitly
88 # make a stackable real repository and use that.88 # make a stackable real repository and use that.
89 repo = self.make_repository(relpath, format='1.9')89 repo = self.make_repository(relpath, format='1.9')
90 repo = bzrdir.BzrDir.open(self.get_url(relpath)).open_repository()90 dir = controldir.ControlDir.open(self.get_url(relpath))
91 repo = dir.open_repository()
91 else:92 else:
92 repo = self.make_repository(relpath)93 repo = self.make_repository(relpath)
93 if not repo._format.supports_external_lookups:94 if not repo._format.supports_external_lookups:
9495
=== modified file 'bzrlib/tests/per_workingtree/test_commit.py'
--- bzrlib/tests/per_workingtree/test_commit.py 2012-01-25 21:13:15 +0000
+++ bzrlib/tests/per_workingtree/test_commit.py 2012-03-06 18:30:24 +0000
@@ -19,8 +19,8 @@
1919
20from bzrlib import (20from bzrlib import (
21 branch,21 branch,
22 bzrdir,
23 conflicts,22 conflicts,
23 controldir,
24 errors,24 errors,
25 mutabletree,25 mutabletree,
26 osutils,26 osutils,
@@ -264,7 +264,7 @@
264 del master264 del master
265 # check its corrupted.265 # check its corrupted.
266 self.assertRaises(errors.UnknownFormatError,266 self.assertRaises(errors.UnknownFormatError,
267 bzrdir.BzrDir.open,267 controldir.ControlDir.open,
268 'master')268 'master')
269 tree.commit('foo', rev_id='foo', local=True)269 tree.commit('foo', rev_id='foo', local=True)
270270
271271
=== modified file 'bzrlib/tests/per_workingtree/test_content_filters.py'
--- bzrlib/tests/per_workingtree/test_content_filters.py 2010-12-02 09:23:10 +0000
+++ bzrlib/tests/per_workingtree/test_content_filters.py 2012-03-06 18:30:24 +0000
@@ -18,7 +18,7 @@
1818
19import os19import os
2020
21from bzrlib.bzrdir import BzrDir21from bzrlib.controldir import ControlDir
22from bzrlib.filters import ContentFilter22from bzrlib.filters import ContentFilter
23from bzrlib.switch import switch23from bzrlib.switch import switch
24from bzrlib.workingtree import WorkingTree24from bzrlib.workingtree import WorkingTree
@@ -330,7 +330,7 @@
330 self.assertFileEqual("fOO tXT", 'checkout/file1.txt')330 self.assertFileEqual("fOO tXT", 'checkout/file1.txt')
331331
332 # Switch it to branch-b and check the tree is updated332 # Switch it to branch-b and check the tree is updated
333 checkout_control_dir = BzrDir.open_containing('checkout')[0]333 checkout_control_dir = ControlDir.open_containing('checkout')[0]
334 switch(checkout_control_dir, source.branch)334 switch(checkout_control_dir, source.branch)
335 self.assertFileEqual("fOO rocks!", 'checkout/file1.txt')335 self.assertFileEqual("fOO rocks!", 'checkout/file1.txt')
336 self.assertFileEqual("hELLO wORLD", 'checkout/file4.txt')336 self.assertFileEqual("hELLO wORLD", 'checkout/file4.txt')
337337
=== modified file 'bzrlib/tests/per_workingtree/test_workingtree.py'
--- bzrlib/tests/per_workingtree/test_workingtree.py 2012-01-28 17:24:34 +0000
+++ bzrlib/tests/per_workingtree/test_workingtree.py 2012-03-06 18:30:24 +0000
@@ -24,6 +24,7 @@
24 branch,24 branch,
25 bzrdir,25 bzrdir,
26 config,26 config,
27 controldir,
27 errors,28 errors,
28 osutils,29 osutils,
29 revision as _mod_revision,30 revision as _mod_revision,
@@ -719,7 +720,7 @@
719 tree.add(['bloo', 'blo'])720 tree.add(['bloo', 'blo'])
720 tree.commit("blah", allow_pointless=False)721 tree.commit("blah", allow_pointless=False)
721 base = tree.branch.repository.revision_tree(tree.last_revision())722 base = tree.branch.repository.revision_tree(tree.last_revision())
722 bzrdir.BzrDir.open("mine").sprout("other")723 controldir.ControlDir.open("mine").sprout("other")
723 with file('other/bloo', 'wb') as f: f.write('two')724 with file('other/bloo', 'wb') as f: f.write('two')
724 othertree = WorkingTree.open('other')725 othertree = WorkingTree.open('other')
725 othertree.commit('blah', allow_pointless=False)726 othertree.commit('blah', allow_pointless=False)
726727
=== modified file 'bzrlib/tests/test_branch.py'
--- bzrlib/tests/test_branch.py 2012-02-14 17:22:37 +0000
+++ bzrlib/tests/test_branch.py 2012-03-06 18:30:24 +0000
@@ -28,6 +28,7 @@
28 branch as _mod_branch,28 branch as _mod_branch,
29 bzrdir,29 bzrdir,
30 config,30 config,
31 controldir,
31 errors,32 errors,
32 symbol_versioning,33 symbol_versioning,
33 tests,34 tests,
@@ -244,7 +245,7 @@
244 # but open_downlevel will work245 # but open_downlevel will work
245 self.assertEqual(246 self.assertEqual(
246 format.open(dir),247 format.open(dir),
247 bzrdir.BzrDir.open(self.get_url()).open_branch(unsupported=True))248 controldir.ControlDir.open(self.get_url()).open_branch(unsupported=True))
248 # unregister the format249 # unregister the format
249 self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)),250 self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)),
250 _mod_branch.BranchFormat.unregister_format, format)251 _mod_branch.BranchFormat.unregister_format, format)
@@ -488,7 +489,7 @@
488489
489 def make_branch(self, location, format=None):490 def make_branch(self, location, format=None):
490 if format is None:491 if format is None:
491 format = bzrdir.format_registry.make_bzrdir('1.9')492 format = controldir.format_registry.make_bzrdir('1.9')
492 format.set_branch_format(_mod_branch.BzrBranchFormat8())493 format.set_branch_format(_mod_branch.BzrBranchFormat8())
493 return tests.TestCaseWithTransport.make_branch(494 return tests.TestCaseWithTransport.make_branch(
494 self, location, format=format)495 self, location, format=format)
495496
=== modified file 'bzrlib/tests/test_bzrdir.py'
--- bzrlib/tests/test_bzrdir.py 2012-02-06 11:36:02 +0000
+++ bzrlib/tests/test_bzrdir.py 2012-03-06 18:30:24 +0000
@@ -170,18 +170,18 @@
170 self.assertNotContainsRe(new, 'hidden')170 self.assertNotContainsRe(new, 'hidden')
171171
172 def test_set_default_repository(self):172 def test_set_default_repository(self):
173 default_factory = bzrdir.format_registry.get('default')173 default_factory = controldir.format_registry.get('default')
174 old_default = [k for k, v in bzrdir.format_registry.iteritems()174 old_default = [k for k, v in controldir.format_registry.iteritems()
175 if v == default_factory and k != 'default'][0]175 if v == default_factory and k != 'default'][0]
176 bzrdir.format_registry.set_default_repository('dirstate-with-subtree')176 controldir.format_registry.set_default_repository('dirstate-with-subtree')
177 try:177 try:
178 self.assertIs(bzrdir.format_registry.get('dirstate-with-subtree'),178 self.assertIs(controldir.format_registry.get('dirstate-with-subtree'),
179 bzrdir.format_registry.get('default'))179 controldir.format_registry.get('default'))
180 self.assertIs(180 self.assertIs(
181 repository.format_registry.get_default().__class__,181 repository.format_registry.get_default().__class__,
182 knitrepo.RepositoryFormatKnit3)182 knitrepo.RepositoryFormatKnit3)
183 finally:183 finally:
184 bzrdir.format_registry.set_default_repository(old_default)184 controldir.format_registry.set_default_repository(old_default)
185185
186 def test_aliases(self):186 def test_aliases(self):
187 a_registry = controldir.ControlDirFormatRegistry()187 a_registry = controldir.ControlDirFormatRegistry()
@@ -212,21 +212,21 @@
212 """A sample BzrDir implementation to allow testing static methods."""212 """A sample BzrDir implementation to allow testing static methods."""
213213
214 def create_repository(self, shared=False):214 def create_repository(self, shared=False):
215 """See BzrDir.create_repository."""215 """See ControlDir.create_repository."""
216 return "A repository"216 return "A repository"
217217
218 def open_repository(self):218 def open_repository(self):
219 """See BzrDir.open_repository."""219 """See ControlDir.open_repository."""
220 return SampleRepository(self)220 return SampleRepository(self)
221221
222 def create_branch(self, name=None):222 def create_branch(self, name=None):
223 """See BzrDir.create_branch."""223 """See ControlDir.create_branch."""
224 if name is not None:224 if name is not None:
225 raise NoColocatedBranchSupport(self)225 raise NoColocatedBranchSupport(self)
226 return SampleBranch(self)226 return SampleBranch(self)
227227
228 def create_workingtree(self):228 def create_workingtree(self):
229 """See BzrDir.create_workingtree."""229 """See ControlDir.create_workingtree."""
230 return "A tree"230 return "A tree"
231231
232232
@@ -337,7 +337,7 @@
337 def test_create_branch_and_repo_under_shared(self):337 def test_create_branch_and_repo_under_shared(self):
338 # creating a branch and repo in a shared repo uses the338 # creating a branch and repo in a shared repo uses the
339 # shared repository339 # shared repository
340 format = bzrdir.format_registry.make_bzrdir('knit')340 format = controldir.format_registry.make_bzrdir('knit')
341 self.make_repository('.', shared=True, format=format)341 self.make_repository('.', shared=True, format=format)
342 branch = bzrdir.BzrDir.create_branch_and_repo(342 branch = bzrdir.BzrDir.create_branch_and_repo(
343 self.get_url('child'), format=format)343 self.get_url('child'), format=format)
@@ -347,7 +347,7 @@
347 def test_create_branch_and_repo_under_shared_force_new(self):347 def test_create_branch_and_repo_under_shared_force_new(self):
348 # creating a branch and repo in a shared repo can be forced to348 # creating a branch and repo in a shared repo can be forced to
349 # make a new repo349 # make a new repo
350 format = bzrdir.format_registry.make_bzrdir('knit')350 format = controldir.format_registry.make_bzrdir('knit')
351 self.make_repository('.', shared=True, format=format)351 self.make_repository('.', shared=True, format=format)
352 branch = bzrdir.BzrDir.create_branch_and_repo(self.get_url('child'),352 branch = bzrdir.BzrDir.create_branch_and_repo(self.get_url('child'),
353 force_new_repo=True,353 force_new_repo=True,
@@ -367,7 +367,7 @@
367367
368 def test_create_standalone_working_tree_under_shared_repo(self):368 def test_create_standalone_working_tree_under_shared_repo(self):
369 # create standalone working tree always makes a repo.369 # create standalone working tree always makes a repo.
370 format = bzrdir.format_registry.make_bzrdir('knit')370 format = controldir.format_registry.make_bzrdir('knit')
371 self.make_repository('.', shared=True, format=format)371 self.make_repository('.', shared=True, format=format)
372 # note this is deliberately readonly, as this failure should372 # note this is deliberately readonly, as this failure should
373 # occur before any writes.373 # occur before any writes.
@@ -380,14 +380,14 @@
380380
381 def test_create_branch_convenience(self):381 def test_create_branch_convenience(self):
382 # outside a repo the default convenience output is a repo+branch_tree382 # outside a repo the default convenience output is a repo+branch_tree
383 format = bzrdir.format_registry.make_bzrdir('knit')383 format = controldir.format_registry.make_bzrdir('knit')
384 branch = bzrdir.BzrDir.create_branch_convenience('.', format=format)384 branch = bzrdir.BzrDir.create_branch_convenience('.', format=format)
385 branch.bzrdir.open_workingtree()385 branch.bzrdir.open_workingtree()
386 branch.bzrdir.open_repository()386 branch.bzrdir.open_repository()
387387
388 def test_create_branch_convenience_possible_transports(self):388 def test_create_branch_convenience_possible_transports(self):
389 """Check that the optional 'possible_transports' is recognized"""389 """Check that the optional 'possible_transports' is recognized"""
390 format = bzrdir.format_registry.make_bzrdir('knit')390 format = controldir.format_registry.make_bzrdir('knit')
391 t = self.get_transport()391 t = self.get_transport()
392 branch = bzrdir.BzrDir.create_branch_convenience(392 branch = bzrdir.BzrDir.create_branch_convenience(
393 '.', format=format, possible_transports=[t])393 '.', format=format, possible_transports=[t])
@@ -398,7 +398,7 @@
398 """Creating a branch at the root of a fs should work."""398 """Creating a branch at the root of a fs should work."""
399 self.vfs_transport_factory = memory.MemoryServer399 self.vfs_transport_factory = memory.MemoryServer
400 # outside a repo the default convenience output is a repo+branch_tree400 # outside a repo the default convenience output is a repo+branch_tree
401 format = bzrdir.format_registry.make_bzrdir('knit')401 format = controldir.format_registry.make_bzrdir('knit')
402 branch = bzrdir.BzrDir.create_branch_convenience(self.get_url(),402 branch = bzrdir.BzrDir.create_branch_convenience(self.get_url(),
403 format=format)403 format=format)
404 self.assertRaises(errors.NoWorkingTree,404 self.assertRaises(errors.NoWorkingTree,
@@ -408,7 +408,7 @@
408 def test_create_branch_convenience_under_shared_repo(self):408 def test_create_branch_convenience_under_shared_repo(self):
409 # inside a repo the default convenience output is a branch+ follow the409 # inside a repo the default convenience output is a branch+ follow the
410 # repo tree policy410 # repo tree policy
411 format = bzrdir.format_registry.make_bzrdir('knit')411 format = controldir.format_registry.make_bzrdir('knit')
412 self.make_repository('.', shared=True, format=format)412 self.make_repository('.', shared=True, format=format)
413 branch = bzrdir.BzrDir.create_branch_convenience('child',413 branch = bzrdir.BzrDir.create_branch_convenience('child',
414 format=format)414 format=format)
@@ -419,7 +419,7 @@
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):
420 # inside a repo the default convenience output is a branch+ follow the420 # inside a repo the default convenience output is a branch+ follow the
421 # repo tree policy but we can override that421 # repo tree policy but we can override that
422 format = bzrdir.format_registry.make_bzrdir('knit')422 format = controldir.format_registry.make_bzrdir('knit')
423 self.make_repository('.', shared=True, format=format)423 self.make_repository('.', shared=True, format=format)
424 branch = bzrdir.BzrDir.create_branch_convenience('child',424 branch = bzrdir.BzrDir.create_branch_convenience('child',
425 force_new_tree=False, format=format)425 force_new_tree=False, format=format)
@@ -431,7 +431,7 @@
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):
432 # inside a repo the default convenience output is a branch+ follow the432 # inside a repo the default convenience output is a branch+ follow the
433 # repo tree policy433 # repo tree policy
434 format = bzrdir.format_registry.make_bzrdir('knit')434 format = controldir.format_registry.make_bzrdir('knit')
435 repo = self.make_repository('.', shared=True, format=format)435 repo = self.make_repository('.', shared=True, format=format)
436 repo.set_make_working_trees(False)436 repo.set_make_working_trees(False)
437 branch = bzrdir.BzrDir.create_branch_convenience('child',437 branch = bzrdir.BzrDir.create_branch_convenience('child',
@@ -444,7 +444,7 @@
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):
445 # inside a repo the default convenience output is a branch+ follow the445 # inside a repo the default convenience output is a branch+ follow the
446 # repo tree policy but we can override that446 # repo tree policy but we can override that
447 format = bzrdir.format_registry.make_bzrdir('knit')447 format = controldir.format_registry.make_bzrdir('knit')
448 repo = self.make_repository('.', shared=True, format=format)448 repo = self.make_repository('.', shared=True, format=format)
449 repo.set_make_working_trees(False)449 repo.set_make_working_trees(False)
450 branch = bzrdir.BzrDir.create_branch_convenience('child',450 branch = bzrdir.BzrDir.create_branch_convenience('child',
@@ -456,7 +456,7 @@
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):
457 # inside a repo the default convenience output is overridable to give457 # inside a repo the default convenience output is overridable to give
458 # repo+branch+tree458 # repo+branch+tree
459 format = bzrdir.format_registry.make_bzrdir('knit')459 format = controldir.format_registry.make_bzrdir('knit')
460 self.make_repository('.', shared=True, format=format)460 self.make_repository('.', shared=True, format=format)
461 branch = bzrdir.BzrDir.create_branch_convenience('child',461 branch = bzrdir.BzrDir.create_branch_convenience('child',
462 force_new_repo=True, format=format)462 force_new_repo=True, format=format)
@@ -523,7 +523,7 @@
523 # general case.523 # general case.
524 trunk = self.make_branch('trunk', format='1.9')524 trunk = self.make_branch('trunk', format='1.9')
525 t = self.get_transport('stacked')525 t = self.get_transport('stacked')
526 old_fmt = bzrdir.format_registry.make_bzrdir('pack-0.92')526 old_fmt = controldir.format_registry.make_bzrdir('pack-0.92')
527 repo_name = old_fmt.repository_format.network_name()527 repo_name = old_fmt.repository_format.network_name()
528 # Should end up with a 1.9 format (stackable)528 # Should end up with a 1.9 format (stackable)
529 repo, control, require_stacking, repo_policy = \529 repo, control, require_stacking, repo_policy = \
@@ -1015,13 +1015,13 @@
1015 Metadirs should compare equal iff they have the same repo, branch and1015 Metadirs should compare equal iff they have the same repo, branch and
1016 tree formats.1016 tree formats.
1017 """1017 """
1018 mydir = bzrdir.format_registry.make_bzrdir('knit')1018 mydir = controldir.format_registry.make_bzrdir('knit')
1019 self.assertEqual(mydir, mydir)1019 self.assertEqual(mydir, mydir)
1020 self.assertFalse(mydir != mydir)1020 self.assertFalse(mydir != mydir)
1021 otherdir = bzrdir.format_registry.make_bzrdir('knit')1021 otherdir = controldir.format_registry.make_bzrdir('knit')
1022 self.assertEqual(otherdir, mydir)1022 self.assertEqual(otherdir, mydir)
1023 self.assertFalse(otherdir != mydir)1023 self.assertFalse(otherdir != mydir)
1024 otherdir2 = bzrdir.format_registry.make_bzrdir('development-subtree')1024 otherdir2 = controldir.format_registry.make_bzrdir('development-subtree')
1025 self.assertNotEqual(otherdir2, mydir)1025 self.assertNotEqual(otherdir2, mydir)
1026 self.assertFalse(otherdir2 == mydir)1026 self.assertFalse(otherdir2 == mydir)
10271027
@@ -1039,14 +1039,14 @@
10391039
1040 def test_needs_conversion_different_working_tree(self):1040 def test_needs_conversion_different_working_tree(self):
1041 # meta1dirs need an conversion if any element is not the default.1041 # meta1dirs need an conversion if any element is not the default.
1042 new_format = bzrdir.format_registry.make_bzrdir('dirstate')1042 new_format = controldir.format_registry.make_bzrdir('dirstate')
1043 tree = self.make_branch_and_tree('tree', format='knit')1043 tree = self.make_branch_and_tree('tree', format='knit')
1044 self.assertTrue(tree.bzrdir.needs_format_conversion(1044 self.assertTrue(tree.bzrdir.needs_format_conversion(
1045 new_format))1045 new_format))
10461046
1047 def test_initialize_on_format_uses_smart_transport(self):1047 def test_initialize_on_format_uses_smart_transport(self):
1048 self.setup_smart_server_with_call_log()1048 self.setup_smart_server_with_call_log()
1049 new_format = bzrdir.format_registry.make_bzrdir('dirstate')1049 new_format = controldir.format_registry.make_bzrdir('dirstate')
1050 transport = self.get_transport('target')1050 transport = self.get_transport('target')
1051 transport.ensure_base()1051 transport.ensure_base()
1052 self.reset_smart_call_log()1052 self.reset_smart_call_log()
@@ -1070,7 +1070,7 @@
10701070
1071 def test_create_branch_convenience(self):1071 def test_create_branch_convenience(self):
1072 # outside a repo the default convenience output is a repo+branch_tree1072 # outside a repo the default convenience output is a repo+branch_tree
1073 format = bzrdir.format_registry.make_bzrdir('knit')1073 format = controldir.format_registry.make_bzrdir('knit')
1074 branch = bzrdir.BzrDir.create_branch_convenience(1074 branch = bzrdir.BzrDir.create_branch_convenience(
1075 self.get_url('foo'), format=format)1075 self.get_url('foo'), format=format)
1076 self.assertRaises(errors.NoWorkingTree,1076 self.assertRaises(errors.NoWorkingTree,
@@ -1079,7 +1079,7 @@
10791079
1080 def test_create_branch_convenience_force_tree_not_local_fails(self):1080 def test_create_branch_convenience_force_tree_not_local_fails(self):
1081 # outside a repo the default convenience output is a repo+branch_tree1081 # outside a repo the default convenience output is a repo+branch_tree
1082 format = bzrdir.format_registry.make_bzrdir('knit')1082 format = controldir.format_registry.make_bzrdir('knit')
1083 self.assertRaises(errors.NotLocalUrl,1083 self.assertRaises(errors.NotLocalUrl,
1084 bzrdir.BzrDir.create_branch_convenience,1084 bzrdir.BzrDir.create_branch_convenience,
1085 self.get_url('foo'),1085 self.get_url('foo'),
@@ -1090,7 +1090,7 @@
10901090
1091 def test_clone(self):1091 def test_clone(self):
1092 # clone into a nonlocal path works1092 # clone into a nonlocal path works
1093 format = bzrdir.format_registry.make_bzrdir('knit')1093 format = controldir.format_registry.make_bzrdir('knit')
1094 branch = bzrdir.BzrDir.create_branch_convenience('local',1094 branch = bzrdir.BzrDir.create_branch_convenience('local',
1095 format=format)1095 format=format)
1096 branch.bzrdir.open_workingtree()1096 branch.bzrdir.open_workingtree()
10971097
=== modified file 'bzrlib/tests/test_clean_tree.py'
--- bzrlib/tests/test_clean_tree.py 2011-05-26 21:02:47 +0000
+++ bzrlib/tests/test_clean_tree.py 2012-03-06 18:30:24 +0000
@@ -19,11 +19,10 @@
19import os19import os
20import shutil20import shutil
21import sys21import sys
22import types
2322
24from bzrlib import tests, ui23from bzrlib import tests, ui
25from bzrlib.bzrdir import (24from bzrlib.controldir import (
26 BzrDir,25 ControlDir,
27 )26 )
28from bzrlib.clean_tree import (27from bzrlib.clean_tree import (
29 clean_tree,28 clean_tree,
@@ -43,7 +42,7 @@
43 if has_symlinks() is False:42 if has_symlinks() is False:
44 return43 return
45 os.mkdir('branch')44 os.mkdir('branch')
46 BzrDir.create_standalone_workingtree('branch')45 ControlDir.create_standalone_workingtree('branch')
47 os.symlink(os.path.realpath('no-die-please'), 'branch/die-please')46 os.symlink(os.path.realpath('no-die-please'), 'branch/die-please')
48 os.mkdir('no-die-please')47 os.mkdir('no-die-please')
49 self.assertPathExists('branch/die-please')48 self.assertPathExists('branch/die-please')
@@ -56,7 +55,7 @@
56 def test_iter_deletable(self):55 def test_iter_deletable(self):
57 """Files are selected for deletion appropriately"""56 """Files are selected for deletion appropriately"""
58 os.mkdir('branch')57 os.mkdir('branch')
59 tree = BzrDir.create_standalone_workingtree('branch')58 tree = ControlDir.create_standalone_workingtree('branch')
60 transport = tree.bzrdir.root_transport59 transport = tree.bzrdir.root_transport
61 transport.put_bytes('.bzrignore', '*~\n*.pyc\n.bzrignore\n')60 transport.put_bytes('.bzrignore', '*~\n*.pyc\n.bzrignore\n')
62 transport.put_bytes('file.BASE', 'contents')61 transport.put_bytes('file.BASE', 'contents')
@@ -122,7 +121,7 @@
122 stderr = tests.StringIOWrapper()121 stderr = tests.StringIOWrapper()
123 ui.ui_factory = tests.TestUIFactory(stdout=stdout, stderr=stderr)122 ui.ui_factory = tests.TestUIFactory(stdout=stdout, stderr=stderr)
124123
125 BzrDir.create_standalone_workingtree('.')124 ControlDir.create_standalone_workingtree('.')
126 self.build_tree(['0foo', '1bar', '2baz', 'subdir0/'])125 self.build_tree(['0foo', '1bar', '2baz', 'subdir0/'])
127 clean_tree('.', unknown=True, no_prompt=True)126 clean_tree('.', unknown=True, no_prompt=True)
128 self.assertContainsRe(stderr.getvalue(),127 self.assertContainsRe(stderr.getvalue(),
129128
=== modified file 'bzrlib/tests/test_commit.py'
--- bzrlib/tests/test_commit.py 2012-02-14 17:22:37 +0000
+++ bzrlib/tests/test_commit.py 2012-03-06 18:30:24 +0000
@@ -19,8 +19,8 @@
1919
20import bzrlib20import bzrlib
21from bzrlib import (21from bzrlib import (
22 bzrdir,
23 config,22 config,
23 controldir,
24 errors,24 errors,
25 )25 )
26from bzrlib.branch import Branch26from bzrlib.branch import Branch
@@ -835,7 +835,7 @@
835 def test_commit_with_checkout_and_branch_sharing_repo(self):835 def test_commit_with_checkout_and_branch_sharing_repo(self):
836 repo = self.make_repository('repo', shared=True)836 repo = self.make_repository('repo', shared=True)
837 # make_branch_and_tree ignores shared repos837 # make_branch_and_tree ignores shared repos
838 branch = bzrdir.BzrDir.create_branch_convenience('repo/branch')838 branch = controldir.ControlDir.create_branch_convenience('repo/branch')
839 tree2 = branch.create_checkout('repo/tree2')839 tree2 = branch.create_checkout('repo/tree2')
840 tree2.commit('message', rev_id='rev1')840 tree2.commit('message', rev_id='rev1')
841 self.assertTrue(tree2.branch.repository.has_revision('rev1'))841 self.assertTrue(tree2.branch.repository.has_revision('rev1'))
842842
=== modified file 'bzrlib/tests/test_config.py'
--- bzrlib/tests/test_config.py 2012-02-20 17:38:11 +0000
+++ bzrlib/tests/test_config.py 2012-03-06 18:30:24 +0000
@@ -27,8 +27,8 @@
27#import bzrlib specific imports here27#import bzrlib specific imports here
28from bzrlib import (28from bzrlib import (
29 branch,29 branch,
30 bzrdir,
31 config,30 config,
31 controldir,
32 diff,32 diff,
33 errors,33 errors,
34 osutils,34 osutils,
@@ -115,7 +115,7 @@
115115
116def build_control_store(test):116def build_control_store(test):
117 build_backing_branch(test, 'branch')117 build_backing_branch(test, 'branch')
118 b = bzrdir.BzrDir.open('branch')118 b = controldir.ControlDir.open('branch')
119 return config.ControlStore(b)119 return config.ControlStore(b)
120config.test_store_builder_registry.register('control', build_control_store)120config.test_store_builder_registry.register('control', build_control_store)
121121
@@ -1142,7 +1142,7 @@
11421142
1143 def test_get_config(self):1143 def test_get_config(self):
1144 """The Branch.get_config method works properly"""1144 """The Branch.get_config method works properly"""
1145 b = bzrdir.BzrDir.create_standalone_workingtree('.').branch1145 b = controldir.ControlDir.create_standalone_workingtree('.').branch
1146 my_config = b.get_config()1146 my_config = b.get_config()
1147 self.assertIs(my_config.get_user_option('wacky'), None)1147 self.assertIs(my_config.get_user_option('wacky'), None)
1148 my_config.set_user_option('wacky', 'unlikely')1148 my_config.set_user_option('wacky', 'unlikely')
@@ -2203,7 +2203,7 @@
2203 self.assertGetHook(remote_branch._get_config(), 'file', 'branch')2203 self.assertGetHook(remote_branch._get_config(), 'file', 'branch')
22042204
2205 def test_get_hook_remote_bzrdir(self):2205 def test_get_hook_remote_bzrdir(self):
2206 remote_bzrdir = bzrdir.BzrDir.open(self.get_url('tree'))2206 remote_bzrdir = controldir.ControlDir.open(self.get_url('tree'))
2207 conf = remote_bzrdir._get_config()2207 conf = remote_bzrdir._get_config()
2208 conf.set_option('remotedir', 'file')2208 conf.set_option('remotedir', 'file')
2209 self.assertGetHook(conf, 'file', 'remotedir')2209 self.assertGetHook(conf, 'file', 'remotedir')
@@ -2231,7 +2231,7 @@
2231 def test_set_hook_remote_bzrdir(self):2231 def test_set_hook_remote_bzrdir(self):
2232 remote_branch = branch.Branch.open(self.get_url('tree'))2232 remote_branch = branch.Branch.open(self.get_url('tree'))
2233 self.addCleanup(remote_branch.lock_write().unlock)2233 self.addCleanup(remote_branch.lock_write().unlock)
2234 remote_bzrdir = bzrdir.BzrDir.open(self.get_url('tree'))2234 remote_bzrdir = controldir.ControlDir.open(self.get_url('tree'))
2235 self.assertSetHook(remote_bzrdir._get_config(), 'file', 'remotedir')2235 self.assertSetHook(remote_bzrdir._get_config(), 'file', 'remotedir')
22362236
2237 def assertLoadHook(self, expected_nb_calls, name, conf_class, *conf_args):2237 def assertLoadHook(self, expected_nb_calls, name, conf_class, *conf_args):
@@ -2254,7 +2254,7 @@
2254 self.assertLoadHook(1, 'file', remote.RemoteBranchConfig, remote_branch)2254 self.assertLoadHook(1, 'file', remote.RemoteBranchConfig, remote_branch)
22552255
2256 def test_load_hook_remote_bzrdir(self):2256 def test_load_hook_remote_bzrdir(self):
2257 remote_bzrdir = bzrdir.BzrDir.open(self.get_url('tree'))2257 remote_bzrdir = controldir.ControlDir.open(self.get_url('tree'))
2258 # The config file doesn't exist, set an option to force its creation2258 # The config file doesn't exist, set an option to force its creation
2259 conf = remote_bzrdir._get_config()2259 conf = remote_bzrdir._get_config()
2260 conf.set_option('remotedir', 'file')2260 conf.set_option('remotedir', 'file')
@@ -2285,7 +2285,7 @@
2285 def test_save_hook_remote_bzrdir(self):2285 def test_save_hook_remote_bzrdir(self):
2286 remote_branch = branch.Branch.open(self.get_url('tree'))2286 remote_branch = branch.Branch.open(self.get_url('tree'))
2287 self.addCleanup(remote_branch.lock_write().unlock)2287 self.addCleanup(remote_branch.lock_write().unlock)
2288 remote_bzrdir = bzrdir.BzrDir.open(self.get_url('tree'))2288 remote_bzrdir = controldir.ControlDir.open(self.get_url('tree'))
2289 self.assertSaveHook(remote_bzrdir._get_config())2289 self.assertSaveHook(remote_bzrdir._get_config())
22902290
22912291
22922292
=== modified file 'bzrlib/tests/test_conflicts.py'
--- bzrlib/tests/test_conflicts.py 2011-10-27 15:38:14 +0000
+++ bzrlib/tests/test_conflicts.py 2012-03-06 18:30:24 +0000
@@ -18,7 +18,6 @@
18import os18import os
1919
20from bzrlib import (20from bzrlib import (
21 bzrdir,
22 conflicts,21 conflicts,
23 errors,22 errors,
24 option,23 option,
2524
=== modified file 'bzrlib/tests/test_dirstate.py'
--- bzrlib/tests/test_dirstate.py 2012-01-30 14:18:22 +0000
+++ bzrlib/tests/test_dirstate.py 2012-03-06 18:30:24 +0000
@@ -20,7 +20,7 @@
20import tempfile20import tempfile
2121
22from bzrlib import (22from bzrlib import (
23 bzrdir,23 controldir,
24 dirstate,24 dirstate,
25 errors,25 errors,
26 inventory,26 inventory,
@@ -31,7 +31,6 @@
31 tests,31 tests,
32 workingtree_4,32 workingtree_4,
33 )33 )
34from bzrlib.transport import memory
35from bzrlib.tests import (34from bzrlib.tests import (
36 features,35 features,
37 test_osutils,36 test_osutils,
@@ -2444,7 +2443,7 @@
2444 """A minimal api to get InventoryRevisionTree to work."""2443 """A minimal api to get InventoryRevisionTree to work."""
24452444
2446 def __init__(self):2445 def __init__(self):
2447 default_format = bzrdir.format_registry.make_bzrdir('default')2446 default_format = controldir.format_registry.make_bzrdir('default')
2448 self._format = default_format.repository_format2447 self._format = default_format.repository_format
24492448
2450 def lock_read(self):2449 def lock_read(self):
24512450
=== modified file 'bzrlib/tests/test_errors.py'
--- bzrlib/tests/test_errors.py 2011-11-28 17:15:29 +0000
+++ bzrlib/tests/test_errors.py 2012-03-06 18:30:24 +0000
@@ -22,7 +22,7 @@
22import sys22import sys
2323
24from bzrlib import (24from bzrlib import (
25 bzrdir,25 controldir,
26 errors,26 errors,
27 osutils,27 osutils,
28 urlutils,28 urlutils,
@@ -207,7 +207,7 @@
207 'There is no public branch set for "%s".' % url, str(error))207 'There is no public branch set for "%s".' % url, str(error))
208208
209 def test_no_repo(self):209 def test_no_repo(self):
210 dir = bzrdir.BzrDir.create(self.get_url())210 dir = controldir.ControlDir.create(self.get_url())
211 error = errors.NoRepositoryPresent(dir)211 error = errors.NoRepositoryPresent(dir)
212 self.assertNotEqual(-1, str(error).find((dir.transport.clone('..').base)))212 self.assertNotEqual(-1, str(error).find((dir.transport.clone('..').base)))
213 self.assertEqual(-1, str(error).find((dir.transport.base)))213 self.assertEqual(-1, str(error).find((dir.transport.base)))
214214
=== modified file 'bzrlib/tests/test_foreign.py'
--- bzrlib/tests/test_foreign.py 2012-01-24 16:19:04 +0000
+++ bzrlib/tests/test_foreign.py 2012-03-06 18:30:24 +0000
@@ -330,7 +330,7 @@
330330
331 def cloning_metadir(self, stacked=False):331 def cloning_metadir(self, stacked=False):
332 """Produce a metadir suitable for cloning with."""332 """Produce a metadir suitable for cloning with."""
333 return bzrdir.format_registry.make_bzrdir("default")333 return controldir.format_registry.make_bzrdir("default")
334334
335 def checkout_metadir(self):335 def checkout_metadir(self):
336 return self.cloning_metadir()336 return self.cloning_metadir()
@@ -446,7 +446,7 @@
446 def test_create(self):446 def test_create(self):
447 """Test we can create dummies."""447 """Test we can create dummies."""
448 self.make_branch_and_tree("d", format=DummyForeignVcsDirFormat())448 self.make_branch_and_tree("d", format=DummyForeignVcsDirFormat())
449 dir = bzrdir.BzrDir.open("d")449 dir = controldir.ControlDir.open("d")
450 self.assertEquals("A Dummy VCS Dir", dir._format.get_format_string())450 self.assertEquals("A Dummy VCS Dir", dir._format.get_format_string())
451 dir.open_repository()451 dir.open_repository()
452 dir.open_branch()452 dir.open_branch()
@@ -455,7 +455,7 @@
455 def test_sprout(self):455 def test_sprout(self):
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."""
457 self.make_branch_and_tree("d", format=DummyForeignVcsDirFormat())457 self.make_branch_and_tree("d", format=DummyForeignVcsDirFormat())
458 dir = bzrdir.BzrDir.open("d")458 dir = controldir.ControlDir.open("d")
459 newdir = dir.sprout("e")459 newdir = dir.sprout("e")
460 self.assertNotEquals("A Dummy VCS Dir",460 self.assertNotEquals("A Dummy VCS Dir",
461 newdir._format.get_format_string())461 newdir._format.get_format_string())
462462
=== modified file 'bzrlib/tests/test_http.py'
--- bzrlib/tests/test_http.py 2012-01-20 12:56:05 +0000
+++ bzrlib/tests/test_http.py 2012-03-06 18:30:24 +0000
@@ -31,8 +31,8 @@
3131
32import bzrlib32import bzrlib
33from bzrlib import (33from bzrlib import (
34 bzrdir,
35 config,34 config,
35 controldir,
36 debug,36 debug,
37 errors,37 errors,
38 osutils,38 osutils,
@@ -1911,10 +1911,10 @@
1911 server._url_protocol = self._url_protocol1911 server._url_protocol = self._url_protocol
1912 return server1912 return server
19131913
1914 def test_open_bzrdir(self):1914 def test_open_controldir(self):
1915 branch = self.make_branch('relpath')1915 branch = self.make_branch('relpath')
1916 url = self.http_server.get_url() + 'relpath'1916 url = self.http_server.get_url() + 'relpath'
1917 bd = bzrdir.BzrDir.open(url)1917 bd = controldir.ControlDir.open(url)
1918 self.addCleanup(bd.transport.disconnect)1918 self.addCleanup(bd.transport.disconnect)
1919 self.assertIsInstance(bd, _mod_remote.RemoteBzrDir)1919 self.assertIsInstance(bd, _mod_remote.RemoteBzrDir)
19201920
19211921
=== modified file 'bzrlib/tests/test_import_tariff.py'
--- bzrlib/tests/test_import_tariff.py 2011-12-19 00:55:07 +0000
+++ bzrlib/tests/test_import_tariff.py 2012-03-06 18:30:24 +0000
@@ -25,7 +25,7 @@
25 plugins as _mod_plugins,25 plugins as _mod_plugins,
26 trace,26 trace,
27 )27 )
28from bzrlib.bzrdir import BzrDir28from bzrlib.controldir import ControlDir
29from bzrlib.smart import medium29from bzrlib.smart import medium
30from bzrlib.transport import remote30from bzrlib.transport import remote
3131
@@ -223,7 +223,7 @@
223 client_medium = medium.SmartSimplePipesClientMedium(223 client_medium = medium.SmartSimplePipesClientMedium(
224 process.stdout, process.stdin, url)224 process.stdout, process.stdin, url)
225 transport = remote.RemoteTransport(url, medium=client_medium)225 transport = remote.RemoteTransport(url, medium=client_medium)
226 branch = BzrDir.open_from_transport(transport).open_branch()226 branch = ControlDir.open_from_transport(transport).open_branch()
227 process.stdin.close()227 process.stdin.close()
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.
229 process.stdin = None229 process.stdin = None
230230
=== modified file 'bzrlib/tests/test_merge_core.py'
--- bzrlib/tests/test_merge_core.py 2012-01-25 21:13:15 +0000
+++ bzrlib/tests/test_merge_core.py 2012-03-06 18:30:24 +0000
@@ -19,6 +19,7 @@
1919
20import bzrlib20import bzrlib
21from bzrlib import (21from bzrlib import (
22 controldir,
22 errors,23 errors,
23 generate_ids,24 generate_ids,
24 merge_directive,25 merge_directive,
@@ -48,7 +49,7 @@
48 def wt(name):49 def wt(name):
49 path = pathjoin(self.dir, name)50 path = pathjoin(self.dir, name)
50 os.mkdir(path)51 os.mkdir(path)
51 wt = bzrlib.bzrdir.BzrDir.create_standalone_workingtree(path)52 wt = controldir.ControlDir.create_standalone_workingtree(path)
52 # the tests perform pulls, so need a branch that is writeable.53 # the tests perform pulls, so need a branch that is writeable.
53 wt.lock_write()54 wt.lock_write()
54 wt.set_root_id(self.tree_root)55 wt.set_root_id(self.tree_root)
5556
=== modified file 'bzrlib/tests/test_options.py'
--- bzrlib/tests/test_options.py 2011-11-24 17:01:07 +0000
+++ bzrlib/tests/test_options.py 2012-03-06 18:30:24 +0000
@@ -160,14 +160,14 @@
160160
161 def test_registry_converter(self):161 def test_registry_converter(self):
162 options = [option.RegistryOption('format', '',162 options = [option.RegistryOption('format', '',
163 bzrdir.format_registry, bzrdir.format_registry.make_bzrdir)]163 controldir.format_registry, controldir.format_registry.make_bzrdir)]
164 opts, args = self.parse(options, ['--format', 'knit'])164 opts, args = self.parse(options, ['--format', 'knit'])
165 self.assertIsInstance(opts.format.repository_format,165 self.assertIsInstance(opts.format.repository_format,
166 knitrepo.RepositoryFormatKnit1)166 knitrepo.RepositoryFormatKnit1)
167167
168 def test_lazy_registry(self):168 def test_lazy_registry(self):
169 options = [option.RegistryOption('format', '',169 options = [option.RegistryOption('format', '',
170 lazy_registry=('bzrlib.bzrdir','format_registry'),170 lazy_registry=('bzrlib.controldir','format_registry'),
171 converter=str)]171 converter=str)]
172 opts, args = self.parse(options, ['--format', 'knit'])172 opts, args = self.parse(options, ['--format', 'knit'])
173 self.assertEqual({'format': 'knit'}, opts)173 self.assertEqual({'format': 'knit'}, opts)
174174
=== modified file 'bzrlib/tests/test_permissions.py'
--- bzrlib/tests/test_permissions.py 2012-01-25 21:13:15 +0000
+++ bzrlib/tests/test_permissions.py 2012-03-06 18:30:24 +0000
@@ -35,7 +35,7 @@
3535
36from bzrlib import urlutils36from bzrlib import urlutils
37from bzrlib.branch import Branch37from bzrlib.branch import Branch
38from bzrlib.bzrdir import BzrDir38from bzrlib.controldir import ControlDir
39from bzrlib.tests import TestCaseWithTransport, TestSkipped39from bzrlib.tests import TestCaseWithTransport, TestSkipped
40from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer40from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
41from bzrlib.workingtree import WorkingTree41from bzrlib.workingtree import WorkingTree
@@ -199,7 +199,7 @@
199199
200 os.mkdir('sftp')200 os.mkdir('sftp')
201 sftp_url = self.get_url('sftp')201 sftp_url = self.get_url('sftp')
202 b_sftp = BzrDir.create_branch_and_repo(sftp_url)202 b_sftp = ControlDir.create_branch_and_repo(sftp_url)
203203
204 b_sftp.pull(b_local)204 b_sftp.pull(b_local)
205 del b_sftp205 del b_sftp
206206
=== modified file 'bzrlib/tests/test_reconfigure.py'
--- bzrlib/tests/test_reconfigure.py 2012-01-18 14:09:19 +0000
+++ bzrlib/tests/test_reconfigure.py 2012-03-06 18:30:24 +0000
@@ -16,7 +16,7 @@
1616
17from bzrlib import (17from bzrlib import (
18 branch as _mod_branch,18 branch as _mod_branch,
19 bzrdir,19 controldir,
20 errors,20 errors,
21 reconfigure,21 reconfigure,
22 repository,22 repository,
@@ -72,7 +72,7 @@
72 checkout = branch.create_checkout('checkout')72 checkout = branch.create_checkout('checkout')
73 reconfiguration = reconfigure.Reconfigure.to_branch(checkout.bzrdir)73 reconfiguration = reconfigure.Reconfigure.to_branch(checkout.bzrdir)
74 reconfiguration.apply()74 reconfiguration.apply()
75 reconfigured = bzrdir.BzrDir.open('checkout').open_branch()75 reconfigured = controldir.ControlDir.open('checkout').open_branch()
76 self.assertIs(None, reconfigured.get_bound_location())76 self.assertIs(None, reconfigured.get_bound_location())
7777
78 def prepare_lightweight_checkout_to_branch(self):78 def prepare_lightweight_checkout_to_branch(self):
@@ -445,7 +445,7 @@
445 r"Requested reconfiguration of '.*' is not supported.")445 r"Requested reconfiguration of '.*' is not supported.")
446446
447 def test_lightweight_checkout_to_tree_preserves_reference_locations(self):447 def test_lightweight_checkout_to_tree_preserves_reference_locations(self):
448 format = bzrdir.format_registry.make_bzrdir('1.9')448 format = controldir.format_registry.make_bzrdir('1.9')
449 format.set_branch_format(_mod_branch.BzrBranchFormat8())449 format.set_branch_format(_mod_branch.BzrBranchFormat8())
450 tree = self.make_branch_and_tree('tree', format=format)450 tree = self.make_branch_and_tree('tree', format=format)
451 tree.branch.set_reference_info('file_id', 'path', '../location')451 tree.branch.set_reference_info('file_id', 'path', '../location')
452452
=== modified file 'bzrlib/tests/test_remote.py'
--- bzrlib/tests/test_remote.py 2012-02-18 16:55:04 +0000
+++ bzrlib/tests/test_remote.py 2012-03-06 18:30:24 +0000
@@ -349,11 +349,11 @@
349class TestRemote(tests.TestCaseWithMemoryTransport):349class TestRemote(tests.TestCaseWithMemoryTransport):
350350
351 def get_branch_format(self):351 def get_branch_format(self):
352 reference_bzrdir_format = bzrdir.format_registry.get('default')()352 reference_bzrdir_format = controldir.format_registry.get('default')()
353 return reference_bzrdir_format.get_branch_format()353 return reference_bzrdir_format.get_branch_format()
354354
355 def get_repo_format(self):355 def get_repo_format(self):
356 reference_bzrdir_format = bzrdir.format_registry.get('default')()356 reference_bzrdir_format = controldir.format_registry.get('default')()
357 return reference_bzrdir_format.repository_format357 return reference_bzrdir_format.repository_format
358358
359 def assertFinished(self, fake_client):359 def assertFinished(self, fake_client):
@@ -475,7 +475,7 @@
475 transport = transport.clone('quack')475 transport = transport.clone('quack')
476 self.make_bzrdir('quack')476 self.make_bzrdir('quack')
477 client = FakeClient(transport.base)477 client = FakeClient(transport.base)
478 reference_bzrdir_format = bzrdir.format_registry.get('default')()478 reference_bzrdir_format = controldir.format_registry.get('default')()
479 control_name = reference_bzrdir_format.network_name()479 control_name = reference_bzrdir_format.network_name()
480 client.add_expected_call(480 client.add_expected_call(
481 'BzrDir.cloning_metadir', ('quack/', 'False'),481 'BzrDir.cloning_metadir', ('quack/', 'False'),
@@ -509,7 +509,7 @@
509 def test__get_checkout_format(self):509 def test__get_checkout_format(self):
510 transport = MemoryTransport()510 transport = MemoryTransport()
511 client = FakeClient(transport.base)511 client = FakeClient(transport.base)
512 reference_bzrdir_format = bzrdir.format_registry.get('default')()512 reference_bzrdir_format = controldir.format_registry.get('default')()
513 control_name = reference_bzrdir_format.network_name()513 control_name = reference_bzrdir_format.network_name()
514 client.add_expected_call(514 client.add_expected_call(
515 'BzrDir.checkout_metadir', ('quack/', ),515 'BzrDir.checkout_metadir', ('quack/', ),
@@ -546,7 +546,7 @@
546 def test_get_branches(self):546 def test_get_branches(self):
547 transport = MemoryTransport()547 transport = MemoryTransport()
548 client = FakeClient(transport.base)548 client = FakeClient(transport.base)
549 reference_bzrdir_format = bzrdir.format_registry.get('default')()549 reference_bzrdir_format = controldir.format_registry.get('default')()
550 branch_name = reference_bzrdir_format.get_branch_format().network_name()550 branch_name = reference_bzrdir_format.get_branch_format().network_name()
551 client.add_success_response_with_body(551 client.add_success_response_with_body(
552 bencode.bencode({552 bencode.bencode({
@@ -854,7 +854,7 @@
854 transport = transport.clone('quack')854 transport = transport.clone('quack')
855 self.make_repository('quack')855 self.make_repository('quack')
856 client = FakeClient(transport.base)856 client = FakeClient(transport.base)
857 reference_bzrdir_format = bzrdir.format_registry.get('default')()857 reference_bzrdir_format = controldir.format_registry.get('default')()
858 reference_format = reference_bzrdir_format.get_branch_format()858 reference_format = reference_bzrdir_format.get_branch_format()
859 network_name = reference_format.network_name()859 network_name = reference_format.network_name()
860 reference_repo_fmt = reference_bzrdir_format.repository_format860 reference_repo_fmt = reference_bzrdir_format.repository_format
@@ -882,7 +882,7 @@
882 # Client's medium rooted a transport root (not at the bzrdir)882 # Client's medium rooted a transport root (not at the bzrdir)
883 client = FakeClient(transport.base)883 client = FakeClient(transport.base)
884 transport = transport.clone('quack')884 transport = transport.clone('quack')
885 reference_bzrdir_format = bzrdir.format_registry.get('default')()885 reference_bzrdir_format = controldir.format_registry.get('default')()
886 reference_format = reference_bzrdir_format.get_branch_format()886 reference_format = reference_bzrdir_format.get_branch_format()
887 network_name = reference_format.network_name()887 network_name = reference_format.network_name()
888 reference_repo_fmt = reference_bzrdir_format.repository_format888 reference_repo_fmt = reference_bzrdir_format.repository_format
@@ -918,7 +918,7 @@
918 transport = transport.clone('quack')918 transport = transport.clone('quack')
919 self.make_bzrdir('quack')919 self.make_bzrdir('quack')
920 client = FakeClient(transport.base)920 client = FakeClient(transport.base)
921 reference_bzrdir_format = bzrdir.format_registry.get('default')()921 reference_bzrdir_format = controldir.format_registry.get('default')()
922 reference_format = reference_bzrdir_format.repository_format922 reference_format = reference_bzrdir_format.repository_format
923 network_name = reference_format.network_name()923 network_name = reference_format.network_name()
924 client.add_expected_call(924 client.add_expected_call(
@@ -3964,7 +3964,7 @@
3964 :result: The revision ids in the stream, in the order seen,3964 :result: The revision ids in the stream, in the order seen,
3965 the topological order of revisions in the source.3965 the topological order of revisions in the source.
3966 """3966 """
3967 unordered_format = bzrdir.format_registry.get(format)()3967 unordered_format = controldir.format_registry.get(format)()
3968 target_repository_format = unordered_format.repository_format3968 target_repository_format = unordered_format.repository_format
3969 # Cross check3969 # Cross check
3970 self.assertEqual(order, target_repository_format._fetch_order)3970 self.assertEqual(order, target_repository_format._fetch_order)
@@ -4273,7 +4273,7 @@
4273 def test_single_empty(self):4273 def test_single_empty(self):
4274 transport_path = 'quack'4274 transport_path = 'quack'
4275 repo, client = self.setup_fake_client_and_repository(transport_path)4275 repo, client = self.setup_fake_client_and_repository(transport_path)
4276 fmt = bzrdir.format_registry.get('2a')().repository_format4276 fmt = controldir.format_registry.get('2a')().repository_format
4277 repo._format = fmt4277 repo._format = fmt
4278 stream = [('inventory-deltas', [4278 stream = [('inventory-deltas', [
4279 versionedfile.FulltextContentFactory('somerevid', None, None,4279 versionedfile.FulltextContentFactory('somerevid', None, None,
42804280
=== modified file 'bzrlib/tests/test_repository.py'
--- bzrlib/tests/test_repository.py 2012-01-24 16:19:04 +0000
+++ bzrlib/tests/test_repository.py 2012-03-06 18:30:24 +0000
@@ -45,6 +45,7 @@
45 )45 )
46from bzrlib import (46from bzrlib import (
47 bzrdir,47 bzrdir,
48 controldir,
48 errors,49 errors,
49 inventory,50 inventory,
50 osutils,51 osutils,
@@ -66,7 +67,7 @@
66class TestDefaultFormat(TestCase):67class TestDefaultFormat(TestCase):
6768
68 def test_get_set_default_format(self):69 def test_get_set_default_format(self):
69 old_default = bzrdir.format_registry.get('default')70 old_default = controldir.format_registry.get('default')
70 private_default = old_default().repository_format.__class__71 private_default = old_default().repository_format.__class__
71 old_format = repository.format_registry.get_default()72 old_format = repository.format_registry.get_default()
72 self.assertTrue(isinstance(old_format, private_default))73 self.assertTrue(isinstance(old_format, private_default))
@@ -74,9 +75,9 @@
74 my_bzrdir = bzrdir.BzrDirMetaFormat1()75 my_bzrdir = bzrdir.BzrDirMetaFormat1()
75 my_bzrdir.repository_format = SampleRepositoryFormat()76 my_bzrdir.repository_format = SampleRepositoryFormat()
76 return my_bzrdir77 return my_bzrdir
77 bzrdir.format_registry.remove('default')78 controldir.format_registry.remove('default')
78 bzrdir.format_registry.register('sample', make_sample_bzrdir, '')79 controldir.format_registry.register('sample', make_sample_bzrdir, '')
79 bzrdir.format_registry.set_default('sample')80 controldir.format_registry.set_default('sample')
80 # creating a repository should now create an instrumented dir.81 # creating a repository should now create an instrumented dir.
81 try:82 try:
82 # the default branch format is used by the meta dir format83 # the default branch format is used by the meta dir format
@@ -85,9 +86,9 @@
85 result = dir.create_repository()86 result = dir.create_repository()
86 self.assertEqual(result, 'A bzr repository dir')87 self.assertEqual(result, 'A bzr repository dir')
87 finally:88 finally:
88 bzrdir.format_registry.remove('default')89 controldir.format_registry.remove('default')
89 bzrdir.format_registry.remove('sample')90 controldir.format_registry.remove('sample')
90 bzrdir.format_registry.register('default', old_default, '')91 controldir.format_registry.register('default', old_default, '')
91 self.assertIsInstance(repository.format_registry.get_default(),92 self.assertIsInstance(repository.format_registry.get_default(),
92 old_format.__class__)93 old_format.__class__)
9394
@@ -236,13 +237,13 @@
236 def test_attribute__fetch_order(self):237 def test_attribute__fetch_order(self):
237 """Knits need topological data insertion."""238 """Knits need topological data insertion."""
238 repo = self.make_repository('.',239 repo = self.make_repository('.',
239 format=bzrdir.format_registry.get('knit')())240 format=controldir.format_registry.get('knit')())
240 self.assertEqual('topological', repo._format._fetch_order)241 self.assertEqual('topological', repo._format._fetch_order)
241242
242 def test_attribute__fetch_uses_deltas(self):243 def test_attribute__fetch_uses_deltas(self):
243 """Knits reuse deltas."""244 """Knits reuse deltas."""
244 repo = self.make_repository('.',245 repo = self.make_repository('.',
245 format=bzrdir.format_registry.get('knit')())246 format=controldir.format_registry.get('knit')())
246 self.assertEqual(True, repo._format._fetch_uses_deltas)247 self.assertEqual(True, repo._format._fetch_uses_deltas)
247248
248 def test_disk_layout(self):249 def test_disk_layout(self):
@@ -334,7 +335,7 @@
334 is valid when the api is not being abused.335 is valid when the api is not being abused.
335 """336 """
336 repo = self.make_repository('.',337 repo = self.make_repository('.',
337 format=bzrdir.format_registry.get('knit')())338 format=controldir.format_registry.get('knit')())
338 inv_xml = '<inventory format="5">\n</inventory>\n'339 inv_xml = '<inventory format="5">\n</inventory>\n'
339 inv = repo._deserialise_inventory('test-rev-id', inv_xml)340 inv = repo._deserialise_inventory('test-rev-id', inv_xml)
340 self.assertEqual('test-rev-id', inv.root.revision)341 self.assertEqual('test-rev-id', inv.root.revision)
@@ -342,7 +343,7 @@
342 def test_deserialise_uses_global_revision_id(self):343 def test_deserialise_uses_global_revision_id(self):
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"""
344 repo = self.make_repository('.',345 repo = self.make_repository('.',
345 format=bzrdir.format_registry.get('knit')())346 format=controldir.format_registry.get('knit')())
346 inv_xml = ('<inventory format="5" revision_id="other-rev-id">\n'347 inv_xml = ('<inventory format="5" revision_id="other-rev-id">\n'
347 '</inventory>\n')348 '</inventory>\n')
348 # Arguably, the deserialise_inventory should detect a mismatch, and349 # Arguably, the deserialise_inventory should detect a mismatch, and
@@ -355,7 +356,7 @@
355356
356 def test_supports_external_lookups(self):357 def test_supports_external_lookups(self):
357 repo = self.make_repository('.',358 repo = self.make_repository('.',
358 format=bzrdir.format_registry.get('knit')())359 format=controldir.format_registry.get('knit')())
359 self.assertFalse(repo._format.supports_external_lookups)360 self.assertFalse(repo._format.supports_external_lookups)
360361
361362
@@ -994,7 +995,7 @@
994class TestRepositoryPackCollection(TestCaseWithTransport):995class TestRepositoryPackCollection(TestCaseWithTransport):
995996
996 def get_format(self):997 def get_format(self):
997 return bzrdir.format_registry.make_bzrdir('pack-0.92')998 return controldir.format_registry.make_bzrdir('pack-0.92')
998999
999 def get_packs(self):1000 def get_packs(self):
1000 format = self.get_format()1001 format = self.get_format()
10011002
=== modified file 'bzrlib/tests/test_selftest.py'
--- bzrlib/tests/test_selftest.py 2011-11-08 17:07:23 +0000
+++ bzrlib/tests/test_selftest.py 2012-03-06 18:30:24 +0000
@@ -43,6 +43,7 @@
43from bzrlib import (43from bzrlib import (
44 branchbuilder,44 branchbuilder,
45 bzrdir,45 bzrdir,
46 controldir,
46 errors,47 errors,
47 hooks,48 hooks,
48 lockdir,49 lockdir,
@@ -609,7 +610,7 @@
609 # Guard against regression into MemoryTransport leaking610 # Guard against regression into MemoryTransport leaking
610 # files to disk instead of keeping them in memory.611 # files to disk instead of keeping them in memory.
611 self.assertFalse(osutils.lexists('dir'))612 self.assertFalse(osutils.lexists('dir'))
612 dir_format = bzrdir.format_registry.make_bzrdir('knit')613 dir_format = controldir.format_registry.make_bzrdir('knit')
613 self.assertEqual(dir_format.repository_format.__class__,614 self.assertEqual(dir_format.repository_format.__class__,
614 the_branch.repository._format.__class__)615 the_branch.repository._format.__class__)
615 self.assertEqual('Bazaar-NG Knit Repository Format 1',616 self.assertEqual('Bazaar-NG Knit Repository Format 1',
@@ -678,7 +679,7 @@
678 builder = self.make_branch_builder('dir')679 builder = self.make_branch_builder('dir')
679 rev_id = builder.build_commit()680 rev_id = builder.build_commit()
680 self.assertPathExists('dir')681 self.assertPathExists('dir')
681 a_dir = bzrdir.BzrDir.open('dir')682 a_dir = controldir.ControlDir.open('dir')
682 self.assertRaises(errors.NoWorkingTree, a_dir.open_workingtree)683 self.assertRaises(errors.NoWorkingTree, a_dir.open_workingtree)
683 a_branch = a_dir.open_branch()684 a_branch = a_dir.open_branch()
684 builder_branch = builder.get_branch()685 builder_branch = builder.get_branch()
@@ -1477,13 +1478,13 @@
1477 transport_server.start_server()1478 transport_server.start_server()
1478 self.addCleanup(transport_server.stop_server)1479 self.addCleanup(transport_server.stop_server)
1479 t = transport.get_transport_from_url(transport_server.get_url())1480 t = transport.get_transport_from_url(transport_server.get_url())
1480 bzrdir.BzrDir.create(t.base)1481 controldir.ControlDir.create(t.base)
1481 self.assertRaises(errors.BzrError,1482 self.assertRaises(errors.BzrError,
1482 bzrdir.BzrDir.open_from_transport, t)1483 controldir.ControlDir.open_from_transport, t)
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.
1484 self.permit_url(t.base)1485 self.permit_url(t.base)
1485 self._bzr_selftest_roots.append(t.base)1486 self._bzr_selftest_roots.append(t.base)
1486 bzrdir.BzrDir.open_from_transport(t)1487 controldir.ControlDir.open_from_transport(t)
14871488
1488 def test_requireFeature_available(self):1489 def test_requireFeature_available(self):
1489 """self.requireFeature(available) is a no-op."""1490 """self.requireFeature(available) is a no-op."""
@@ -1943,7 +1944,7 @@
1943 def test_make_branch_and_tree_with_format(self):1944 def test_make_branch_and_tree_with_format(self):
1944 # we should be able to supply a format to make_branch_and_tree1945 # we should be able to supply a format to make_branch_and_tree
1945 self.make_branch_and_tree('a', format=bzrlib.bzrdir.BzrDirMetaFormat1())1946 self.make_branch_and_tree('a', format=bzrlib.bzrdir.BzrDirMetaFormat1())
1946 self.assertIsInstance(bzrlib.bzrdir.BzrDir.open('a')._format,1947 self.assertIsInstance(bzrlib.controldir.ControlDir.open('a')._format,
1947 bzrlib.bzrdir.BzrDirMetaFormat1)1948 bzrlib.bzrdir.BzrDirMetaFormat1)
19481949
1949 def test_make_branch_and_memory_tree(self):1950 def test_make_branch_and_memory_tree(self):
19501951
=== modified file 'bzrlib/tests/test_sftp_transport.py'
--- bzrlib/tests/test_sftp_transport.py 2012-01-25 21:13:15 +0000
+++ bzrlib/tests/test_sftp_transport.py 2012-03-06 18:30:24 +0000
@@ -21,8 +21,8 @@
21import time21import time
2222
23from bzrlib import (23from bzrlib import (
24 bzrdir,
25 config,24 config,
25 controldir,
26 errors,26 errors,
27 tests,27 tests,
28 transport as _mod_transport,28 transport as _mod_transport,
@@ -191,12 +191,12 @@
191191
192 def test_push_support(self):192 def test_push_support(self):
193 self.build_tree(['a/', 'a/foo'])193 self.build_tree(['a/', 'a/foo'])
194 t = bzrdir.BzrDir.create_standalone_workingtree('a')194 t = controldir.ControlDir.create_standalone_workingtree('a')
195 b = t.branch195 b = t.branch
196 t.add('foo')196 t.add('foo')
197 t.commit('foo', rev_id='a1')197 t.commit('foo', rev_id='a1')
198198
199 b2 = bzrdir.BzrDir.create_branch_and_repo(self.get_url('/b'))199 b2 = controldir.ControlDir.create_branch_and_repo(self.get_url('/b'))
200 b2.pull(b)200 b2.pull(b)
201201
202 self.assertEquals(b2.last_revision(), 'a1')202 self.assertEquals(b2.last_revision(), 'a1')
203203
=== modified file 'bzrlib/tests/test_smart.py'
--- bzrlib/tests/test_smart.py 2012-02-14 17:22:37 +0000
+++ bzrlib/tests/test_smart.py 2012-03-06 18:30:24 +0000
@@ -30,7 +30,7 @@
30from bzrlib import (30from bzrlib import (
31 bencode,31 bencode,
32 branch as _mod_branch,32 branch as _mod_branch,
33 bzrdir,33 controldir,
34 errors,34 errors,
35 gpg,35 gpg,
36 inventory_delta,36 inventory_delta,
@@ -121,7 +121,7 @@
121 stream = [('text', [versionedfile.FulltextContentFactory(('k1',), None,121 stream = [('text', [versionedfile.FulltextContentFactory(('k1',), None,
122 None, 'foo')]),('text', [122 None, 'foo')]),('text', [
123 versionedfile.FulltextContentFactory(('k2',), None, None, 'bar')])]123 versionedfile.FulltextContentFactory(('k2',), None, None, 'bar')])]
124 fmt = bzrdir.format_registry.get('pack-0.92')().repository_format124 fmt = controldir.format_registry.get('pack-0.92')().repository_format
125 bytes = smart_repo._stream_to_byte_stream(stream, fmt)125 bytes = smart_repo._stream_to_byte_stream(stream, fmt)
126 streams = []126 streams = []
127 # Iterate the resulting iterable; checking that we get only one stream127 # Iterate the resulting iterable; checking that we get only one stream
@@ -333,7 +333,7 @@
333 self.make_bzrdir('.')333 self.make_bzrdir('.')
334 request_class = smart_dir.SmartServerRequestCreateRepository334 request_class = smart_dir.SmartServerRequestCreateRepository
335 request = request_class(backing)335 request = request_class(backing)
336 reference_bzrdir_format = bzrdir.format_registry.get('pack-0.92')()336 reference_bzrdir_format = controldir.format_registry.get('pack-0.92')()
337 reference_format = reference_bzrdir_format.repository_format337 reference_format = reference_bzrdir_format.repository_format
338 network_name = reference_format.network_name()338 network_name = reference_format.network_name()
339 expected = smart_req.SuccessfulSmartServerResponse(339 expected = smart_req.SuccessfulSmartServerResponse(
@@ -493,7 +493,7 @@
493 request = smart_dir.SmartServerRequestInitializeBzrDir(backing)493 request = smart_dir.SmartServerRequestInitializeBzrDir(backing)
494 self.assertEqual(smart_req.SmartServerResponse(('ok', )),494 self.assertEqual(smart_req.SmartServerResponse(('ok', )),
495 request.execute(''))495 request.execute(''))
496 made_dir = bzrdir.BzrDir.open_from_transport(backing)496 made_dir = controldir.ControlDir.open_from_transport(backing)
497 # no branch, tree or repository is expected with the current497 # no branch, tree or repository is expected with the current
498 # default formart.498 # default formart.
499 self.assertRaises(errors.NoWorkingTree, made_dir.open_workingtree)499 self.assertRaises(errors.NoWorkingTree, made_dir.open_workingtree)
@@ -533,7 +533,7 @@
533 'False', '', '', '')),533 'False', '', '', '')),
534 request.execute(name, '', 'True', 'False', 'False', '', '', '', '',534 request.execute(name, '', 'True', 'False', 'False', '', '', '', '',
535 'False'))535 'False'))
536 made_dir = bzrdir.BzrDir.open_from_transport(backing)536 made_dir = controldir.ControlDir.open_from_transport(backing)
537 # no branch, tree or repository is expected with the current537 # no branch, tree or repository is expected with the current
538 # default format.538 # default format.
539 self.assertRaises(errors.NoWorkingTree, made_dir.open_workingtree)539 self.assertRaises(errors.NoWorkingTree, made_dir.open_workingtree)
@@ -2691,7 +2691,7 @@
2691 versionedfile.FulltextContentFactory('somerev', None, None,2691 versionedfile.FulltextContentFactory('somerev', None, None,
2692 self._get_serialized_inventory_delta(2692 self._get_serialized_inventory_delta(
2693 t.branch.repository, 'null:', 'somerev'))])]2693 t.branch.repository, 'null:', 'somerev'))])]
2694 fmt = bzrdir.format_registry.get('2a')().repository_format2694 fmt = controldir.format_registry.get('2a')().repository_format
2695 self.assertEquals(2695 self.assertEquals(
2696 "".join(response.body_stream),2696 "".join(response.body_stream),
2697 "".join(smart_repo._stream_to_byte_stream(stream, fmt)))2697 "".join(smart_repo._stream_to_byte_stream(stream, fmt)))
26982698
=== modified file 'bzrlib/tests/test_smart_transport.py'
--- bzrlib/tests/test_smart_transport.py 2011-11-25 17:54:52 +0000
+++ bzrlib/tests/test_smart_transport.py 2012-03-06 18:30:24 +0000
@@ -32,6 +32,7 @@
32import bzrlib32import bzrlib
33from bzrlib import (33from bzrlib import (
34 bzrdir,34 bzrdir,
35 controldir,
35 debug,36 debug,
36 errors,37 errors,
37 osutils,38 osutils,
@@ -1628,7 +1629,8 @@
1628 transport = self.transport1629 transport = self.transport
1629 t = self.backing_transport1630 t = self.backing_transport
1630 bzrdir.BzrDirFormat.get_default_format().initialize_on_transport(t)1631 bzrdir.BzrDirFormat.get_default_format().initialize_on_transport(t)
1631 result_dir = bzrdir.BzrDir.open_containing_from_transport(transport)1632 result_dir = controldir.ControlDir.open_containing_from_transport(
1633 transport)
16321634
16331635
1634class ReadOnlyEndToEndTests(SmartTCPTests):1636class ReadOnlyEndToEndTests(SmartTCPTests):
16351637
=== modified file 'bzrlib/tests/test_tag.py'
--- bzrlib/tests/test_tag.py 2011-09-22 13:26:14 +0000
+++ bzrlib/tests/test_tag.py 2012-03-06 18:30:24 +0000
@@ -18,7 +18,7 @@
1818
1919
20from bzrlib import (20from bzrlib import (
21 bzrdir,21 controldir,
22 errors,22 errors,
23 )23 )
24from bzrlib.tag import (24from bzrlib.tag import (
@@ -69,8 +69,8 @@
69class TestTagMerging(TestCaseWithTransport):69class TestTagMerging(TestCaseWithTransport):
7070
71 def make_knit_branch(self, relpath):71 def make_knit_branch(self, relpath):
72 old_bdf = bzrdir.format_registry.make_bzrdir('knit')72 old_bdf = controldir.format_registry.make_bzrdir('knit')
73 return bzrdir.BzrDir.create_branch_convenience(relpath, format=old_bdf)73 return controldir.ControlDir.create_branch_convenience(relpath, format=old_bdf)
7474
75 def make_branch_supporting_tags(self, relpath):75 def make_branch_supporting_tags(self, relpath):
76 return self.make_branch(relpath, format='dirstate-tags')76 return self.make_branch(relpath, format='dirstate-tags')
7777
=== modified file 'bzrlib/tests/test_transform.py'
--- bzrlib/tests/test_transform.py 2012-02-06 23:38:33 +0000
+++ bzrlib/tests/test_transform.py 2012-03-06 18:30:24 +0000
@@ -34,7 +34,6 @@
34 transform,34 transform,
35 urlutils,35 urlutils,
36 )36 )
37from bzrlib.bzrdir import BzrDir
38from bzrlib.conflicts import (37from bzrlib.conflicts import (
39 DeletingParent,38 DeletingParent,
40 DuplicateEntry,39 DuplicateEntry,
@@ -44,6 +43,7 @@
44 ParentLoop,43 ParentLoop,
45 UnversionedParent,44 UnversionedParent,
46)45)
46from bzrlib.controldir import ControlDir
47from bzrlib.diff import show_diff_trees47from bzrlib.diff import show_diff_trees
48from bzrlib.errors import (48from bzrlib.errors import (
49 DuplicateKey,49 DuplicateKey,
@@ -1645,7 +1645,7 @@
1645 def __init__(self, dirname, root_id):1645 def __init__(self, dirname, root_id):
1646 self.name = dirname1646 self.name = dirname
1647 os.mkdir(dirname)1647 os.mkdir(dirname)
1648 self.wt = BzrDir.create_standalone_workingtree(dirname)1648 self.wt = ControlDir.create_standalone_workingtree(dirname)
1649 self.wt.set_root_id(root_id)1649 self.wt.set_root_id(root_id)
1650 self.b = self.wt.branch1650 self.b = self.wt.branch
1651 self.tt = TreeTransform(self.wt)1651 self.tt = TreeTransform(self.wt)
@@ -1881,13 +1881,13 @@
1881 def test_build_tree_with_symlinks(self):1881 def test_build_tree_with_symlinks(self):
1882 self.requireFeature(SymlinkFeature)1882 self.requireFeature(SymlinkFeature)
1883 os.mkdir('a')1883 os.mkdir('a')
1884 a = BzrDir.create_standalone_workingtree('a')1884 a = ControlDir.create_standalone_workingtree('a')
1885 os.mkdir('a/foo')1885 os.mkdir('a/foo')
1886 with file('a/foo/bar', 'wb') as f: f.write('contents')1886 with file('a/foo/bar', 'wb') as f: f.write('contents')
1887 os.symlink('a/foo/bar', 'a/foo/baz')1887 os.symlink('a/foo/bar', 'a/foo/baz')
1888 a.add(['foo', 'foo/bar', 'foo/baz'])1888 a.add(['foo', 'foo/bar', 'foo/baz'])
1889 a.commit('initial commit')1889 a.commit('initial commit')
1890 b = BzrDir.create_standalone_workingtree('b')1890 b = ControlDir.create_standalone_workingtree('b')
1891 basis = a.basis_tree()1891 basis = a.basis_tree()
1892 basis.lock_read()1892 basis.lock_read()
1893 self.addCleanup(basis.unlock)1893 self.addCleanup(basis.unlock)
18941894
=== modified file 'bzrlib/tests/test_upgrade.py'
--- bzrlib/tests/test_upgrade.py 2012-01-04 17:12:42 +0000
+++ bzrlib/tests/test_upgrade.py 2012-03-06 18:30:24 +0000
@@ -24,7 +24,7 @@
2424
25from bzrlib import (25from bzrlib import (
26 branch,26 branch,
27 bzrdir,27 controldir,
28 tests,28 tests,
29 upgrade,29 upgrade,
30 workingtree,30 workingtree,
@@ -45,7 +45,7 @@
45 b.set_parent('file:///EF')45 b.set_parent('file:///EF')
46 b.set_bound_location('file:///GH')46 b.set_bound_location('file:///GH')
47 b.set_push_location('file:///IJ')47 b.set_push_location('file:///IJ')
48 target = bzrdir.format_registry.make_bzrdir('dirstate-with-subtree')48 target = controldir.format_registry.make_bzrdir('dirstate-with-subtree')
49 converter = b.bzrdir._format.get_converter(target)49 converter = b.bzrdir._format.get_converter(target)
50 converter.convert(b.bzrdir, None)50 converter.convert(b.bzrdir, None)
51 new_branch = branch.Branch.open(self.get_url('branch'))51 new_branch = branch.Branch.open(self.get_url('branch'))
@@ -64,7 +64,7 @@
6464
65 def test_convert_branch7_branch8(self):65 def test_convert_branch7_branch8(self):
66 b = self.make_branch('branch', format='1.9')66 b = self.make_branch('branch', format='1.9')
67 target = bzrdir.format_registry.make_bzrdir('1.9')67 target = controldir.format_registry.make_bzrdir('1.9')
68 target.set_branch_format(branch.BzrBranchFormat8())68 target.set_branch_format(branch.BzrBranchFormat8())
69 converter = b.bzrdir._format.get_converter(target)69 converter = b.bzrdir._format.get_converter(target)
70 converter.convert(b.bzrdir, None)70 converter.convert(b.bzrdir, None)
@@ -75,7 +75,7 @@
75 def test_convert_knit_dirstate_empty(self):75 def test_convert_knit_dirstate_empty(self):
76 # test that asking for an upgrade from knit to dirstate works.76 # test that asking for an upgrade from knit to dirstate works.
77 tree = self.make_branch_and_tree('tree', format='knit')77 tree = self.make_branch_and_tree('tree', format='knit')
78 target = bzrdir.format_registry.make_bzrdir('dirstate')78 target = controldir.format_registry.make_bzrdir('dirstate')
79 converter = tree.bzrdir._format.get_converter(target)79 converter = tree.bzrdir._format.get_converter(target)
80 converter.convert(tree.bzrdir, None)80 converter.convert(tree.bzrdir, None)
81 new_tree = workingtree.WorkingTree.open('tree')81 new_tree = workingtree.WorkingTree.open('tree')
@@ -88,7 +88,7 @@
88 tree = self.make_branch_and_tree('tree', format='knit')88 tree = self.make_branch_and_tree('tree', format='knit')
89 self.build_tree(['tree/file'])89 self.build_tree(['tree/file'])
90 tree.add(['file'], ['file-id'])90 tree.add(['file'], ['file-id'])
91 target = bzrdir.format_registry.make_bzrdir('dirstate')91 target = controldir.format_registry.make_bzrdir('dirstate')
92 converter = tree.bzrdir._format.get_converter(target)92 converter = tree.bzrdir._format.get_converter(target)
93 converter.convert(tree.bzrdir, None)93 converter.convert(tree.bzrdir, None)
94 new_tree = workingtree.WorkingTree.open('tree')94 new_tree = workingtree.WorkingTree.open('tree')
@@ -99,7 +99,7 @@
99 # test that asking for an upgrade from knit to dirstate works.99 # test that asking for an upgrade from knit to dirstate works.
100 tree = self.make_branch_and_tree('tree', format='knit')100 tree = self.make_branch_and_tree('tree', format='knit')
101 rev_id = tree.commit('first post')101 rev_id = tree.commit('first post')
102 target = bzrdir.format_registry.make_bzrdir('dirstate')102 target = controldir.format_registry.make_bzrdir('dirstate')
103 converter = tree.bzrdir._format.get_converter(target)103 converter = tree.bzrdir._format.get_converter(target)
104 converter.convert(tree.bzrdir, None)104 converter.convert(tree.bzrdir, None)
105 new_tree = workingtree.WorkingTree.open('tree')105 new_tree = workingtree.WorkingTree.open('tree')
@@ -116,7 +116,7 @@
116 rev_id2 = tree.commit('second post')116 rev_id2 = tree.commit('second post')
117 rev_id3 = merge_tree.commit('second merge post')117 rev_id3 = merge_tree.commit('second merge post')
118 tree.merge_from_branch(merge_tree.branch)118 tree.merge_from_branch(merge_tree.branch)
119 target = bzrdir.format_registry.make_bzrdir('dirstate')119 target = controldir.format_registry.make_bzrdir('dirstate')
120 converter = tree.bzrdir._format.get_converter(target)120 converter = tree.bzrdir._format.get_converter(target)
121 converter.convert(tree.bzrdir, None)121 converter.convert(tree.bzrdir, None)
122 new_tree = workingtree.WorkingTree.open('tree')122 new_tree = workingtree.WorkingTree.open('tree')
@@ -130,8 +130,8 @@
130130
131class TestSmartUpgrade(tests.TestCaseWithTransport):131class TestSmartUpgrade(tests.TestCaseWithTransport):
132132
133 from_format = bzrdir.format_registry.make_bzrdir("pack-0.92")133 from_format = controldir.format_registry.make_bzrdir("pack-0.92")
134 to_format = bzrdir.format_registry.make_bzrdir("2a")134 to_format = controldir.format_registry.make_bzrdir("2a")
135135
136 def make_standalone_branch(self):136 def make_standalone_branch(self):
137 wt = self.make_branch_and_tree("branch1", format=self.from_format)137 wt = self.make_branch_and_tree("branch1", format=self.from_format)
@@ -170,9 +170,9 @@
170 format=self.from_format)170 format=self.from_format)
171 # Note: self.make_branch() always creates a new repo at the location171 # Note: self.make_branch() always creates a new repo at the location
172 # so we need to avoid using that here ...172 # so we need to avoid using that here ...
173 b1 = bzrdir.BzrDir.create_branch_convenience("repo/branch1",173 b1 = controldir.ControlDir.create_branch_convenience("repo/branch1",
174 format=self.from_format)174 format=self.from_format)
175 b2 = bzrdir.BzrDir.create_branch_convenience("repo/branch2",175 b2 = controldir.ControlDir.create_branch_convenience("repo/branch2",
176 format=self.from_format)176 format=self.from_format)
177 return repo.bzrdir177 return repo.bzrdir
178178
179179
=== modified file 'bzrlib/tests/test_upgrade_stacked.py'
--- bzrlib/tests/test_upgrade_stacked.py 2011-01-10 22:20:12 +0000
+++ bzrlib/tests/test_upgrade_stacked.py 2012-03-06 18:30:24 +0000
@@ -18,7 +18,7 @@
18"""Tests for upgrades of various stacking situations."""18"""Tests for upgrades of various stacking situations."""
1919
20from bzrlib import (20from bzrlib import (
21 bzrdir,21 controldir,
22 check,22 check,
23 errors,23 errors,
24 tests,24 tests,
@@ -71,7 +71,7 @@
71 self.assertTrue(stacked.open_branch().get_stacked_on_url())71 self.assertTrue(stacked.open_branch().get_stacked_on_url())
72 # now we'll upgrade the underlying branch, then upgrade the stacked72 # now we'll upgrade the underlying branch, then upgrade the stacked
73 # branch, and this should still work.73 # branch, and this should still work.
74 new_format = bzrdir.format_registry.make_bzrdir(74 new_format = controldir.format_registry.make_bzrdir(
75 self.scenario_new_format)75 self.scenario_new_format)
76 upgrade('base', new_format)76 upgrade('base', new_format)
77 # in some cases you'll get an error if the underlying model has77 # in some cases you'll get an error if the underlying model has
@@ -81,10 +81,10 @@
81 stacked.open_branch)81 stacked.open_branch)
82 else:82 else:
83 check.check_dwim('stacked', False, True, True)83 check.check_dwim('stacked', False, True, True)
84 stacked = bzrdir.BzrDir.open('stacked')84 stacked = controldir.ControlDir.open('stacked')
85 # but we can upgrade the stacked repository85 # but we can upgrade the stacked repository
86 upgrade('stacked', new_format)86 upgrade('stacked', new_format)
87 # and now it opens ok87 # and now it opens ok
88 stacked = bzrdir.BzrDir.open('stacked')88 stacked = controldir.ControlDir.open('stacked')
89 # And passes check.89 # And passes check.
90 check.check_dwim('stacked', False, True, True)90 check.check_dwim('stacked', False, True, True)
9191
=== modified file 'bzrlib/tests/test_url_policy_open.py'
--- bzrlib/tests/test_url_policy_open.py 2012-01-19 00:51:24 +0000
+++ bzrlib/tests/test_url_policy_open.py 2012-03-06 18:30:24 +0000
@@ -22,10 +22,12 @@
22 BranchReferenceFormat,22 BranchReferenceFormat,
23 )23 )
24from bzrlib.bzrdir import (24from bzrlib.bzrdir import (
25 BzrDir,
26 BzrProber,25 BzrProber,
27 )26 )
28from bzrlib.controldir import ControlDirFormat27from bzrlib.controldir import (
28 ControlDir,
29 ControlDirFormat,
30 )
29from bzrlib.errors import NotBranchError31from bzrlib.errors import NotBranchError
30from bzrlib.url_policy_open import (32from bzrlib.url_policy_open import (
31 BadUrl,33 BadUrl,
@@ -182,9 +184,9 @@
182 self.assertRaises(NotBranchError, opener.open, ".")184 self.assertRaises(NotBranchError, opener.open, ".")
183 self.assertEquals(1, len(TrackingProber.seen_urls))185 self.assertEquals(1, len(TrackingProber.seen_urls))
184 TrackingProber.seen_urls = []186 TrackingProber.seen_urls = []
185 # And make sure it's registered in such a way that BzrDir.open would187 # And make sure it's registered in such a way that ControlDir.open would
186 # use it.188 # use it.
187 self.assertRaises(NotBranchError, BzrDir.open, ".")189 self.assertRaises(NotBranchError, ControlDir.open, ".")
188 self.assertEquals(1, len(TrackingProber.seen_urls))190 self.assertEquals(1, len(TrackingProber.seen_urls))
189191
190 def test_allowed_url(self):192 def test_allowed_url(self):
191193
=== modified file 'bzrlib/workingtree_4.py'
--- bzrlib/workingtree_4.py 2012-02-06 23:38:33 +0000
+++ bzrlib/workingtree_4.py 2012-03-06 18:30:24 +0000
@@ -38,6 +38,7 @@
38 cache_utf8,38 cache_utf8,
39 config,39 config,
40 conflicts as _mod_conflicts,40 conflicts as _mod_conflicts,
41 controldir,
41 debug,42 debug,
42 dirstate,43 dirstate,
43 errors,44 errors,
@@ -1608,7 +1609,7 @@
1608 def _get_matchingbzrdir(self):1609 def _get_matchingbzrdir(self):
1609 """Overrideable method to get a bzrdir for testing."""1610 """Overrideable method to get a bzrdir for testing."""
1610 # please test against something that will let us do tree references1611 # please test against something that will let us do tree references
1611 return bzrdir.format_registry.make_bzrdir(1612 return controldir.format_registry.make_bzrdir(
1612 'development-subtree')1613 'development-subtree')
16131614
1614 _matchingbzrdir = property(__get_matchingbzrdir)1615 _matchingbzrdir = property(__get_matchingbzrdir)