Search code examples
version-controlmercurialmergetortoisehg

Reusing a branch that has been merged into default


When using Mercurial, assume you are using a 'default' branch. You work by creating new branches from this and merging them back into 'default' (when your work on that new branch is finished).

After merging a new branch (call it 'myBranch') back into 'default', you actually decide you need to work on 'myBranch'. 'myBranch' has not since been closed. What is the best to go about working on 'myBranch'?


Solution

    1. Merging of branch (in Mercurial) doesn't mean it will become closed|disappeared. Used ranch is permanent part of Mercurial changeset forever
    2. Merge will not close branch, just remove HEAD of merged branch
    3. Because Mercurial's history is DAG, you can always return (hg up CS-ID) to any entry (changeset) in it and start working from this point, adding new child changeset on commit
    4. For named branches, branchname is CS-ID of HEAD of latest (topologically) changeset of this branch

    Long-term branch merging

    For LTB "Cleanup" I used hg up Cleanup after each merge it to Default branch