~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Andrew Bennetts
  • Date: 2011-02-25 08:45:27 UTC
  • mto: This revision was merged to the branch mainline in revision 5695.
  • Revision ID: andrew.bennetts@canonical.com-20110225084527-0ucp7p00d00hoqon
Add another test.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 
38
38
import bzrlib
39
39
from bzrlib import (
 
40
    branch,
40
41
    config,
41
42
    controldir,
42
43
    errors,
1736
1737
 
1737
1738
    _lock_class = lockable_files.TransportLock
1738
1739
 
1739
 
    fixed_components = True
1740
 
 
1741
1740
    def get_format_string(self):
1742
1741
        """See BzrDirFormat.get_format_string()."""
1743
1742
        return "Bazaar-NG branch, format 0.0.4\n"
1781
1780
class BzrDirFormatAllInOne(BzrDirFormat):
1782
1781
    """Common class for formats before meta-dirs."""
1783
1782
 
1784
 
    fixed_components = True
1785
 
 
1786
1783
    def initialize_on_transport_ex(self, transport, use_existing_dir=False,
1787
1784
        create_prefix=False, force_new_repo=False, stacked_on=None,
1788
1785
        stack_on_pwd=None, repo_format_name=None, make_working_trees=None,
1941
1938
 
1942
1939
    _lock_class = lockdir.LockDir
1943
1940
 
1944
 
    fixed_components = False
1945
 
 
1946
1941
    def __init__(self):
1947
1942
        self._workingtree_format = None
1948
1943
        self._branch_format = None
1962
1957
 
1963
1958
    def get_branch_format(self):
1964
1959
        if self._branch_format is None:
1965
 
            from bzrlib.branch import format_registry as branch_format_registry
1966
 
            self._branch_format = branch_format_registry.get_default()
 
1960
            from bzrlib.branch import BranchFormat
 
1961
            self._branch_format = BranchFormat.get_default_format()
1967
1962
        return self._branch_format
1968
1963
 
1969
1964
    def set_branch_format(self, format):
2049
2044
            if target_branch is None:
2050
2045
                if do_upgrade:
2051
2046
                    # TODO: bad monkey, hard-coded formats...
2052
 
                    from bzrlib.branch import BzrBranchFormat7
2053
 
                    new_branch_format = BzrBranchFormat7()
 
2047
                    new_branch_format = branch.BzrBranchFormat7()
2054
2048
            else:
2055
2049
                new_branch_format = target_branch._format
2056
2050
                if not new_branch_format.supports_stacking():
2125
2119
 
2126
2120
    def __get_workingtree_format(self):
2127
2121
        if self._workingtree_format is None:
2128
 
            from bzrlib.workingtree import (
2129
 
                format_registry as wt_format_registry,
2130
 
                )
2131
 
            self._workingtree_format = wt_format_registry.get_default()
 
2122
            from bzrlib.workingtree import WorkingTreeFormat
 
2123
            self._workingtree_format = WorkingTreeFormat.get_default_format()
2132
2124
        return self._workingtree_format
2133
2125
 
2134
2126
    def __set_workingtree_format(self, wt_format):