largefiles: use filechunkiter for iterating largefile when serving getlfile
authorMads Kiilerich <madski@unity3d.com>
Tue, 16 Apr 2013 00:40:21 +0200
changeset 19009 07e40d589b64
parent 19008 9d33d6e0d442
child 19010 e071d161b266
largefiles: use filechunkiter for iterating largefile when serving getlfile The default file iterator is line based and will give odd chunk sizes - often very short and relatively expensive.
hgext/largefiles/proto.py
--- a/hgext/largefiles/proto.py	Mon Apr 15 23:37:43 2013 +0200
+++ b/hgext/largefiles/proto.py	Tue Apr 16 00:40:21 2013 +0200
@@ -63,7 +63,7 @@
     # ssh proto does for string responses.
     def generator():
         yield '%d\n' % length
-        for chunk in f:
+        for chunk in util.filechunkiter(f):
             yield chunk
     return wireproto.streamres(generator())