[help] Development strategy(SVN to Mercurial)

Giorgos Keramidas keramida at ceid.upatras.gr
Mon Jan 31 21:59:49 CST 2011


On Mon, 31 Jan 2011 06:41:26 -0800 (PST), Tal <tal_hd at hotmail.com> wrote:
> I have been using SVN, so back then the way was simpler.
>
> Like most of the SVN owner, I have had 3 directories:
>
> ./branch/ : Means it's should work better than older version(usually
> less stable than beta).
>
> ./trunk/ : The head of the development, means that it's not ready to
> general use, but it is a way for all the developers will have the
> latest source code. The common code is under ./trunk/src/ and the
> separated feature work is under ./trunk/name(see tag now).
>
> ./tag/name/ : Like branches, but contain only a unique feature that
> haven't merge to the development(i.e. branch).

Yep.  That seems like a typical 'svn branching' scheme.

Subversion has no concept of 'tags', so what people do when they use the
'tags/' toplevel directory is to use 'svn copy' to create copies of some
revision that is "known to match criteria X and Y".  Subversion itself
will not prevent you from copying something from 'trunk/' to 'tags/foo/'
and then *committing* on top of 'tags/foo/'.  But it's usually a bad
idea to commit on top of a tag-like copy, if only because it confuses
people who think that the tag name refers only to the original revision
that was copied.

> Now in Mercurial, the strategy have to be different!

Only very thinly different.  Named branches can work in Mercurial like
the svn branching model you just described.

> So I use this way: instead of directories, I use branches (not
> "./branch/" directory):
>
> default: Same as ./branch/ in SVN, for the global code&feature.
>
> trunk: Same as ./trunk/src/ in SVN.

This is a bit strange, but not 'bad'.  The usual practice in Mercurial
is to use the 'default' branch like the 'trunk/' of Subversion repos.
Then when you want to create a branch that in Subversion would be called
'branches/foo/' you create a named branch called 'foo' in hg.

> You can see how I have done it so far:
>
> http://maxdream.hg.sourceforge.net/hgweb/maxdream/maxdream/
> http://maxdream.hg.sourceforge.net/hgweb/maxdreamdefault/maxdream/

> I also consider using this:
>
> default/name : Same as ./tags/name/ in SVN.(Can I use "/" in branch
> name? If not, "-" will be good also)
>
> trunk/name : Same as ./trunk/name/ in SVN.
>
> Can I use it for my project? I haven't found a good answer in web-search.
> Again, please see the link to the repo. I gave above.

Yes, you can use it.  Mercurial itself only assigns a slightly special
meaning to the branch called 'default'.  It doesn't really care if you
create other branches called 'default/foo', 'default/bar' or even longer
names like 'default/release/3.2.1'.



More information about the Mercurial mailing list