~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Andrew Bennetts
  • Date: 2008-02-18 08:30:38 UTC
  • mto: This revision was merged to the branch mainline in revision 3756.
  • Revision ID: andrew.bennetts@canonical.com-20080218083038-tts55zsx5xrz3l2e
Lots of assorted hackery to reduce the number of imports for common operations.  Improves 'rocks', 'st' and 'help' times by ~50ms on my laptop.

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
 
2306
2306
            if my_message is None and not file:
2307
2307
                t = make_commit_message_template_encoded(tree,
2308
2308
                        selected_list, diff=show_diff,
2309
 
                        output_encoding=bzrlib.user_encoding)
 
2309
                        output_encoding=osutils.get_user_encoding())
2310
2310
                my_message = edit_commit_message_encoded(t)
2311
2311
                if my_message is None:
2312
2312
                    raise errors.BzrCommandError("please specify a commit"
4068
4068
        from bzrlib.revision import NULL_REVISION
4069
4069
        branch = Branch.open_containing(from_)[0]
4070
4070
        if output is None:
4071
 
            outfile = StringIO()
 
4071
            outfile = cStringIO.StringIO()
4072
4072
        elif output == '-':
4073
4073
            outfile = self.outf
4074
4074
        else: