I made some changes (A) to the main (and only) branch. Then my colleague made some other changes (B). Then I found out that changes (A) are hopelessly broken, and I decided to abandon them completely. Changes (B), on the other hand, are perfectly fine, and luckily are completely independent from chanegs (A). Changes (B) are far smaller in volume than changes (A).
Normally, I'd simply hg commit --close-branch
as described here. But then I lose changes (B), and will need to recreate them in the new active branch. I can do that, by simply identifying the files affected (by hand), and updating them (by hand), and then committing. This is obviously not perfect, since it requires two manual steps, and also creates a misleading commit in the repository (misleading because the changes are made by my colleague a while ago, but would look as if they were made today by me). I suppose it's not the end of the world, but is there a more elegant solution?
Note: If Mercurial supported applying just the differences from one commit to another location in the revision tree, it would have worked. But I suspect this feature doesn't exist, for a good reason: it's very rare that the diffs vs existing parent changeset are useful when applied verbatim to another parent changeset.