# HG changeset patch # User Matt Mackall # Date 2010-08-05 21:17:17 # Node ID eb7b04657dae79f4b6b707022e3633faa97824da # Parent 12998fd17fbc9a26ac144da32c66368b7c11dc0a verify: reduce memory footprint when unpacking files By never holding a reference to the unpacked string, we avoid holding two consecutive large files in memory. diff --git a/mercurial/verify.py b/mercurial/verify.py --- a/mercurial/verify.py +++ b/mercurial/verify.py @@ -243,12 +243,12 @@ def _verify(repo): # verify contents try: - t = fl.read(n) + l = len(fl.read(n)) rp = fl.renamed(n) - if len(t) != fl.size(i): + if l != fl.size(i): if len(fl.revision(n)) != fl.size(i): err(lr, _("unpacked size is %s, %s expected") % - (len(t), fl.size(i)), f) + (l, fl.size(i)), f) except Exception, inst: exc(lr, _("unpacking %s") % short(n), inst, f)