Rev 3065: Light modifications after a failed attempt at making RangeFile iterable. in file:///v/home/vila/src/bzr/bugs/173010/

Vincent Ladeuil v.ladeuil+lp at free.fr
Mon Dec 3 16:34:14 GMT 2007


At file:///v/home/vila/src/bzr/bugs/173010/

------------------------------------------------------------
revno: 3065
revision-id:v.ladeuil+lp at free.fr-20071203163410-7o415a4mjn5ih2ni
parent: v.ladeuil+lp at free.fr-20071203135236-eh1ia9y0aurc91gb
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 173010
timestamp: Mon 2007-12-03 17:34:10 +0100
message:
  Light modifications after a failed attempt at making RangeFile iterable.
  
  * bzrlib/transport/http/__init__.py:
  (HttpTransportBase.get): Better document while we wrap th result
  into a StringIO().
  
  * bzrlib/tests/test_http_response.py:
  (TestRanges.test_range_syntax): Provide a usable file-like object.
modified:
  bzrlib/tests/test_http_response.py test_http_response.py-20060628233143-950b2a482a32505d
  bzrlib/transport/http/__init__.py http_transport.py-20050711212304-506c5fd1059ace96
-------------- next part --------------
=== modified file 'bzrlib/tests/test_http_response.py'
--- a/bzrlib/tests/test_http_response.py	2007-12-03 08:33:06 +0000
+++ b/bzrlib/tests/test_http_response.py	2007-12-03 16:34:10 +0000
@@ -165,7 +165,7 @@
 
     def test_range_syntax(self):
 
-        rf = response.RangeFile('foo', None)
+        rf = response.RangeFile('foo', StringIO())
 
         def ok(expected, header_value):
             rf.set_range_from_header(header_value)

=== modified file 'bzrlib/transport/http/__init__.py'
--- a/bzrlib/transport/http/__init__.py	2007-12-03 13:52:36 +0000
+++ b/bzrlib/transport/http/__init__.py	2007-12-03 16:34:10 +0000
@@ -133,7 +133,10 @@
         """
         code, response_file = self._get(relpath, None)
         # FIXME: some callers want an iterable... One step forward, three steps
-        # backwards :-/
+        # backwards :-/ And not only an iterable, but an iterable that can be
+        # seeked backwards, so we will never be able to do that.  One such
+        # known client is bzrlib.bundle.serializer.v4.get_bundle_reader. At the
+        # time of this writing it's even the only known client -- vila20071203
         return StringIO(response_file.read())
 
     def _get(self, relpath, ranges, tail_amount=0):



More information about the bazaar-commits mailing list