/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/smart/protocol.py

  • Committer: Andrew Bennetts
  • Date: 2008-11-26 11:35:37 UTC
  • mto: This revision was merged to the branch mainline in revision 3981.
  • Revision ID: andrew.bennetts@canonical.com-20081126113537-9vn1v1yo4gkxi05o
TestStacking.test_fetch_copies_from_stacked_on now passes using the VersionedFile.insert_record_stream RPC; lots of debugging cruft needs removal though.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1100
1100
        self._write_func(struct.pack('!L', len(bytes)))
1101
1101
        self._write_func(bytes)
1102
1102
 
 
1103
    def _write_chunked_body_start(self):
 
1104
        self._write_func('oC')
 
1105
 
1103
1106
    def _write_error_status(self):
1104
1107
        self._write_func('oE')
1105
1108
 
1217
1220
        self._write_end()
1218
1221
        self._medium_request.finished_writing()
1219
1222
 
 
1223
    def call_with_body_stream(self, args, stream):
 
1224
        if 'hpss' in debug.debug_flags:
 
1225
            mutter('hpss call w/body stream: %r', args)
 
1226
            path = getattr(self._medium_request._medium, '_path', None)
 
1227
            if path is not None:
 
1228
                mutter('                  (to %s)', path)
 
1229
            self._request_start_time = time.time()
 
1230
        self._write_protocol_version()
 
1231
        self._write_headers(self._headers)
 
1232
        self._write_structure(args)
 
1233
        self._write_chunked_body_start()
 
1234
        # XXX: handle errors while iterating stream
 
1235
        for part in stream:
 
1236
            self._write_prefixed_body(part)
 
1237
            self.flush()
 
1238
        self._write_success_status()
 
1239
        self._write_end()
 
1240
        self._medium_request.finished_writing()
 
1241