Questions about branching in Mercurial
Tim Allen
tim at commsecure.com.au
Sun May 6 23:48:07 UTC 2007
On Sun, May 06, 2007 at 12:15:30AM -0500, Mark A. Flacy wrote:
> On 2007.05.05 21:03, Tim Allen wrote:
> > On Sat, May 05, 2007 at 02:25:43PM -0500, Mark A. Flacy wrote:
> >>
> >>
> >> Why do you think that named branches are a better solution than
> >> a cloned repository?
> >
> > I'll admit I don't have an iron-clad religious conviction about it, but
> > a number of smaller reasons add up to this overall preference:
> >
> > - That's how CVS does it, so it's less of a mental leap to use a new
> > VCS that operates on the same model.
>
> There are some other mental leaps that you'll have to do.
True, but overall I would prefer fewer mental leaps than more.
> > - I'm greatly attached to the idea of cloning a repository and
> > having every bit of the project's history right at my fingertips,
> > directly examinable via my VCS tool.
>
> Yeah, everybody seems to thinks that's a great idea for some reason.
> On a large project, I think that's an insane position to take but
> I appear to be in the minority around here.
If having the entire project history at my fingertips were to involve
significant cost in disk-space, CPU usage or network traffic, then yes
- it would be insane to insist on such a thing. However, our project is
not that large (as big as Linux, but not as big as Mozilla, KDE or
X.org) and I'd prefer to have the option of having everything in one
repository rather than having the decision made for me on technical grounds.
> > - If the VCS tool handles branches, our internal documentation for
> > branching will probably look something like 'branch && push',
> > which is very hard to get wrong.
>
> So which type of branches do you mean? A local branch for the
> developer to make and test changes prior to submission? Or a branch
> that describes a version of the product?
>
> If it's the latter, why do you want to give individual developers the
> ability to make them?
It is indeed the latter; although we are a for-profit company we don't
currently have enough developers that we can spare one or two to manage
the tree (yes we have a large repository, but that comes from having
lots of little projects inside it, not one big project).
> > - If the VCS tool does not handle branches, our internal
> > documentation will involve sshing to the server, finding the
> > correct repository, cloning it to the correct name in the correct
> > location, and recording the existence of the branch in some
> > documentation somewhere. Everything done manually is a thing that
> > can be done wrong.
>
> Well, only if you don't set a policy of some type. Or set up the
> directory structure beforehand. Or write a script to do it all for
> you.
Policies do not prevent human error. Having a script would certainly
help, I may well take that approach.
> You should look at the hgwebdir.cgi script that's part of the
> distribution. It makes it very simple to document, browse and even
> retrieve a rooted tree of repositories. You can clone from the links
> too.
>
> Ah, here's a couple of examples:
>
> http://hg.omnifarious.org/~hopper/
>
> http://hg.kublai.com/
That does look very useful - far nicer than ViewCVS. Thank you for the
links.
I suspect that the question of whether branches should be inside or
outside the main repository is a contentious one on the Mercurial
mailing list; having explained myself I shan't trouble you further, but
again thank you for the discussion.
Tim Allen
More information about the Mercurial
mailing list