/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/medium.py

  • Committer: John Arbash Meinel
  • Date: 2007-07-31 21:20:02 UTC
  • mto: This revision was merged to the branch mainline in revision 2688.
  • Revision ID: john@arbash-meinel.com-20070731212002-tq2bht51jbfedjlk
Stop tracking medium bytes if we aren't going to use it

Show diffs side-by-side

added added

removed removed

Lines of Context:
255
255
        # pattern as BodyReader if it gets more complex.
256
256
        # valid states are: "writing", "reading", "done"
257
257
        self._state = "writing"
258
 
        self._bytes_written = 0
259
 
        self._bytes_read = 0
260
258
 
261
259
    def accept_bytes(self, bytes):
262
260
        """Accept bytes for inclusion in this request.
270
268
        """
271
269
        if self._state != "writing":
272
270
            raise errors.WritingCompleted(self)
273
 
        self._bytes_written += len(bytes)
274
271
        self._accept_bytes(bytes)
275
272
 
276
273
    def _accept_bytes(self, bytes):
337
334
            raise errors.WritingNotComplete(self)
338
335
        if self._state != "reading":
339
336
            raise errors.ReadingCompleted(self)
340
 
        # Technically we haven't read them yet, but we are assuming we will get
341
 
        # this many bytes back.
342
 
        self._bytes_read += count
343
337
        return self._read_bytes(count)
344
338
 
345
339
    def _read_bytes(self, count):