Wednesday, January 26, 2011

How Do You Remove Mucus From Babys Throat

Working with branchs in mercurial


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:



The way to work in the branch as if we were in default, with the difference that made the commit and push without affecting the main branch (default). So how we can merge those changes?. We merge from the branch to the new_branch $ hg merge new_branch
default.



down one branch switch between them

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

Similarly, we can switch from one branch to another by these two steps.
Then the normal work:



$ hg ci-m "..."
$ 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").
A guide to Branching in Mercurial
http://mercurial.selenic.com/wiki/NamedBranches

0 comments:

Post a Comment