Branching vs Cloning

Matt Joiner anacrolix at gmail.com
Fri Jan 8 00:13:39 CST 2010


On Fri, Jan 8, 2010 at 4:34 PM, Michael Fromin <mfromin at yahoo.com> wrote:

> Excuse the "newbie" nature of this question but I am struggling to see when
> one should Branch and when one should Clone.
>
> I am a sole developer working on a project.  I use Mercurial for my repo so
> I have a nice history of the work I do.  For linear work, the process of
> making changes and then committing the changes is easy and straight forward.
>
>
> Where I am struggling is how to properly do two things:
>
> 1 - At a certain point in time the code is "ready for deployment".  At that
> point I would like a nice way to mark that changeset so (if needed) I can
> easily roll back to that if needed.
>

> 2 - Once I have the code in production I will likely need to move forward
> with work on "the next version" but I may also have to make small updates to
> the current production code if issues are found.
>
> For item #1...
>
> I believe that I would use the TAG capability of the system to mark
> specific changesets.  As I already have 11 changesets in the repository I
> cannot seem to find a way to tag any existing changesets.  Am I missing
> something or is this not doable in Mercurial?  Is there another way to do
> this?  For example, should I branch off the main path for each "version"
> that I want to identify?
>
> Tagging is the correct paradigm for this. I believe tags are collected from
the tips of all the branches, and are revision controlled themselves, so you
need to keep this in mind.

>
> For item #2...
>
> If I have multiple "work streams" that I need to do in parallel do I make
> multiple branches or multiple clones?  It appears that (in theory) I could
> do either as both seem to provide me a way to isolate a set of code changes
> that I can later merge back into a single parent changeset.  Is there a
> particular "best practice" for how this should be done?  Are branches better
> for this?  Are clones better for this?
>

Multiple branches if they're more permanent. E.g. a stable and development
branch. Cloning would be desirable for working on different branches at thh
same time.

>
> If I do branch then would I perform "fixes/patches" to the branch and then
> merge them in later?  If I don't make a branch do I just clone the repo to
> the appropriate changeset, make the change, and then merge back in
> somewhere?  If so where?
>
>
> No need to clone, you could update to the branch, and apply the patches and
commit there, then switch back to your default branch when you're done.

>
> I appreciate any input this list can provide.  I am new to version control
> and Mercurial and want to make sure I have my processes in order before I
> get too far into this development process.
>
> --Michael
>
>
>
>
> _______________________________________________
> Mercurial mailing list
> Mercurial at selenic.com
> http://selenic.com/mailman/listinfo/mercurial
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial/attachments/20100108/d2babe24/attachment.htm>


More information about the Mercurial mailing list