~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
from bzrlib.lazy_import import lazy_import
31
31
lazy_import(globals(), """
32
 
from stat import S_ISDIR
33
 
 
34
32
import bzrlib
35
33
from bzrlib import (
 
34
    branch as _mod_branch,
36
35
    cleanup,
37
36
    config,
38
37
    controldir,
49
48
    transport as _mod_transport,
50
49
    ui,
51
50
    urlutils,
52
 
    versionedfile,
53
51
    win32utils,
54
52
    workingtree,
55
53
    workingtree_4,
56
54
    )
57
 
from bzrlib.repofmt import pack_repo
 
55
from bzrlib.repofmt import knitpack_repo
58
56
from bzrlib.transport import (
59
57
    do_catching_redirections,
60
58
    local,
1082
1080
 
1083
1081
    def __init__(self):
1084
1082
        """Create the default hooks."""
1085
 
        hooks.Hooks.__init__(self)
1086
 
        self.create_hook(hooks.HookPoint('pre_open',
 
1083
        hooks.Hooks.__init__(self, "bzrlib.bzrdir", "BzrDir.hooks")
 
1084
        self.add_hook('pre_open',
1087
1085
            "Invoked before attempting to open a BzrDir with the transport "
1088
 
            "that the open will use.", (1, 14), None))
1089
 
        self.create_hook(hooks.HookPoint('post_repo_init',
 
1086
            "that the open will use.", (1, 14))
 
1087
        self.add_hook('post_repo_init',
1090
1088
            "Invoked after a repository has been initialized. "
1091
1089
            "post_repo_init is called with a "
1092
1090
            "bzrlib.bzrdir.RepoInitHookParams.",
1093
 
            (2, 2), None))
 
1091
            (2, 2))
1094
1092
 
1095
1093
# install the default hooks
1096
1094
BzrDir.hooks = BzrDirHooks()
1708
1706
                    # stack_on is inaccessible, JFDI.
1709
1707
                    # TODO: bad monkey, hard-coded formats...
1710
1708
                    if self.repository_format.rich_root_data:
1711
 
                        new_repo_format = pack_repo.RepositoryFormatKnitPack5RichRoot()
 
1709
                        new_repo_format = knitpack_repo.RepositoryFormatKnitPack5RichRoot()
1712
1710
                    else:
1713
 
                        new_repo_format = pack_repo.RepositoryFormatKnitPack5()
 
1711
                        new_repo_format = knitpack_repo.RepositoryFormatKnitPack5()
1714
1712
            else:
1715
1713
                # If the target already supports stacking, then we know the
1716
1714
                # project is already able to use stacking, so auto-upgrade
1860
1858
            # TODO: conversions of Branch and Tree should be done by
1861
1859
            # InterXFormat lookups/some sort of registry.
1862
1860
            # Avoid circular imports
1863
 
            from bzrlib import branch as _mod_branch
1864
1861
            old = branch._format.__class__
1865
1862
            new = self.target_format.get_branch_format().__class__
1866
1863
            while old != new:
2157
2154
    hidden=True,
2158
2155
    )
2159
2156
register_metadir(controldir.format_registry, 'pack-0.92',
2160
 
    'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack1',
 
2157
    'bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack1',
2161
2158
    help='New in 0.92: Pack-based format with data compatible with '
2162
2159
        'dirstate-tags format repositories. Interoperates with '
2163
2160
        'bzr repositories before 0.92 but cannot be read by bzr < 0.92. '
2166
2163
    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
2167
2164
    )
2168
2165
register_metadir(controldir.format_registry, 'pack-0.92-subtree',
2169
 
    'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack3',
 
2166
    'bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack3',
2170
2167
    help='New in 0.92: Pack-based format with data compatible with '
2171
2168
        'dirstate-with-subtree format repositories. Interoperates with '
2172
2169
        'bzr repositories before 0.92 but cannot be read by bzr < 0.92. '
2177
2174
    experimental=True,
2178
2175
    )
2179
2176
register_metadir(controldir.format_registry, 'rich-root-pack',
2180
 
    'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack4',
 
2177
    'bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack4',
2181
2178
    help='New in 1.0: A variant of pack-0.92 that supports rich-root data '
2182
2179
         '(needed for bzr-svn and bzr-git).',
2183
2180
    branch_format='bzrlib.branch.BzrBranchFormat6',
2185
2182
    hidden=True,
2186
2183
    )
2187
2184
register_metadir(controldir.format_registry, '1.6',
2188
 
    'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack5',
 
2185
    'bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack5',
2189
2186
    help='A format that allows a branch to indicate that there is another '
2190
2187
         '(stacked) repository that should be used to access data that is '
2191
2188
         'not present locally.',
2194
2191
    hidden=True,
2195
2192
    )
2196
2193
register_metadir(controldir.format_registry, '1.6.1-rich-root',
2197
 
    'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack5RichRoot',
 
2194
    'bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack5RichRoot',
2198
2195
    help='A variant of 1.6 that supports rich-root data '
2199
2196
         '(needed for bzr-svn and bzr-git).',
2200
2197
    branch_format='bzrlib.branch.BzrBranchFormat7',
2202
2199
    hidden=True,
2203
2200
    )
2204
2201
register_metadir(controldir.format_registry, '1.9',
2205
 
    'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack6',
 
2202
    'bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack6',
2206
2203
    help='A repository format using B+tree indexes. These indexes '
2207
2204
         'are smaller in size, have smarter caching and provide faster '
2208
2205
         'performance for most operations.',
2211
2208
    hidden=True,
2212
2209
    )
2213
2210
register_metadir(controldir.format_registry, '1.9-rich-root',
2214
 
    'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack6RichRoot',
 
2211
    'bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack6RichRoot',
2215
2212
    help='A variant of 1.9 that supports rich-root data '
2216
2213
         '(needed for bzr-svn and bzr-git).',
2217
2214
    branch_format='bzrlib.branch.BzrBranchFormat7',
2219
2216
    hidden=True,
2220
2217
    )
2221
2218
register_metadir(controldir.format_registry, '1.14',
2222
 
    'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack6',
 
2219
    'bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack6',
2223
2220
    help='A working-tree format that supports content filtering.',
2224
2221
    branch_format='bzrlib.branch.BzrBranchFormat7',
2225
2222
    tree_format='bzrlib.workingtree.WorkingTreeFormat5',
2226
2223
    )
2227
2224
register_metadir(controldir.format_registry, '1.14-rich-root',
2228
 
    'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack6RichRoot',
 
2225
    'bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack6RichRoot',
2229
2226
    help='A variant of 1.14 that supports rich-root data '
2230
2227
         '(needed for bzr-svn and bzr-git).',
2231
2228
    branch_format='bzrlib.branch.BzrBranchFormat7',
2249
2246
                 # chk based subtree format.
2250
2247
    )
2251
2248
register_metadir(controldir.format_registry, 'development5-subtree',
2252
 
    'bzrlib.repofmt.pack_repo.RepositoryFormatPackDevelopment2Subtree',
 
2249
    'bzrlib.repofmt.knitpack_repo.RepositoryFormatPackDevelopment2Subtree',
2253
2250
    help='Development format, subtree variant. Can convert data to and '
2254
2251
        'from pack-0.92-subtree (and anything compatible with '
2255
2252
        'pack-0.92-subtree) format repositories. Repositories and branches in '