Well, at least this particular problem can’t happen to hg because it uses a completely different format for transfer (bundles) and for storage (revlogs), and unconditionally checks hashes before adding revisions to a revlog.