Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial Tagging/Branching Strategy

Tags:

My current project is broken down into 3 parts: Website, Desktop Client, and a Plug-in for a third party program. We had started out originally with Subversion for our source control but decided to try Mercurial after reading Joel Spolsky's final post. Considering we haven't really used the majority of svn's potential before, we figured starting fresh with some basic ideas of how source control worked would make this transition easy.

However, after setting up our initial repository, we're lost as to how tagging and branching should work on a project like this.

Essentially, we're working on all 3 of these parts at the same time. We want a release to be a combination of the 3 parts. Currently we're working in one repository.

For the Plug-in part, we have the first iteration finished which we've been referring to as Plug-In v0.1. For the first official build of the other two parts, we'd also like to refer to them as Website v0.1 and Desktop Client v0.1. When all three parts are at v0.1, we'd like to have a Full Project v0.1.

Our problem is we're not sure how to manage all of this in the Hg repository. Would the best way to handle this be to create 3 separate repositories for the 3 stable versions and then 3 more repositories for the current developments? Currently we have this all in one repository. Should we do this in branches (are branches any different from cloning repositories?) and tags?

Any help is greatly appreciated.

like image 877
Tony Trozzo Avatar asked Mar 24 '10 17:03

Tony Trozzo


People also ask

What is mercurial tag?

A tag is a symbolic identifier for a changeset. It can contain any characters except ":" (colon), "\r" (Carriage Return) or "\n" (Line Feed). Mercurial has two kinds of tags: local and regular.

What is mercurial branch?

Branches occur if lines of development diverge. The term "branch" may thus refer to a "diverged line of development". For Mercurial, a "line of development" is a linear sequence of consecutive changesets. Combining a line of development into an existing one is called merging. Creating a branch.

What is mercurial default branch?

Mercurial's main branch is called "default" and is analogous to "trunk" in SVN, "HEAD" in CVS, and "master" in Git. If you try to use some other name for your "main" branch, users will get a more or less random branch when they clone and commit things in the wrong place, which is generally undesirable.

What is hg graft?

hg graft allows "cherry-picking," as you noted in your question. For example, you can run hg graft -D "2085::2093 and not 2091" to copy only some changes from another revision. By comparison, hg rebase (with or without --keep ) will grab whatever changeset you specify and all of its decendant changes.


1 Answers

I'd highly recommend Steve Losh's blog entry A Guide to Branching in Mercurial, where he describes several approaches to branching supported by Mercurial.

Using Mercurial's named branches feature is probably the closest match to branching with SVN.

like image 167
Stephen C. Steel Avatar answered Sep 28 '22 04:09

Stephen C. Steel