monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Questions about Monotone


From: Derek Scherger
Subject: Re: [Monotone-devel] Questions about Monotone
Date: Wed, 8 Oct 2008 13:42:39 -0600

On Wed, Oct 8, 2008 at 1:16 PM, Daniel Carrera <address@hidden> wrote:
Tero Koskinen wrote:
>From the documentation I get the impression that the original branch and the new branch for Feature A both reside in the *same* directory.

Branches are put in the same *database*.

And you can have two different directories with different branches, right? I think I figured out the right work-flow. Tell me if I got it right:


# Make one DB. This DB is shared by all branches.
mtn db init --db=~/foo.mtn


# Make two directories: main branch and testing.
mtn --db=foo.mtn --branch=com.foo.main setup main
mtn --db=foo.mtn --branch=com.foo.test setup test

This will create two independent branches with no shared history which cannot be merged. Instead, just make the main branch and once you've committed a few things to it, and need to make an actual branch for feature development, check out the main branch to a new directory and specify the --branch option to the first commit for the feature.

i.e.
$ cd main
$ mtn co ../test
$ cd ../test
... make some changes ...
$ mtn commit --branch com.foo.test -m 'start work on feature X'

This will set the branch for the test directory to com.foo.test on the first commit there, after which you won't need to specify --branch again.

Creating a branch like this is a bit awkward and it's relatively easy to forget the --branch option on the first commit. Another way to deal with this is to edit _MTN/options in the new (test) directory and set the branch name there immediately after you check it out.

Hope this helps.

Cheers,
Derek


reply via email to

[Prev in Thread] Current Thread [Next in Thread]