[help] Development strategy(SVN to Mercurial)
Greg Ward
greg-hg at gerg.ca
Wed Feb 2 03:01:09 UTC 2011
On Mon, Jan 31, 2011 at 9:41 AM, 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).
>
> Sorry if I have made a mistake about the SVN, I hope you've knew it already.
> Now in Mercurial, the strategy have to be different! 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.
Step carefully and make sure you really understand Mercurial's model.
The good news: Subversion's model is truly bizarre. It thinks that
branches are just like directories, which makes no sense to me (and
never has). And it doesn't support tags at all; what Subversion calls
tags are just more directories. Fundamentally, Subversion confuses
three very different concepts: directories, branches, and tags.
Mercurial gets things pretty much right: for starters, your source
tree contains files which are organized into directories. Mercurial's
repository has no concept of directories, but it's smart enough to
create them and remove them as needed. It cannot track empty
directories, but that's a pretty minor limitation that doesn't cause
much problem in the real world. Speaking of "branches" can be
confusing, because you have to distinguish anonymous branches from
named branches. Anonymous branches are what you get when you have
multiple repositories, or when you just update back a few changesets
and commit a new head. Named branches are what you get when you run
"hg branch". And Mercurial has tags, which is a nice new feature if
you're used to Subversion. The implementation can be confusing at
first, but don't worry about it. It works just fine.
Anyways... don't waste brainpower trying to make Mercurial act like
Subversion. It won't work, you'll just get confused, and the result
will be a mess. Instead, take some time to learn how Mercurial works,
and *then* try converting your svn repositories.
Greg
More information about the Mercurial
mailing list