comparison mercurial/verify.py @ 11753:eb7b04657dae stable

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.
author Matt Mackall <mpm@selenic.com>
date Thu, 05 Aug 2010 16:17:17 -0500
parents 12998fd17fbc
children 0299240b849b
comparison
equal deleted inserted replaced
11752:12998fd17fbc 11753:eb7b04657dae
241 else: 241 else:
242 del filenodes[f][n] 242 del filenodes[f][n]
243 243
244 # verify contents 244 # verify contents
245 try: 245 try:
246 t = fl.read(n) 246 l = len(fl.read(n))
247 rp = fl.renamed(n) 247 rp = fl.renamed(n)
248 if len(t) != fl.size(i): 248 if l != fl.size(i):
249 if len(fl.revision(n)) != fl.size(i): 249 if len(fl.revision(n)) != fl.size(i):
250 err(lr, _("unpacked size is %s, %s expected") % 250 err(lr, _("unpacked size is %s, %s expected") %
251 (len(t), fl.size(i)), f) 251 (l, fl.size(i)), f)
252 except Exception, inst: 252 except Exception, inst:
253 exc(lr, _("unpacking %s") % short(n), inst, f) 253 exc(lr, _("unpacking %s") % short(n), inst, f)
254 254
255 # check renames 255 # check renames
256 try: 256 try: