Mercurial > public > mercurial-scm > hg
comparison mercurial/verify.py @ 41866:cfe08588d711
verify: make the `exc` method private
The method is for internal use only.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 06 Mar 2019 11:31:48 +0100 |
parents | 5df8475c5343 |
children | e8c4a9f5b986 |
comparison
equal
deleted
inserted
replaced
41865:5df8475c5343 | 41866:cfe08588d711 |
---|---|
67 if filename: | 67 if filename: |
68 msg = "%s@%s" % (filename, msg) | 68 msg = "%s@%s" % (filename, msg) |
69 self.ui.warn(" " + msg + "\n") | 69 self.ui.warn(" " + msg + "\n") |
70 self.errors += 1 | 70 self.errors += 1 |
71 | 71 |
72 def exc(self, linkrev, msg, inst, filename=None): | 72 def _exc(self, linkrev, msg, inst, filename=None): |
73 """record exception raised during the verify process""" | 73 """record exception raised during the verify process""" |
74 fmsg = pycompat.bytestr(inst) | 74 fmsg = pycompat.bytestr(inst) |
75 if not fmsg: | 75 if not fmsg: |
76 fmsg = pycompat.byterepr(inst) | 76 fmsg = pycompat.byterepr(inst) |
77 self._err(linkrev, "%s: %s" % (msg, fmsg), filename) | 77 self._err(linkrev, "%s: %s" % (msg, fmsg), filename) |
120 (short(p1), short(node)), f) | 120 (short(p1), short(node)), f) |
121 if p2 not in seen and p2 != nullid: | 121 if p2 not in seen and p2 != nullid: |
122 self._err(lr, _("unknown parent 2 %s of %s") % | 122 self._err(lr, _("unknown parent 2 %s of %s") % |
123 (short(p2), short(node)), f) | 123 (short(p2), short(node)), f) |
124 except Exception as inst: | 124 except Exception as inst: |
125 self.exc(lr, _("checking parents of %s") % short(node), inst, f) | 125 self._exc(lr, _("checking parents of %s") % short(node), inst, f) |
126 | 126 |
127 if node in seen: | 127 if node in seen: |
128 self._err(lr, _("duplicate revision %d (%d)") % (i, seen[node]), f) | 128 self._err(lr, _("duplicate revision %d (%d)") % (i, seen[node]), f) |
129 seen[node] = i | 129 seen[node] = i |
130 return lr | 130 return lr |
193 for f in changes[3]: | 193 for f in changes[3]: |
194 if match(f): | 194 if match(f): |
195 filelinkrevs.setdefault(_normpath(f), []).append(i) | 195 filelinkrevs.setdefault(_normpath(f), []).append(i) |
196 except Exception as inst: | 196 except Exception as inst: |
197 self.refersmf = True | 197 self.refersmf = True |
198 self.exc(i, _("unpacking changeset %s") % short(n), inst) | 198 self._exc(i, _("unpacking changeset %s") % short(n), inst) |
199 progress.complete() | 199 progress.complete() |
200 return mflinkrevs, filelinkrevs | 200 return mflinkrevs, filelinkrevs |
201 | 201 |
202 def _verifymanifest(self, mflinkrevs, dir="", storefiles=None, | 202 def _verifymanifest(self, mflinkrevs, dir="", storefiles=None, |
203 subdirprogress=None): | 203 subdirprogress=None): |
255 else: | 255 else: |
256 if not match(fullpath): | 256 if not match(fullpath): |
257 continue | 257 continue |
258 filenodes.setdefault(fullpath, {}).setdefault(fn, lr) | 258 filenodes.setdefault(fullpath, {}).setdefault(fn, lr) |
259 except Exception as inst: | 259 except Exception as inst: |
260 self.exc(lr, _("reading delta %s") % short(n), inst, label) | 260 self._exc(lr, _("reading delta %s") % short(n), inst, label) |
261 if not dir: | 261 if not dir: |
262 progress.complete() | 262 progress.complete() |
263 | 263 |
264 if self.havemf: | 264 if self.havemf: |
265 for c, m in sorted([(c, m) for m in mflinkrevs | 265 for c, m in sorted([(c, m) for m in mflinkrevs |
441 " revision is nullid %s:%s\n") | 441 " revision is nullid %s:%s\n") |
442 % (f, lr, rp[0], short(rp[1]))) | 442 % (f, lr, rp[0], short(rp[1]))) |
443 else: | 443 else: |
444 fl2.rev(rp[1]) | 444 fl2.rev(rp[1]) |
445 except Exception as inst: | 445 except Exception as inst: |
446 self.exc(lr, _("checking rename of %s") % short(n), inst, f) | 446 self._exc(lr, _("checking rename of %s") % short(n), |
447 inst, f) | |
447 | 448 |
448 # cross-check | 449 # cross-check |
449 if f in filenodes: | 450 if f in filenodes: |
450 fns = [(v, k) for k, v in filenodes[f].iteritems()] | 451 fns = [(v, k) for k, v in filenodes[f].iteritems()] |
451 for lr, node in sorted(fns): | 452 for lr, node in sorted(fns): |