~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Vincent Ladeuil
  • Date: 2010-10-08 10:50:51 UTC
  • mfrom: (5050.17.31 2.2.2-dev)
  • mto: This revision was merged to the branch mainline in revision 5474.
  • Revision ID: v.ladeuil+lp@free.fr-20101008105051-xd4knkrohzclffic
Merge 2.2 into trunk including fixes for bug #651706 and bug #646133

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2011 Canonical Ltd
 
1
# Copyright (C) 2005-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
691
691
            return self.run(**all_cmd_args)
692
692
        finally:
693
693
            # reset it, so that other commands run in the same process won't
694
 
            # inherit state. Before we reset it, log any activity, so that it
695
 
            # gets properly tracked.
696
 
            ui.ui_factory.log_transport_activity(
697
 
                display=('bytes' in debug.debug_flags))
 
694
            # inherit state
698
695
            trace.set_verbosity_level(0)
699
696
 
700
697
    def _setup_run(self):
818
815
    else:
819
816
        args = argv
820
817
 
821
 
    # for python 2.5 and later, optparse raises this exception if a non-ascii
822
 
    # option name is given.  See http://bugs.python.org/issue2931
823
 
    try:
824
 
        options, args = parser.parse_args(args)
825
 
    except UnicodeEncodeError,e:
826
 
        raise errors.BzrCommandError('Only ASCII permitted in option names')
827
 
 
 
818
    options, args = parser.parse_args(args)
828
819
    opts = dict([(k, v) for k, v in options.__dict__.iteritems() if
829
820
                 v is not option.OptionParser.DEFAULT_VALUE])
830
821
    return args, opts
1205
1196
    argv = _specified_or_unicode_argv(argv)
1206
1197
    _register_builtin_commands()
1207
1198
    ret = run_bzr_catch_errors(argv)
 
1199
    bzrlib.ui.ui_factory.log_transport_activity(
 
1200
        display=('bytes' in debug.debug_flags))
1208
1201
    trace.mutter("return code %d", ret)
1209
1202
    return ret
1210
1203