One way to work in parallel, several developers are using branchs. In mercurial, other than each have their own clone, it is also possible to have one or more independent branches. The working is as follows:
branch is created:
$ hg branch new_branch
new_branch Where is the name you want to give. To find out which branch we are working, we use the same command without arguments:
$ hg branch
New_branch
Now, the line of work is as shown in the figure below:
| default. |
If we want to make us a clone
when branches are created, by default we'll leave the default branch. To switch to another branch do the following:
| -f $ hg branch new_branch |
This puts us on the branch you want. Now we need to update to bring us the latest changes:
$ hg update
Then the normal work:
| $ hg pull $ hg push |
If we want to bring changes to any branch, we merge with the branch you want:
| $ hg branch new_branch default $ hg merge |
When we want to close down the branch, run the commit of the following:
| hg commit $ - close-branch -m 'Branch closed new_branch' |
References A very good tutorial on different ways to work with branchs in mercurial, (one branch is to "physical").
| http://mercurial.selenic.com/wiki/NamedBranches |
0 comments:
Post a Comment