Question about features

Eugene Wee crystalrecursion at gmail.com
Wed Nov 4 18:34:03 GMT 2009


Hi,

On Thu, Nov 5, 2009 at 12:50 AM, Daniel Carrera <dcarrera at gmail.com> wrote:
> So basically all the branches are in the same working directory?

No, the feature branches are still in their own directories, but you
can switch your checkout between them as needed. See:
http://doc.bazaar-vcs.org/latest/en/user-guide/reusing_a_checkout.html

> * What is the difference between "bzr init" and "bzr init-repo"?

The former initialises a branch, the latter initialises a shared
repository. If you do not already have Bazaar installed, or simply
want to use an online reference, see:
http://doc.bazaar-vcs.org/latest/en/user-reference/index.html

> * What does --no-trees do?
> * What does --lightweight do? Is that what makes branches share the same
> working directory?

This should have been covered by the article in my first link.
--no-trees means that branches using the shared repository do not
contain working trees. As such, you use the working tree contained in
your checkout.

> Lastly, what would happen if I run "bzr upload" right here? Would that send
> just the contents of the current branch (integration)? Or would it send the
> contents of all the branches?
>
> If "bzr upload" sends everything, that would be great. I think it would
> probably do everything I need. One more question. What if I do this:

I think that it will only upload whatever is in working tree, which in
turn depends on whatever branch the checkout is currently bound to.
However, you probably only want to upload based on your mirror of the
trunk. Perhaps this article on organising branches will be a good
read:
http://doc.bazaar-vcs.org/latest/en/user-guide/organizing_branches.html

> $ bzr switch --create-branch featureA
> ** hack
> $ bzr commit
> $ bzr switch --create-branch featureB
> ** hack
> $ bzr commit
> $ bzr upload  # Send to test server.
> ** Ooops, I made a mistake.
> $ bzr switch featureA
> $ bzr uncommit
> ** Fix bug.
> $ bzr commit
> $ bzr upload  # Send to test server again.
> ** Ok, now it works.
> $ bzr switch integration
> $ bzr merge ../featureA
> $ bzr merge ../featureB
> $ bzr commit
>
>
> Would that work?

I would switch to the integration branch/trunk mirror, merge the
features in, then upload. If there is a fix to be made for a feature,
I would switch to that feature branch, make the fix (committing as
many times as I need), then switch to the integration branch/trunk
mirror, and merge that updated feature in again and upload. I am not
sure what is the best practice for this, but after a feature is "done"
I may discard the feature branch and start new bug fix branches for it
as needed... but I also rather inconsistently keep feature branches
for bug fixes.

Regards,
Eugene



More information about the bazaar mailing list