##// END OF EJS Templates
Make hg verify do more thorough cross-checking.
mpm@selenic.com -
r17:ffe6a5ca default
parent child Browse files
Show More
@@ -220,19 +220,37 b' elif cmd == "verify":'
220 nodes = {"\0"*20: 1}
220 nodes = {"\0"*20: 1}
221 for i in range(fl.count()):
221 for i in range(fl.count()):
222 n = fl.node(i)
222 n = fl.node(i)
223
223 if n not in filenodes[f]:
224 if n not in filenodes[f]:
224 print "%s:%s not in manifests" % (f, hg.hex(n))
225 print "%s:%s not in manifests" % (f, hg.hex(n))
225 if fl.linkrev(n) not in filelinkrevs[f]:
226 else:
227 del filenodes[f][n]
228
229 flr = fl.linkrev(n)
230 if flr not in filelinkrevs[f]:
226 print "%s:%s points to unexpected changeset rev %d" \
231 print "%s:%s points to unexpected changeset rev %d" \
227 % (f, hg.hex(n), fl.linkrev(n))
232 % (f, hg.hex(n), fl.linkrev(n))
233 else:
234 filelinkrevs[f].remove(flr)
235
236 # verify contents
228 t = fl.read(n)
237 t = fl.read(n)
238
239 # verify parents
229 (p1, p2) = fl.parents(n)
240 (p1, p2) = fl.parents(n)
230 if p1 not in nodes:
241 if p1 not in nodes:
231 print "%s:%s unknown parent 1 %s" % (f, hg.hex(n), hg.hex(p1))
242 print "%s:%s unknown parent 1 %s" % (f, hg.hex(n), hg.hex(p1))
232 if p2 not in nodes:
243 if p2 not in nodes:
233 print "file %s:%s unknown parent %s" % (f, hg.hex(n), hg.hex(p1))
244 print "file %s:%s unknown parent %s" % (f, hg.hex(n), hg.hex(p1))
245 nodes[n] = 1
234
246
235 nodes[n] = 1
247 # cross-check
248 for flr in filelinkrevs[f]:
249 print "changeset rev %d not in %s" % (flr, f)
250
251 for node in filenodes[f]:
252 print "node %s in manifests not in %s" % (hg.hex(n), f)
253
236
254
237 print "%d files, %d changesets, %d total revisions" % (files, changesets,
255 print "%d files, %d changesets, %d total revisions" % (files, changesets,
238 revisions)
256 revisions)
General Comments 0
You need to be logged in to leave comments. Login now