This is the short version of my recent article “Mercurial: Commit Timeout Issues and Dirty Heads”.
To close a branch/head you first need to locally update you the head you want. Then tell Mercurial that you want to close that branch, and finally update to the latest one or the branch you want. This will prevent the closed branch to show by default when you list the heads, and when merging, Mercurial will now that it should not try to merge the closed branch.
hg update –r 145
hg commit –close-branch –m “reason to close dirty branch”
hg update –C default
Notice that ‘145’ is the revision number you want, representing the head or branch you want to close.
Hope it helps.