~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.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:
761
761
    if not opt_no_aliases:
762
762
        alias_argv = get_alias(argv[0])
763
763
        if alias_argv:
764
 
            alias_argv = [a.decode(bzrlib.user_encoding) for a in alias_argv]
 
764
            user_encoding = osutils.get_user_encoding()
 
765
            alias_argv = [a.decode(user_encoding) for a in alias_argv]
765
766
            argv[0] = alias_argv.pop(0)
766
767
 
767
768
    cmd = argv.pop(0)
818
819
    from bzrlib.ui.text import TextUIFactory
819
820
    bzrlib.ui.ui_factory = TextUIFactory()
820
821
    try:
821
 
        argv = [a.decode(bzrlib.user_encoding) for a in argv[1:]]
 
822
        user_encoding = osutils.get_user_encoding()
 
823
        argv = [a.decode(user_encoding) for a in argv[1:]]
822
824
    except UnicodeDecodeError:
823
825
        raise errors.BzrError(("Parameter '%r' is unsupported by the current "
824
826
                                                            "encoding." % a))