I think that a minimal improvement would be a clearer error message,
indicating *what* failed and *why*. For instance, Mercurial should print the
name of the subrepo it was trying to update at the time.
The other troubling part of this is that the problem really isn't fixable
without resorting to the debug* commands, so it requires some wizardry to
expunge it.
One possibility would be to check the .hgsubstate and the subrepos for
consistency prior to a commit. If .hgsubstate refers to a nonexistent rev
in a subrepo, it could barf. I've also found that under some circumstances
(not yet solidly identified), .hgsubstate can end up with the null revision
in it, which such a check could also disallow. This check should be free in
the common case, since most people won't be using subrepos.
I could add these checks to a pretxncommit hook on a server, but that only
solves the symptom of the inconsistency problem for me. Without adding the
checks and improved reporting to core Mercurial, other people would still
lack the tools to prevent, understand, or fix the issue. |