THG shouldn't allow commit parent repository when it refers to a nested one which is in a draft state
Created originally on Bitbucket by zerkms (Ivan Kurnosov)
... because it may cause to inconsistent repository state which is hardly resolvable (after push).
Simple scenario:
Let's suppose you have a local clone of a repository A that has nested repository B. Then you:
- Modify something in B and commit it. Now B has tip = , which is "draft"
- Now commit A. Mercurial saves "bhash = B" in its .hgsubstate
- Now try to push B and realize someone else has pushed something. Then you pull
- And as usually you (and I) perform
hg rebase
after that. You do that automatically (as I do) since you don't like unnecessary merges - Now the "bhash" changeset is missed from B repository, but "newbhash" is created as a replacement
- Now you push B and push A
After that no one could update to the tip of the A since it refers to a non existent revision of a nested repository B.
And my proposal is to not allow to commit to A until it refers to a draft revision. It would protect from most issues.
What do you think? Or is it more about hg behaviour, not thg?