multiple branches in one respository?

Bryan O'Sullivan bos at serpentine.com
Mon Aug 29 20:02:36 CDT 2005


On Tue, 2005-08-30 at 00:49 +0100, Sanjoy Mahajan wrote:
> Does mercurial encourage (or discourage) working with multiple
> branches in one directory, for example as Linus describes in the email
> below from the git list?

Mercurial is neutral on this.  You can certainly do it, switching back
and forth between branches in a single repository until you're blue in
the face.

> Or, for multiple branches, is the recommended mercurial practice to
> keep only one branch in each directory?

I believe that this is a generally good idea.  In practice, keeping
branches in sync - particularly if you're working on a project like the
kernel, with a high rate of change and long-lived changes that don't go
into the main repository - is an annoying, fiddly job.  When it's
difficult to see how those branches differ - as is the case with
multiple branches in a single repo - you're making the task
unnecessarily more difficult for yourself.

You might want to look at Chris Mason's mq patches.  They nicely
encapsulate a way of working "in parallel to" a mainline that you're not
directly contributing to, without the baggage of constant merges
cluttering your history.

	<b



More information about the Mercurial mailing list