~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Andrew Bennetts
  • Date: 2007-11-10 15:09:09 UTC
  • mfrom: (2916.2.17 streamable-containers)
  • mto: This revision was merged to the branch mainline in revision 3174.
  • Revision ID: andrew.bennetts@canonical.com-20071110150909-ik5254kgn930th10
Merge streamable-containers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2293
2293
 
2294
2294
class BzrDirFormatInfo(object):
2295
2295
 
2296
 
    def __init__(self, native, deprecated, hidden):
 
2296
    def __init__(self, native, deprecated, hidden, experimental):
2297
2297
        self.deprecated = deprecated
2298
2298
        self.native = native
2299
2299
        self.hidden = hidden
 
2300
        self.experimental = experimental
2300
2301
 
2301
2302
 
2302
2303
class BzrDirFormatRegistry(registry.Registry):
2310
2311
             repository_format, help, native=True, deprecated=False,
2311
2312
             branch_format=None,
2312
2313
             tree_format=None,
2313
 
             hidden=False):
 
2314
             hidden=False,
 
2315
             experimental=False):
2314
2316
        """Register a metadir subformat.
2315
2317
 
2316
2318
        These all use a BzrDirMetaFormat1 bzrdir, but can be parameterized
2348
2350
            if repository_format is not None:
2349
2351
                bd.repository_format = _load(repository_format)
2350
2352
            return bd
2351
 
        self.register(key, helper, help, native, deprecated, hidden)
 
2353
        self.register(key, helper, help, native, deprecated, hidden,
 
2354
            experimental)
2352
2355
 
2353
2356
    def register(self, key, factory, help, native=True, deprecated=False,
2354
 
                 hidden=False):
 
2357
                 hidden=False, experimental=False):
2355
2358
        """Register a BzrDirFormat factory.
2356
2359
        
2357
2360
        The factory must be a callable that takes one parameter: the key.
2361
2364
        supplied directly.
2362
2365
        """
2363
2366
        registry.Registry.register(self, key, factory, help, 
2364
 
            BzrDirFormatInfo(native, deprecated, hidden))
 
2367
            BzrDirFormatInfo(native, deprecated, hidden, experimental))
2365
2368
 
2366
2369
    def register_lazy(self, key, module_name, member_name, help, native=True,
2367
 
                      deprecated=False, hidden=False):
 
2370
                      deprecated=False, hidden=False, experimental=False):
2368
2371
        registry.Registry.register_lazy(self, key, module_name, member_name, 
2369
 
            help, BzrDirFormatInfo(native, deprecated, hidden))
 
2372
            help, BzrDirFormatInfo(native, deprecated, hidden, experimental))
2370
2373
 
2371
2374
    def set_default(self, key):
2372
2375
        """Set the 'default' key to be a clone of the supplied key.
2419
2422
            output += wrapped(default_realkey, '(default) %s' % default_help,
2420
2423
                              self.get_info('default'))
2421
2424
        deprecated_pairs = []
 
2425
        experimental_pairs = []
2422
2426
        for key, help in help_pairs:
2423
2427
            info = self.get_info(key)
2424
2428
            if info.hidden:
2425
2429
                continue
2426
2430
            elif info.deprecated:
2427
2431
                deprecated_pairs.append((key, help))
 
2432
            elif info.experimental:
 
2433
                experimental_pairs.append((key, help))
2428
2434
            else:
2429
2435
                output += wrapped(key, help, info)
 
2436
        if len(experimental_pairs) > 0:
 
2437
            output += "Experimental formats are shown below.\n\n"
 
2438
            for key, help in experimental_pairs:
 
2439
                info = self.get_info(key)
 
2440
                output += wrapped(key, help, info)
2430
2441
        if len(deprecated_pairs) > 0:
2431
2442
            output += "Deprecated formats are shown below.\n\n"
2432
2443
            for key, help in deprecated_pairs:
2478
2489
    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
2479
2490
    hidden=True,
2480
2491
    )
 
2492
format_registry.register_metadir('knitpack-experimental',
 
2493
    'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack1',
 
2494
    help='New in 0.92: Pack-based format with data compatible with '
 
2495
        'dirstate-tags format repositories. Interoperates with '
 
2496
        'bzr repositories before 0.92 but cannot be read by bzr < 0.92. '
 
2497
        'NOTE: This format is experimental. Before using it, please read '
 
2498
        'http://doc.bazaar-vcs.org/latest/developers/knitpack.html.',
 
2499
    branch_format='bzrlib.branch.BzrBranchFormat6',
 
2500
    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
 
2501
    experimental=True,
 
2502
    )
 
2503
format_registry.register_metadir('knitpack-subtree-experimental',
 
2504
    'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack3',
 
2505
    help='New in 0.92: Pack-based format with data compatible with '
 
2506
        'dirstate-with-subtree format repositories. Interoperates with '
 
2507
        'bzr repositories before 0.92 but cannot be read by bzr < 0.92. '
 
2508
        'NOTE: This format is experimental. Before using it, please read '
 
2509
        'http://doc.bazaar-vcs.org/latest/developers/knitpack.html.',
 
2510
    branch_format='bzrlib.branch.BzrBranchFormat6',
 
2511
    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
 
2512
    hidden=True,
 
2513
    experimental=True,
 
2514
    )
2481
2515
format_registry.set_default('dirstate-tags')