Simplified Tutorial
John Arbash Meinel
john at arbash-meinel.com
Sat May 6 18:25:44 BST 2006
Erik Bågfors wrote:
> On 5/6/06, Ramon Diaz-Uriarte <rdiaz02 at gmail.com> wrote:
>> This is a very useful document! A few comments/questions:
>>
>>
>> ================================================
>> > A shared repository is a storage that can contain multiple branches.
>> > By putting the branches in a shared repository, they will use the same
>> > storage for things that are the same between different branches. It
>> > is recommended to keep related branches in a shared repository.
>> >
>> > Branches in bzr can also be standalone, in this case, each branch does
>> > not share the same storage.
>> >
>> > The setup described in this document is where you have one centralized
>> > shared repository on a central server. This repository is then used by
>> > all developers. In this setup, each developer needs to be able to
>>
>> In the last paragraph, does "shared" have the meaning of "shared by
>> several users" or "shared because there are several branches". If the
>> later, why/how does that relate to the cvs/svn-like usage.
>
> Shared between several branches, they may or may not also be shared
> between several users, but so may standalone branches. In the example
> above, it's both.
>
> In svn-terms a shared repository is what's also called a repository in
> svn, and a branch is "trunk", or "branches/foobranch". In CVS it's
> harder, because CVS sucks :)
>
In some ways, in other ways I prefer "cvs checkout -r branch", because
then the files don't get in the way of the branch namespace.
>
>> > Creating a centralized shared storage
>> > =====================================
>> > $ bzr init-repo sftp://bzr@server/path/to/repo
>> > to create the shared repository.
>> >
>> > In this repository, you need to create a branch, this is done with the
>> > command "bzr init", for example
>> > $ bzr init sftp://bzr@server/path/to/repo/branch
>> > will create a branch named "branch" inside the repository.
>> >
>>
>> I have several doubts:
>>
>> - If I understand correctly, the "recipe" is for a directory that
>> doesn't yet exist
>
> Yes,
>
>> - If /path/to/repo exists and has files already, shouldn't we use "bzr
>> init" followed by "bzr add"?
>
> Nope. /path/to/repo is just a shared repository, not a branch. A
> repository cannot contain any files (only revisions and branches). The
> branches in the repository does not have working trees, so a checkout
> has to happen to add files to it. Same as in svn I think... at least
> that's how I've always worked with svn.
>
> /Erik
Are you trying to be simplified or complete with your statement? If you
are trying to be simplified, you are close enough. But if you do:
bzr init-repo --trees /path/to/repo
Then by default, new branches created there will have working trees. I
use it in my working directory, so that I can have 10 development
branches of bzr, which all share the same history storage.
Also, even without the above, you can do:
bzr init-repo /path/to/repo
cd /path/to/repo
bzr init newbranch
cd newbranch
# Bzr 'init' always creates a checkout
Or
cd /path/to/repo
bzr get sftp://host/other/branch tohere
cd tohere
bzr checkout
# The above will create a checkout into the local directory.
# Basically just creates a working tree for the branch you
# are currently sitting in.
I'm not advocating teaching all of these concepts in a "bzr for svn/cvs
users" tutorial. But I wanted to make sure that you understood your
comment isn't 100% correct.
As far as svn, there is some way that when you commit changes, those
automatically show up. My friend uses it for maintaining his website.
(And he isn't using a postcommit script to update a tree somewhere).
I think it is just a by-product of how SVN's webdav access works. Doing
a plain "GET" gives you the latest version of the file that fits at that
location. Even though doing an 'ls' on that directory would return
nothing (since it is stored inside svn).
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060506/1a350fac/attachment.pgp
More information about the bazaar
mailing list