Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial - Branching with Clone or Branching with Named Branch

Tags:

mercurial

Currently, I am using CVS to keep track of my SourceForge project. I has the following requirements.

  • I need to maintain a stable Trunk. Whenever there is a critical bug being reported by users, I may fix immediately, and release it within a few days.
  • I need to perform extensive new features enhancement, huge code refactoring on and off. This may take several weeks to several months. Hence, what I usually do, is I will perform the new features enhancement and huge code refactoring within a branch (Or more branches if there are more features). Only after enough testing, I will merge them back to stable Trunk.

I am behind a poor internet connection most of the time. Recently, I am planning to migrate to a distributed source control - Mercurial , so that I can work offline sometimes.

I read the following article. I believe I can use the following ways to preserve my previous workflow under CVS's branching.

  • Clone
  • Named Branch

However, I cannot see any difference from end user point of view. May I know which mythology you guys usually apply? and why?

like image 350
Cheok Yan Cheng Avatar asked Nov 25 '10 06:11

Cheok Yan Cheng


1 Answers

You will notice that with named branches, you create the branch first before you contribute.

With clones, you just start contributing to cloned repository before you even think if it deserves to be included / merged to main repository.

To sum it up:

  1. Use clones for experimental work. Some thing new, you want to try and are not even sure, if that will work or will be just history that you do not want to remember.
  2. Use named branches for creating various versions / branches that will live (Like release, stable etc). Named branches are good way to keep the context of a branchy project.

See the following discussion on SO and it provides good information on clones , named branches and when to use which.

  • best practices in mercurial: branch vs. clone, and partial merges?
like image 50
pyfunc Avatar answered Jan 26 '23 01:01

pyfunc