So, it turns out we do already have *a* way of fixing broken repositories like this by replaying all data and recording the text revisions properly. This is fairly well hidden, and can be done by running "bzr reconcile --canonicalize-chks" in the affected repository(s).
Unfortunately this command is quite slow - on my machine it took 4 hours for the gcc repo just to get to rev 100, which is only a tiny fraction of the 115544 revisions in the repository overall.
So, it turns out we do already have *a* way of fixing broken repositories like this by replaying all data and recording the text revisions properly. This is fairly well hidden, and can be done by running "bzr reconcile --canonicalize- chks" in the affected repository(s).
Unfortunately this command is quite slow - on my machine it took 4 hours for the gcc repo just to get to rev 100, which is only a tiny fraction of the 115544 revisions in the repository overall.