Mercurial > hg
comparison mercurial/verify.py @ 41871:9e737ca539f6
verify: make `checkentry` a private method
This method is for internal use only.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 06 Mar 2019 12:20:50 +0100 |
parents | 00c9fde75c1a |
children | 08d977451f26 |
comparison
equal
deleted
inserted
replaced
41870:00c9fde75c1a | 41871:9e737ca539f6 |
---|---|
91 if not self.revlogv1: | 91 if not self.revlogv1: |
92 self._warn(_("warning: `%s' uses revlog format 1") % name) | 92 self._warn(_("warning: `%s' uses revlog format 1") % name) |
93 elif self.revlogv1: | 93 elif self.revlogv1: |
94 self._warn(_("warning: `%s' uses revlog format 0") % name) | 94 self._warn(_("warning: `%s' uses revlog format 0") % name) |
95 | 95 |
96 def checkentry(self, obj, i, node, seen, linkrevs, f): | 96 def _checkentry(self, obj, i, node, seen, linkrevs, f): |
97 """verify a single revlog entry | 97 """verify a single revlog entry |
98 | 98 |
99 arguments are: | 99 arguments are: |
100 - obj: the source revlog | 100 - obj: the source revlog |
101 - i: the revision number | 101 - i: the revision number |
204 progress = ui.makeprogress(_('checking'), unit=_('changesets'), | 204 progress = ui.makeprogress(_('checking'), unit=_('changesets'), |
205 total=len(repo)) | 205 total=len(repo)) |
206 for i in repo: | 206 for i in repo: |
207 progress.update(i) | 207 progress.update(i) |
208 n = cl.node(i) | 208 n = cl.node(i) |
209 self.checkentry(cl, i, n, seen, [i], "changelog") | 209 self._checkentry(cl, i, n, seen, [i], "changelog") |
210 | 210 |
211 try: | 211 try: |
212 changes = cl.read(n) | 212 changes = cl.read(n) |
213 if changes[0] != nullid: | 213 if changes[0] != nullid: |
214 mflinkrevs.setdefault(changes[0], []).append(i) | 214 mflinkrevs.setdefault(changes[0], []).append(i) |
251 total=len(mf)) | 251 total=len(mf)) |
252 for i in mf: | 252 for i in mf: |
253 if not dir: | 253 if not dir: |
254 progress.update(i) | 254 progress.update(i) |
255 n = mf.node(i) | 255 n = mf.node(i) |
256 lr = self.checkentry(mf, i, n, seen, mflinkrevs.get(n, []), label) | 256 lr = self._checkentry(mf, i, n, seen, mflinkrevs.get(n, []), label) |
257 if n in mflinkrevs: | 257 if n in mflinkrevs: |
258 del mflinkrevs[n] | 258 del mflinkrevs[n] |
259 elif dir: | 259 elif dir: |
260 self._err(lr, _("%s not in parent-directory manifest") % | 260 self._err(lr, _("%s not in parent-directory manifest") % |
261 short(n), label) | 261 short(n), label) |
428 | 428 |
429 seen = {} | 429 seen = {} |
430 for i in fl: | 430 for i in fl: |
431 revisions += 1 | 431 revisions += 1 |
432 n = fl.node(i) | 432 n = fl.node(i) |
433 lr = self.checkentry(fl, i, n, seen, linkrevs, f) | 433 lr = self._checkentry(fl, i, n, seen, linkrevs, f) |
434 if f in filenodes: | 434 if f in filenodes: |
435 if havemf and n not in filenodes[f]: | 435 if havemf and n not in filenodes[f]: |
436 self._err(lr, _("%s not in manifests") % (short(n)), f) | 436 self._err(lr, _("%s not in manifests") % (short(n)), f) |
437 else: | 437 else: |
438 del filenodes[f][n] | 438 del filenodes[f][n] |