/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 bzrlib/builtins.py

  • Committer: Vincent Ladeuil
  • Date: 2008-10-02 13:25:47 UTC
  • mfrom: (3759 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3760.
  • Revision ID: v.ladeuil+lp@free.fr-20081002132547-txs4fs006e9p0gt1
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""builtin bzr commands"""
18
18
 
19
19
import os
20
 
from StringIO import StringIO
21
20
 
22
21
from bzrlib.lazy_import import lazy_import
23
22
lazy_import(globals(), """
24
23
import codecs
 
24
import cStringIO
25
25
import sys
26
26
import time
27
27
 
34
34
    config,
35
35
    errors,
36
36
    globbing,
37
 
    ignores,
38
37
    log,
39
38
    merge as _mod_merge,
40
39
    merge_directive,
56
55
 
57
56
from bzrlib.commands import Command, display_command
58
57
from bzrlib.option import ListOption, Option, RegistryOption, custom_help
59
 
from bzrlib.trace import mutter, note, warning, is_quiet, info
 
58
from bzrlib.trace import mutter, note, warning, is_quiet
60
59
 
61
60
 
62
61
def tree_files(file_list, default_branch=u'.'):
1304
1303
         RegistryOption('format',
1305
1304
                help='Specify a format for this branch. '
1306
1305
                'See "help formats".',
1307
 
                registry=bzrdir.format_registry,
1308
 
                converter=bzrdir.format_registry.make_bzrdir,
 
1306
                lazy_registry=('bzrlib.bzrdir', 'format_registry'),
 
1307
                converter=lambda name: bzrdir.format_registry.make_bzrdir(name),
1309
1308
                value_switches=True,
1310
1309
                title="Branch Format",
1311
1310
                ),
1393
1392
    takes_options = [RegistryOption('format',
1394
1393
                            help='Specify a format for this repository. See'
1395
1394
                                 ' "bzr help formats" for details.',
1396
 
                            registry=bzrdir.format_registry,
1397
 
                            converter=bzrdir.format_registry.make_bzrdir,
 
1395
                            lazy_registry=('bzrlib.bzrdir', 'format_registry'),
 
1396
                            converter=lambda name: bzrdir.format_registry.make_bzrdir(name),
1398
1397
                            value_switches=True, title='Repository format'),
1399
1398
                     Option('no-trees',
1400
1399
                             help='Branches in the repository will default to'
1682
1681
    takes_options = [
1683
1682
            Option('forward',
1684
1683
                   help='Show from oldest to newest.'),
1685
 
            Option('timezone',
1686
 
                   type=str,
1687
 
                   help='Display timezone as local, original, or utc.'),
 
1684
            'timezone',
1688
1685
            custom_help('verbose',
1689
1686
                   help='Show files changed in each revision.'),
1690
1687
            'show-ids',
2328
2325
            if my_message is None and not file:
2329
2326
                t = make_commit_message_template_encoded(tree,
2330
2327
                        selected_list, diff=show_diff,
2331
 
                        output_encoding=bzrlib.user_encoding)
 
2328
                        output_encoding=osutils.get_user_encoding())
2332
2329
                my_message = edit_commit_message_encoded(t)
2333
2330
                if my_message is None:
2334
2331
                    raise errors.BzrCommandError("please specify a commit"
2338
2335
                    "please specify either --message or --file")
2339
2336
            if file:
2340
2337
                my_message = codecs.open(file, 'rt',
2341
 
                                         bzrlib.user_encoding).read()
 
2338
                                         osutils.get_user_encoding()).read()
2342
2339
            if my_message == "":
2343
2340
                raise errors.BzrCommandError("empty commit message specified")
2344
2341
            return my_message
2444
2441
                    RegistryOption('format',
2445
2442
                        help='Upgrade to a specific format.  See "bzr help'
2446
2443
                             ' formats" for details.',
2447
 
                        registry=bzrdir.format_registry,
2448
 
                        converter=bzrdir.format_registry.make_bzrdir,
 
2444
                        lazy_registry=('bzrlib.bzrdir', 'format_registry'),
 
2445
                        converter=lambda name: bzrdir.format_registry.make_bzrdir(name),
2449
2446
                        value_switches=True, title='Branch format'),
2450
2447
                    ]
2451
2448
 
2708
2705
            first=False, list_only=False,
2709
2706
            randomize=None, exclude=None, strict=False,
2710
2707
            load_list=None, debugflag=None, starting_with=None):
2711
 
        import bzrlib.ui
2712
2708
        from bzrlib.tests import selftest
2713
2709
        import bzrlib.benchmarks as benchmarks
2714
2710
        from bzrlib.benchmarks import tree_creator
4209
4205
        from bzrlib.revision import NULL_REVISION
4210
4206
        branch = Branch.open_containing(from_)[0]
4211
4207
        if output is None:
4212
 
            outfile = StringIO()
 
4208
            outfile = cStringIO.StringIO()
4213
4209
        elif output == '-':
4214
4210
            outfile = self.outf
4215
4211
        else: