~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/protocol.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-10-06 20:45:48 UTC
  • mfrom: (4728.1.2 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20091006204548-bjnc3z4k256ppimz
MutableTree.has_changes() does not require a tree parameter anymore

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
from bzrlib import errors
30
30
from bzrlib.smart import message, request
31
31
from bzrlib.trace import log_exception_quietly, mutter
32
 
from bzrlib.util.bencode import bdecode_as_tuple, bencode
 
32
from bzrlib.bencode import bdecode_as_tuple, bencode
33
33
 
34
34
 
35
35
# Protocol version strings.  These are sent as prefixes of bzr requests and
145
145
                self.request = request.SmartServerRequestHandler(
146
146
                    self._backing_transport, commands=request.request_handlers,
147
147
                    root_client_path=self._root_client_path)
148
 
                self.request.dispatch_command(req_args[0], req_args[1:])
 
148
                self.request.args_received(req_args)
149
149
                if self.request.finished_reading:
150
150
                    # trivial request
151
151
                    self.unused_data = self.in_buffer
897
897
            # We do *not* set self.decoding_failed here.  The message handler
898
898
            # has raised an error, but the decoder is still able to parse bytes
899
899
            # and determine when this message ends.
900
 
            log_exception_quietly()
 
900
            if not isinstance(exception.exc_value, errors.UnknownSmartMethod):
 
901
                log_exception_quietly()
901
902
            self.message_handler.protocol_error(exception.exc_value)
902
903
            # The state machine is ready to continue decoding, but the
903
904
            # exception has interrupted the loop that runs the state machine.
1036
1037
            raise errors.SmartMessageHandlerError(sys.exc_info())
1037
1038
 
1038
1039
    def _state_accept_reading_unused(self):
1039
 
        self.unused_data = self._get_in_buffer()
 
1040
        self.unused_data += self._get_in_buffer()
1040
1041
        self._set_in_buffer(None)
1041
1042
 
1042
1043
    def next_read_size(self):
1208
1209
        except (KeyboardInterrupt, SystemExit):
1209
1210
            raise
1210
1211
        except Exception:
 
1212
            mutter('_iter_with_errors caught error')
 
1213
            log_exception_quietly()
1211
1214
            yield sys.exc_info(), None
1212
1215
            return
1213
1216