~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

Hide dirstate-with-subtree format

Show diffs side-by-side

added added

removed removed

Lines of Context:
2125
2125
 
2126
2126
class BzrDirFormatInfo(object):
2127
2127
 
2128
 
    def __init__(self, native, deprecated):
 
2128
    def __init__(self, native, deprecated, hidden):
2129
2129
        self.deprecated = deprecated
2130
2130
        self.native = native
 
2131
        self.hidden = hidden
2131
2132
 
2132
2133
 
2133
2134
class BzrDirFormatRegistry(registry.Registry):
2140
2141
    def register_metadir(self, key,
2141
2142
             repository_format, help, native=True, deprecated=False,
2142
2143
             branch_format=None,
2143
 
             tree_format=None):
 
2144
             tree_format=None,
 
2145
             hidden=False):
2144
2146
        """Register a metadir subformat.
2145
2147
 
2146
2148
        These all use a BzrDirMetaFormat1 bzrdir, but can be parameterized
2178
2180
            if repository_format is not None:
2179
2181
                bd.repository_format = _load(repository_format)
2180
2182
            return bd
2181
 
        self.register(key, helper, help, native, deprecated)
 
2183
        self.register(key, helper, help, native, deprecated, hidden)
2182
2184
 
2183
 
    def register(self, key, factory, help, native=True, deprecated=False):
 
2185
    def register(self, key, factory, help, native=True, deprecated=False,
 
2186
                 hidden=False):
2184
2187
        """Register a BzrDirFormat factory.
2185
2188
        
2186
2189
        The factory must be a callable that takes one parameter: the key.
2190
2193
        supplied directly.
2191
2194
        """
2192
2195
        registry.Registry.register(self, key, factory, help, 
2193
 
            BzrDirFormatInfo(native, deprecated))
 
2196
            BzrDirFormatInfo(native, deprecated, hidden))
2194
2197
 
2195
2198
    def register_lazy(self, key, module_name, member_name, help, native=True,
2196
 
                      deprecated=False):
 
2199
                      deprecated=False, hidden=False):
2197
2200
        registry.Registry.register_lazy(self, key, module_name, member_name, 
2198
 
            help, BzrDirFormatInfo(native, deprecated))
 
2201
            help, BzrDirFormatInfo(native, deprecated, hidden))
2199
2202
 
2200
2203
    def set_default(self, key):
2201
2204
        """Set the 'default' key to be a clone of the supplied key.
2251
2254
        deprecated_pairs = []
2252
2255
        for key, help in help_pairs:
2253
2256
            info = self.get_info(key)
2254
 
            if info.deprecated:
 
2257
            if info.hidden:
 
2258
                continue
 
2259
            elif info.deprecated:
2255
2260
                deprecated_pairs.append((key, help))
2256
2261
            else:
2257
2262
                output += wrapped(key, help, info)
2292
2297
format_registry.register_metadir('dirstate-tags',
2293
2298
    'bzrlib.repofmt.knitrepo.RepositoryFormatKnit1',
2294
2299
    help='New in 0.15: Fast local operations and improved scaling for '
2295
 
        'network operations. Additionally adds support for versioning nested '
2296
 
        'bzr branches. Incompatible with bzr < 0.15.',
 
2300
        'network operations. Additionally adds support for tags.'
 
2301
        ' Incompatible with bzr < 0.15.',
2297
2302
    branch_format='bzrlib.branch.BzrBranchFormat6',
2298
2303
    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
2299
2304
    )
2304
2309
        'bzr branches. Incompatible with bzr < 0.15.',
2305
2310
    branch_format='bzrlib.branch.BzrBranchFormat6',
2306
2311
    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
 
2312
    hidden=True,
2307
2313
    )
2308
2314
format_registry.set_default('dirstate')