When working with multiple tasks / bugs, I prefer to use bookmarks on named branches. They do not clutter your story with branching information (but this may be a personal preference).
Usually you only work with the default branch. To track this “main line of development", we create a bookmark called "master" (or, as you would like to call it). Now, before you start working with the error X, you create a bookmark "bugX".
- hg bookmark master
- ... work with the default branch, as always ...
- hg bookmark bugX
- hg commit -m "bugX 1"
- hg commit -m "bugX 2"
Then you should work with error Y, because you need, for example, wait for someone else to enter. To do this, first go back to the main bookmark (where you left the "main line"), create a new bookmark for error Y and start working on it.
- hg update wizard
- hg bookmark bugY
- hg commit -m "bugY 1"
You also need to stop working with error Y, and you want to continue your work on the "main line". First, you pull the latest changes from the central repo, and then start working on the main branch. When the function is finished, you can click it. Remember to just push the master branch using "hg push -r master":
- hg update wizard
- hg pull --rebase
- hg commit -m "new feature 1"
- hg commit -m "new feature 2"
- hg push -r master
Someday laster you can end the error X:
- hb update bugX
- hg commit -m "bugX bug fixed
This fix should now be transferred to the main branch and transferred to the central repo. You can combine it with "hg merge bugX" or even better - reinstall it. When done, remove the bugX bookmark:
- hg update bugX
- hg rebase -b bugX -d master
- hg bookmark -f master
- hg bookmark -d bugX
- hg push -r master
"hg bookmark -f master" requires that the main bookmark now points to the last bugX change set that was recreated on top of the main branch (I think this is done automatically using Mercury 2.1).
The same procedure can now be performed with bugY, and you will get a direct history.
As a team, you might even think about moving the main bookmark to the central repository so that it is not supported after pulling (hg push -B master).
This workflow is also described more or less in this blog post .