/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/bzrdir.py

Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
lazy_import(globals(), """
34
34
import breezy
35
35
from breezy import (
36
 
    branch as _mod_branch,
 
36
    bzrbranch as _mod_bzrbranch,
37
37
    cleanup,
38
38
    errors,
39
39
    fetch,
921
921
 
922
922
        This might be a synthetic object for e.g. RemoteBranch and SVN.
923
923
        """
924
 
        from .branch import BranchFormatMetadir
 
924
        from .bzrbranch import BranchFormatMetadir
925
925
        return BranchFormatMetadir.find_format(self, name=name)
926
926
 
927
927
    def _get_mkdir_mode(self):
932
932
 
933
933
    def get_branch_reference(self, name=None):
934
934
        """See BzrDir.get_branch_reference()."""
935
 
        from .branch import BranchFormatMetadir
 
935
        from .bzrbranch import BranchFormatMetadir
936
936
        format = BranchFormatMetadir.find_format(self, name=name)
937
937
        return format.get_reference(self, name=name)
938
938
 
939
939
    def set_branch_reference(self, target_branch, name=None):
940
 
        format = _mod_branch.BranchReferenceFormat()
 
940
        format = _mod_bzrbranch.BranchReferenceFormat()
941
941
        return format.initialize(self, target_branch=target_branch, name=name)
942
942
 
943
943
    def get_branch_transport(self, branch_format, name=None):
1027
1027
        Note: if you're going to open the working tree, you should just go
1028
1028
        ahead and try, and not ask permission first.
1029
1029
        """
1030
 
        from .workingtree import WorkingTreeFormatMetaDir
 
1030
        from .bzrworkingtree import WorkingTreeFormatMetaDir
1031
1031
        try:
1032
1032
            WorkingTreeFormatMetaDir.find_format_string(self)
1033
1033
        except errors.NoWorkingTree:
1076
1076
 
1077
1077
    def open_repository(self, unsupported=False):
1078
1078
        """See BzrDir.open_repository."""
1079
 
        from .repository import RepositoryFormatMetaDir
 
1079
        from .bzrrepository import RepositoryFormatMetaDir
1080
1080
        format = RepositoryFormatMetaDir.find_format(self)
1081
1081
        format.check_support_status(unsupported)
1082
1082
        return format.open(self, _found=True)
1084
1084
    def open_workingtree(self, unsupported=False,
1085
1085
            recommend_upgrade=True):
1086
1086
        """See BzrDir.open_workingtree."""
1087
 
        from .workingtree import WorkingTreeFormatMetaDir
 
1087
        from .bzrworkingtree import WorkingTreeFormatMetaDir
1088
1088
        format = WorkingTreeFormatMetaDir.find_format(self)
1089
1089
        format.check_support_status(unsupported, recommend_upgrade,
1090
1090
            basedir=self.root_transport.base)
1643
1643
            if target_branch is None:
1644
1644
                if do_upgrade:
1645
1645
                    # TODO: bad monkey, hard-coded formats...
1646
 
                    from .branch import BzrBranchFormat7
 
1646
                    from .bzrbranch import BzrBranchFormat7
1647
1647
                    new_branch_format = BzrBranchFormat7()
1648
1648
            else:
1649
1649
                new_branch_format = target_branch._format
1809
1809
            new = self.target_format.get_branch_format().__class__
1810
1810
            while old != new:
1811
1811
                if (old == fullhistorybranch.BzrBranchFormat5 and
1812
 
                    new in (_mod_branch.BzrBranchFormat6,
1813
 
                        _mod_branch.BzrBranchFormat7,
1814
 
                        _mod_branch.BzrBranchFormat8)):
1815
 
                    branch_converter = _mod_branch.Converter5to6()
1816
 
                elif (old == _mod_branch.BzrBranchFormat6 and
1817
 
                    new in (_mod_branch.BzrBranchFormat7,
1818
 
                            _mod_branch.BzrBranchFormat8)):
1819
 
                    branch_converter = _mod_branch.Converter6to7()
1820
 
                elif (old == _mod_branch.BzrBranchFormat7 and
1821
 
                      new is _mod_branch.BzrBranchFormat8):
1822
 
                    branch_converter = _mod_branch.Converter7to8()
 
1812
                    new in (_mod_bzrbranch.BzrBranchFormat6,
 
1813
                        _mod_bzrbranch.BzrBranchFormat7,
 
1814
                        _mod_bzrbranch.BzrBranchFormat8)):
 
1815
                    branch_converter = _mod_bzrbranch.Converter5to6()
 
1816
                elif (old == _mod_bzrbranch.BzrBranchFormat6 and
 
1817
                    new in (_mod_bzrbranch.BzrBranchFormat7,
 
1818
                            _mod_bzrbranch.BzrBranchFormat8)):
 
1819
                    branch_converter = _mod_bzrbranch.Converter6to7()
 
1820
                elif (old == _mod_bzrbranch.BzrBranchFormat7 and
 
1821
                      new is _mod_bzrbranch.BzrBranchFormat8):
 
1822
                    branch_converter = _mod_bzrbranch.Converter7to8()
1823
1823
                else:
1824
1824
                    raise errors.BadConversionTarget("No converter", new,
1825
1825
                        branch._format)
2127
2127
    'breezy.repofmt.knitrepo.RepositoryFormatKnit1',
2128
2128
    help='Variant of dirstate with support for tags. '
2129
2129
        'Introduced in bzr 0.15.',
2130
 
    branch_format='breezy.branch.BzrBranchFormat6',
 
2130
    branch_format='breezy.bzrbranch.BzrBranchFormat6',
2131
2131
    tree_format='breezy.workingtree_4.WorkingTreeFormat4',
2132
2132
    hidden=True,
2133
2133
    deprecated=True)
2135
2135
    'breezy.repofmt.knitrepo.RepositoryFormatKnit4',
2136
2136
    help='Variant of dirstate with better handling of tree roots. '
2137
2137
        'Introduced in bzr 1.0',
2138
 
    branch_format='breezy.branch.BzrBranchFormat6',
 
2138
    branch_format='breezy.bzrbranch.BzrBranchFormat6',
2139
2139
    tree_format='breezy.workingtree_4.WorkingTreeFormat4',
2140
2140
    hidden=True,
2141
2141
    deprecated=True)
2143
2143
    'breezy.repofmt.knitrepo.RepositoryFormatKnit3',
2144
2144
    help='Variant of dirstate with support for nested trees. '
2145
2145
         'Introduced in 0.15.',
2146
 
    branch_format='breezy.branch.BzrBranchFormat6',
 
2146
    branch_format='breezy.bzrbranch.BzrBranchFormat6',
2147
2147
    tree_format='breezy.workingtree_4.WorkingTreeFormat4',
2148
2148
    experimental=True,
2149
2149
    hidden=True,
2154
2154
        'Interoperates with bzr repositories before 0.92 but cannot be '
2155
2155
        'read by bzr < 0.92. '
2156
2156
        ,
2157
 
    branch_format='breezy.branch.BzrBranchFormat6',
 
2157
    branch_format='breezy.bzrbranch.BzrBranchFormat6',
2158
2158
    tree_format='breezy.workingtree_4.WorkingTreeFormat4',
2159
2159
    deprecated=True,
2160
2160
    )
2164
2164
        'Introduced in 0.92. Interoperates with '
2165
2165
        'bzr repositories before 0.92 but cannot be read by bzr < 0.92. '
2166
2166
        ,
2167
 
    branch_format='breezy.branch.BzrBranchFormat6',
 
2167
    branch_format='breezy.bzrbranch.BzrBranchFormat6',
2168
2168
    tree_format='breezy.workingtree_4.WorkingTreeFormat4',
2169
2169
    hidden=True,
2170
2170
    deprecated=True,
2174
2174
    'breezy.repofmt.knitpack_repo.RepositoryFormatKnitPack4',
2175
2175
    help='A variant of pack-0.92 that supports rich-root data '
2176
2176
         '(needed for bzr-svn and bzr-git). Introduced in 1.0.',
2177
 
    branch_format='breezy.branch.BzrBranchFormat6',
 
2177
    branch_format='breezy.bzrbranch.BzrBranchFormat6',
2178
2178
    tree_format='breezy.workingtree_4.WorkingTreeFormat4',
2179
2179
    hidden=True,
2180
2180
    deprecated=True,
2184
2184
    help='A format that allows a branch to indicate that there is another '
2185
2185
         '(stacked) repository that should be used to access data that is '
2186
2186
         'not present locally.',
2187
 
    branch_format='breezy.branch.BzrBranchFormat7',
 
2187
    branch_format='breezy.bzrbranch.BzrBranchFormat7',
2188
2188
    tree_format='breezy.workingtree_4.WorkingTreeFormat4',
2189
2189
    hidden=True,
2190
2190
    deprecated=True,
2193
2193
    'breezy.repofmt.knitpack_repo.RepositoryFormatKnitPack5RichRoot',
2194
2194
    help='A variant of 1.6 that supports rich-root data '
2195
2195
         '(needed for bzr-svn and bzr-git).',
2196
 
    branch_format='breezy.branch.BzrBranchFormat7',
 
2196
    branch_format='breezy.bzrbranch.BzrBranchFormat7',
2197
2197
    tree_format='breezy.workingtree_4.WorkingTreeFormat4',
2198
2198
    hidden=True,
2199
2199
    deprecated=True,
2203
2203
    help='A repository format using B+tree indexes. These indexes '
2204
2204
         'are smaller in size, have smarter caching and provide faster '
2205
2205
         'performance for most operations.',
2206
 
    branch_format='breezy.branch.BzrBranchFormat7',
 
2206
    branch_format='breezy.bzrbranch.BzrBranchFormat7',
2207
2207
    tree_format='breezy.workingtree_4.WorkingTreeFormat4',
2208
2208
    hidden=True,
2209
2209
    deprecated=True,
2212
2212
    'breezy.repofmt.knitpack_repo.RepositoryFormatKnitPack6RichRoot',
2213
2213
    help='A variant of 1.9 that supports rich-root data '
2214
2214
         '(needed for bzr-svn and bzr-git).',
2215
 
    branch_format='breezy.branch.BzrBranchFormat7',
 
2215
    branch_format='breezy.bzrbranch.BzrBranchFormat7',
2216
2216
    tree_format='breezy.workingtree_4.WorkingTreeFormat4',
2217
2217
    hidden=True,
2218
2218
    deprecated=True,
2220
2220
register_metadir(controldir.format_registry, '1.14',
2221
2221
    'breezy.repofmt.knitpack_repo.RepositoryFormatKnitPack6',
2222
2222
    help='A working-tree format that supports content filtering.',
2223
 
    branch_format='breezy.branch.BzrBranchFormat7',
 
2223
    branch_format='breezy.bzrbranch.BzrBranchFormat7',
2224
2224
    tree_format='breezy.workingtree_4.WorkingTreeFormat5',
2225
2225
    hidden=True,
2226
2226
    deprecated=True,
2229
2229
    'breezy.repofmt.knitpack_repo.RepositoryFormatKnitPack6RichRoot',
2230
2230
    help='A variant of 1.14 that supports rich-root data '
2231
2231
         '(needed for bzr-svn and bzr-git).',
2232
 
    branch_format='breezy.branch.BzrBranchFormat7',
 
2232
    branch_format='breezy.bzrbranch.BzrBranchFormat7',
2233
2233
    tree_format='breezy.workingtree_4.WorkingTreeFormat5',
2234
2234
    hidden=True,
2235
2235
    deprecated=True,
2243
2243
        'this format can only be read by bzr.dev. Please read '
2244
2244
        'http://doc.bazaar.canonical.com/latest/developers/development-repo.html '
2245
2245
        'before use.',
2246
 
    branch_format='breezy.branch.BzrBranchFormat7',
 
2246
    branch_format='breezy.bzrbranch.BzrBranchFormat7',
2247
2247
    tree_format='breezy.workingtree_4.WorkingTreeFormat6',
2248
2248
    experimental=True,
2249
2249
    hidden=True,
2259
2259
        'this format can only be read by bzr.dev. Please read '
2260
2260
        'http://doc.bazaar.canonical.com/latest/developers/development-repo.html '
2261
2261
        'before use.',
2262
 
    branch_format='breezy.branch.BzrBranchFormat7',
 
2262
    branch_format='breezy.bzrbranch.BzrBranchFormat7',
2263
2263
    tree_format='breezy.workingtree_4.WorkingTreeFormat6',
2264
2264
    experimental=True,
2265
2265
    hidden=True,
2269
2269
register_metadir(controldir.format_registry, 'development-colo',
2270
2270
    'breezy.repofmt.groupcompress_repo.RepositoryFormat2a',
2271
2271
    help='The 2a format with experimental support for colocated branches.\n',
2272
 
    branch_format='breezy.branch.BzrBranchFormat7',
 
2272
    branch_format='breezy.bzrbranch.BzrBranchFormat7',
2273
2273
    tree_format='breezy.workingtree_4.WorkingTreeFormat6',
2274
2274
    experimental=True,
2275
2275
    bzrdir_format=BzrDirMetaFormat1Colo,
2286
2286
        'Provides rich roots which are a one-way transition.\n',
2287
2287
        # 'storage in packs, 255-way hashed CHK inventory, bencode revision, group compress, '
2288
2288
        # 'rich roots. Supported by bzr 1.16 and later.',
2289
 
    branch_format='breezy.branch.BzrBranchFormat7',
 
2289
    branch_format='breezy.bzrbranch.BzrBranchFormat7',
2290
2290
    tree_format='breezy.workingtree_4.WorkingTreeFormat6',
2291
2291
    experimental=False,
2292
2292
    )
2295
2295
# of the default format
2296
2296
register_metadir(controldir.format_registry, 'default-rich-root',
2297
2297
    'breezy.repofmt.groupcompress_repo.RepositoryFormat2a',
2298
 
    branch_format='breezy.branch.BzrBranchFormat7',
 
2298
    branch_format='breezy.bzrbranch.BzrBranchFormat7',
2299
2299
    tree_format='breezy.workingtree_4.WorkingTreeFormat6',
2300
2300
    alias=True,
2301
2301
    hidden=True,