equal
deleted
inserted
replaced
25 errors = [0] |
25 errors = [0] |
26 warnings = [0] |
26 warnings = [0] |
27 ui = repo.ui |
27 ui = repo.ui |
28 cl = repo.changelog |
28 cl = repo.changelog |
29 mf = repo.manifest |
29 mf = repo.manifest |
|
30 lrugetctx = util.lrucachefunc(repo.changectx) |
30 |
31 |
31 if not repo.cancopy(): |
32 if not repo.cancopy(): |
32 raise util.Abort(_("cannot verify bundle or remote repos")) |
33 raise util.Abort(_("cannot verify bundle or remote repos")) |
33 |
34 |
34 def err(linkrev, msg, filename=None): |
35 def err(linkrev, msg, filename=None): |
76 msg = _("rev %d points to nonexistent changeset %d") |
77 msg = _("rev %d points to nonexistent changeset %d") |
77 else: |
78 else: |
78 msg = _("rev %d points to unexpected changeset %d") |
79 msg = _("rev %d points to unexpected changeset %d") |
79 err(None, msg % (i, lr), f) |
80 err(None, msg % (i, lr), f) |
80 if linkrevs: |
81 if linkrevs: |
|
82 if f and len(linkrevs) > 1: |
|
83 try: |
|
84 # attempt to filter down to real linkrevs |
|
85 linkrevs = [l for l in linkrevs |
|
86 if lrugetctx(l)[f].filenode() == node] |
|
87 except: |
|
88 pass |
81 warn(_(" (expected %s)") % " ".join(map(str, linkrevs))) |
89 warn(_(" (expected %s)") % " ".join(map(str, linkrevs))) |
82 lr = None # can't be trusted |
90 lr = None # can't be trusted |
83 |
91 |
84 try: |
92 try: |
85 p1, p2 = obj.parents(node) |
93 p1, p2 = obj.parents(node) |
134 try: |
142 try: |
135 for f, fn in mf.readdelta(n).iteritems(): |
143 for f, fn in mf.readdelta(n).iteritems(): |
136 if not f: |
144 if not f: |
137 err(lr, _("file without name in manifest")) |
145 err(lr, _("file without name in manifest")) |
138 elif f != "/dev/null": |
146 elif f != "/dev/null": |
139 fns = filenodes.setdefault(f, {}) |
147 filenodes.setdefault(f, {}).setdefault(fn, lr) |
140 if fn not in fns: |
|
141 fns[fn] = i |
|
142 except Exception, inst: |
148 except Exception, inst: |
143 exc(lr, _("reading manifest delta %s") % short(n), inst) |
149 exc(lr, _("reading manifest delta %s") % short(n), inst) |
144 |
150 |
145 ui.status(_("crosschecking files in changesets and manifests\n")) |
151 ui.status(_("crosschecking files in changesets and manifests\n")) |
146 |
152 |
171 if not f: |
177 if not f: |
172 err(None, _("cannot decode filename '%s'") % f2) |
178 err(None, _("cannot decode filename '%s'") % f2) |
173 elif size > 0: |
179 elif size > 0: |
174 storefiles.add(f) |
180 storefiles.add(f) |
175 |
181 |
176 lrugetctx = util.lrucachefunc(repo.changectx) |
|
177 files = sorted(set(filenodes) | set(filelinkrevs)) |
182 files = sorted(set(filenodes) | set(filelinkrevs)) |
178 for f in files: |
183 for f in files: |
179 try: |
184 try: |
180 linkrevs = filelinkrevs[f] |
185 linkrevs = filelinkrevs[f] |
181 except KeyError: |
186 except KeyError: |
248 except Exception, inst: |
253 except Exception, inst: |
249 exc(lr, _("checking rename of %s") % short(n), inst, f) |
254 exc(lr, _("checking rename of %s") % short(n), inst, f) |
250 |
255 |
251 # cross-check |
256 # cross-check |
252 if f in filenodes: |
257 if f in filenodes: |
253 fns = [(mf.linkrev(l), n) for n,l in filenodes[f].iteritems()] |
258 fns = [(lr, n) for n,lr in filenodes[f].iteritems()] |
254 for lr, node in sorted(fns): |
259 for lr, node in sorted(fns): |
255 err(lr, _("%s in manifests not found") % short(node), f) |
260 err(lr, _("%s in manifests not found") % short(node), f) |
256 |
261 |
257 for f in storefiles: |
262 for f in storefiles: |
258 warn(_("warning: orphan revlog '%s'") % f) |
263 warn(_("warning: orphan revlog '%s'") % f) |