views:

249

answers:

2

It is my understanding that although Mercurial has support from branches, the community generally clone repos instead of creating branches. Similar to the Darcs model, unlike the Git model.

I'm deploying a Ruby on Rails app with Capistrano and there I'd like to separate the production from the development branch. Should I point Capistrano to a different repo or should I use branches?

Has anyone used one model or the other of branching while dealing with Capistrano? Any problems with either?

A: 

My understanding is that Mercurial doesn't have branches - instead everything is effectively a branch, created when you clone.

I suppose you come from SVN background, in which case I suggest you read this: http://hginit.com/ and then clarify how merging work in details (Joel is a bit too vague on technical details) by reading this: http://mercurial.selenic.com/wiki/Merge.

Tomasz Zielinski
No, I don't come from a SVN background, I come from Git, Darcs (and SVN and CVS in ancient times). Which has branches and I know that everything is a branch. Now Mercurial has branched, unnamed branches while the code naturally diverge and named ones when you want to separate them; but the community generally separates development by clonning, not by branching. I suggest you read http://mercurial.selenic.com/wiki/Branch
J. Pablo Fernández
I read it some time ago but it looked useless comparing to simple cloning so I forgot it. Such branch is effectively only an additional tag, whereas `hg clone` gives you physically separate repository. Writing this, I support my claim that Mercurial doesn't have branches because everything is a branch - either cloned or tagged.
Tomasz Zielinski
Then git doesn't support branches either.
J. Pablo Fernández
I don't know git and I'm writing as SVN convert. In SVN branch is something that casual user uses not that often, at least from my experience. In Mercurial, everything is a branch so effectively there are no branches, just a consistent workflow. There are no problems like: "hmm, I have that branch, how to merge it into the trunk.." because merge is.. almost no-brainer. Using metaphore - if you see two trees, then you see two trees, but if you see 10000 trees then you see a forest, not 10000 trees.
Tomasz Zielinski
+4  A: 

yes mercurial supports several branching models cloning is probably the most common.

this certainly sounds like the ideal use of a named branch to me, but its ultimately a personal preference thing

jk
I hesitate to just go and do it that way because I've found branches in Mercurial not that powerful, like in Git, and the community generally pointed to using clones instead of branches for branching code.
J. Pablo Fernández
What do you mean by "not that powerful"? I've used named branches a number of times for exactly this type of problem and it's worked great. What do you feel is missing from the branching?
Ted Naleid