comparison mercurial/verify.py @ 27964:ac5057d5fc37 stable

verify: recover lost freeing of memory In df8973e1fb45 (verify: move file cross checking to its own function, 2016-01-05), "mflinkrevs = None" was moved into function, so the reference was cleared there, but the calling function now held on to the variable. The point of clearing it was presumably to free up memory, so let's move the clearing to the calling function where it makes a difference. Also change "mflinkrevs = None" to "del mflinkrevs", since the comment about scope now surely is obsolete.
author Martin von Zweigbergk <martinvonz@google.com>
date Sun, 31 Jan 2016 00:31:55 -0800
parents 900d36a3e4dd
children fb92927f9775
comparison
equal deleted inserted replaced
27963:07a5de79ec30 27964:ac5057d5fc37
147 mflinkrevs, filelinkrevs = self._verifychangelog() 147 mflinkrevs, filelinkrevs = self._verifychangelog()
148 148
149 filenodes = self._verifymanifest(mflinkrevs) 149 filenodes = self._verifymanifest(mflinkrevs)
150 150
151 self._crosscheckfiles(mflinkrevs, filelinkrevs, filenodes) 151 self._crosscheckfiles(mflinkrevs, filelinkrevs, filenodes)
152 del mflinkrevs
152 153
153 totalfiles, filerevisions = self._verifyfiles(filenodes, filelinkrevs) 154 totalfiles, filerevisions = self._verifyfiles(filenodes, filelinkrevs)
154 155
155 ui.status(_("%d files, %d changesets, %d total revisions\n") % 156 ui.status(_("%d files, %d changesets, %d total revisions\n") %
156 (totalfiles, len(repo.changelog), filerevisions)) 157 (totalfiles, len(repo.changelog), filerevisions))
247 if m == nullid: 248 if m == nullid:
248 continue 249 continue
249 ui.progress(_('crosschecking'), count, total=total) 250 ui.progress(_('crosschecking'), count, total=total)
250 self.err(c, _("changeset refers to unknown manifest %s") % 251 self.err(c, _("changeset refers to unknown manifest %s") %
251 short(m)) 252 short(m))
252 mflinkrevs = None # del is bad here due to scope issues
253 253
254 for f in sorted(filelinkrevs): 254 for f in sorted(filelinkrevs):
255 count += 1 255 count += 1
256 ui.progress(_('crosschecking'), count, total=total) 256 ui.progress(_('crosschecking'), count, total=total)
257 if f not in filenodes: 257 if f not in filenodes: