##// END OF EJS Templates
nodemap: all check that revision and nodes match in the nodemap...
marmoute -
r44800:d58206b7 default
parent child Browse files
Show More
@@ -356,6 +356,19 b' def check_data(ui, index, data):'
356 ret = 1
356 ret = 1
357 else:
357 else:
358 all_revs.remove(r)
358 all_revs.remove(r)
359 nm_rev = _find_node(root, nodemod.hex(index[r][7]))
360 if nm_rev is None:
361 msg = b" revision node does not match any entries: %d\n" % r
362 ui.write_err(msg)
363 ret = 1
364 elif nm_rev != r:
365 msg = (
366 b" revision node does not match the expected revision: "
367 b"%d != %d\n" % (r, nm_rev)
368 )
369 ui.write_err(msg)
370 ret = 1
371
359 if all_revs:
372 if all_revs:
360 for r in sorted(all_revs):
373 for r in sorted(all_revs):
361 msg = b" extra revision in nodemap: %d\n" % r
374 msg = b" extra revision in nodemap: %d\n" % r
@@ -371,3 +384,11 b' def _all_revisions(root):'
371 if v is None or isinstance(v, Block):
384 if v is None or isinstance(v, Block):
372 continue
385 continue
373 yield v
386 yield v
387
388
389 def _find_node(block, node):
390 """find the revision associated with a given node"""
391 entry = block.get(_to_int(node[0:1]))
392 if isinstance(entry, dict):
393 return _find_node(entry, node[1:])
394 return entry
General Comments 0
You need to be logged in to leave comments. Login now