# HG changeset patch # User Mads Kiilerich # Date 1365982909 -7200 # Node ID 5f9019e6d451aed829bbae55f56ed317aa5c9e17 # Parent 3de9b1f9ebc3e95db2d77079bb1f33b15cdda311 largefiles: don't store whole file in memory for 'cat' diff -r 3de9b1f9ebc3 -r 5f9019e6d451 hgext/largefiles/lfcommands.py --- a/hgext/largefiles/lfcommands.py Tue Apr 16 13:55:38 2013 +0200 +++ b/hgext/largefiles/lfcommands.py Mon Apr 15 01:41:49 2013 +0200 @@ -542,7 +542,8 @@ path = lfutil.usercachepath(repo.ui, hash) fpout = cmdutil.makefileobj(repo, filename) fpin = open(path, "rb") - fpout.write(fpin.read()) + for chunk in lfutil.blockstream(fpin): + fpout.write(chunk) fpout.close() fpin.close() return 0