diff hgext/largefiles/remotestore.py @ 19001:2a35296a6304

largefiles: drop lfutil.blockstream - use filechunkiter like everybody else The old chunk size is kept - just to avoid changing it.
author Mads Kiilerich <madski@unity3d.com>
date Mon, 15 Apr 2013 23:43:44 +0200
parents 003730ca254d
children 5083baa6cbf8
line wrap: on
line diff
--- a/hgext/largefiles/remotestore.py	Mon Apr 15 23:35:43 2013 +0200
+++ b/hgext/largefiles/remotestore.py	Mon Apr 15 23:43:44 2013 +0200
@@ -74,7 +74,11 @@
         # Mercurial does not close its SSH connections after writing a stream
         if length is not None:
             infile = lfutil.limitreader(infile, length)
-        return lfutil.copyandhash(lfutil.blockstream(infile), tmpfile)
+        try:
+            return lfutil.copyandhash(util.filechunkiter(infile, 128 * 1024),
+                                      tmpfile)
+        finally:
+            infile.close()
 
     def _verifyfile(self, cctx, cset, contents, standin, verified):
         filename = lfutil.splitstandin(standin)