~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Andrew Bennetts
  • Date: 2007-08-30 08:11:54 UTC
  • mfrom: (2766 +trunk)
  • mto: (2535.3.55 repo-refactor)
  • mto: This revision was merged to the branch mainline in revision 2772.
  • Revision ID: andrew.bennetts@canonical.com-20070830081154-16hebp2xwr15x2hc
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
from cStringIO import StringIO
27
27
import os
28
 
import textwrap
29
28
 
30
29
from bzrlib.lazy_import import lazy_import
31
30
lazy_import(globals(), """
32
31
from stat import S_ISDIR
 
32
import textwrap
 
33
from warnings import warn
33
34
 
34
35
import bzrlib
35
36
from bzrlib import (
69
70
    note,
70
71
    )
71
72
from bzrlib.transport.local import LocalTransport
 
73
from bzrlib.symbol_versioning import (
 
74
    deprecated_function,
 
75
    deprecated_method,
 
76
    zero_ninetyone,
 
77
    )
72
78
 
73
79
 
74
80
class BzrDir(object):
309
315
        return result
310
316
 
311
317
    @staticmethod
 
318
    @deprecated_function(zero_ninetyone)
312
319
    def create_repository(base, shared=False, format=None):
313
320
        """Create a new BzrDir and Repository at the url 'base'.
314
321
 
323
330
        This must be overridden as an instance method in child classes, where
324
331
        it should take no parameters and construct whatever repository format
325
332
        that child class desires.
 
333
 
 
334
        This method is deprecated, please call create_repository on a bzrdir
 
335
        instance instead.
326
336
        """
327
337
        bzrdir = BzrDir.create(base, format)
328
338
        return bzrdir.create_repository(shared)
2353
2363
            repositories.
2354
2364
 
2355
2365
            """)
 
2366
        default_realkey = None
2356
2367
        default_help = self.get_help('default')
2357
2368
        help_pairs = []
2358
2369
        for key in self.keys():
2370
2381
            return ':%s:\n%s\n\n' % (key, 
2371
2382
                    textwrap.fill(help, initial_indent='    ', 
2372
2383
                    subsequent_indent='    '))
2373
 
        output += wrapped(default_realkey, '(default) %s' % default_help,
2374
 
                          self.get_info('default'))
 
2384
        if default_realkey is not None:
 
2385
            output += wrapped(default_realkey, '(default) %s' % default_help,
 
2386
                              self.get_info('default'))
2375
2387
        deprecated_pairs = []
2376
2388
        for key, help in help_pairs:
2377
2389
            info = self.get_info(key)
2432
2444
    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
2433
2445
    hidden=True,
2434
2446
    )
2435
 
format_registry.set_default('dirstate')
 
2447
format_registry.set_default('dirstate-tags')