confused by repositories

John A Meinel john at arbash-meinel.com
Thu May 11 01:31:46 BST 2006


Jamie Wilkinson wrote:
> This one time, at band camp, John A Meinel wrote:
>> Aaron Bentley wrote:
>>> Ilpo Nyyssönen wrote:
>>>> John A Meinel <john at arbash-meinel.com> writes:
>>>>
>>>>
>>>>> But this only sets what the default will be for a new branch, and as
>>>>> mentioned, running 'bzr checkout' in that directory will create a
>>>>> working tree.
>>>> Is there a command for removing the working tree?
>>> No.  Personally, I like to keep my checkouts separate from my repository, so
>>>  - I can 'rm -r' the checkouts without losing data
>>>  - I can publish my repositories with rsync
>>>  - I can back up my repoitories without including redundant working trees
>>>  - All the inactive branches don't clutter up my working area.
>>>
>>> Aaron
>> For ease of use, I create a public and a local repository. So I have:
>>
>> sftp://juju/srv/bzr/public/branches/bzr/
>>
>> As my public repository, accessible over http from:
>> http://bzr.arbash-meinel.com/branches/bzr
>>
>> And then I create a local repository at:
>> ~/dev/bzr
>>
>> To set this up, I do:
>>
>> $ ssh juju
>> $ bzr init-repo /srv/bzr/public/branches/bzr/
>> $ exit
>> $ bzr init-repo --trees ~/dev/bzr
>> $ cd dev/bzr/
>> $ bzr init new-project
>> $ cd new-project
>> # do stuff, and commit
>> $ bzr push sftp://juju/srv/bzr/public/branches/bzr/new-project
>> $ bzr bind sftp://juju/srv/bzr/public/branches/bzr/new-project
> 
> Can you elaborate on behaviour here?  I too have a public "repository" (a
> bunch of standalone branches on a webserver), and a bunch of standalones on
> my laptop, primary development machine.
> 
> If I switch to your workflow, does a commit always push to the bound branch?
> How's that perform?

Yes it does. If you are on the local network, performance is pretty
good. If you are working from home/the hotel, it is pretty slow. But
comparable to Arch. (And status/diff/etc are still fast).

This is with knits, not weaves. Weaves are way to painful. (Before knits
came, a push of 1 revision home=>work could take 6 minutes to download
and re-upload all of inventory.weave).


> 
> What are the paths to projects like within the repository, on your working
> repo and your public repo?

Because I came from standalone branches, I tend to do a lot of leaf
branches, but no parents. Meaning I would have:

project/ <= repository base
  dev/
    0.7/ <= integration branch for version 0.7
    0.7-foo/ <= feature branch
    0.7-baz/ <= other feature branch
    0.7-jam/ <= my personal branch
  stable/
    #Nothing has been released here yet :)

And then my working directories looked like:

~/dev/
  project/ <= Repository
    dev-0.7/ <= working tree
    dev-0.7-baz/ <= working tree
    dev-0.7-jam/

The big reason for that is just that the default 'nick' for a branch is
its last path segment. And 'dev-0.7-jam' is a little better than just
'0.7-jam'.
We've discussed making the nick the full path from the repository, but
nobody has implemented that.

> 
> What happens if I'm offline?  Do I need to manually unbind?  If so, does the
> unbind only need to happen once?

Unbind breaks the binding, so you have to re-'bind' later.

> 
> If so, do you automate your bind/unbind somehow? :-)  (I'm terribly lazy :-)

However, bzr supports 'bzr commit --local' which lets you do a commit
just to the local tree.

> 
> Some of these may seem obvious to you developers, but as a user still on
> standalone branches, there's a whole basket of jargon that's not familiar to
> me.
> 
> I'm hoping answers to my questions above can help work out both why I'd want
> to use repos in the first place, and also best practices and expected behaviour when using them.
> 
> ... and I'll write a Wiki page introducing repositories...
> 

Advantage #1 is using knits. This makes everything much faster.
Advantage #2 using repositories means stuff like merging and branching
are *extremely* cheap, because no history is copied, it just creates
another pointer.


>> $ ssh otherhost
>> $ bzr init-repo /public-repo
>> $ exit
>> $ bzr init-repo ~/local-repo
>> $ cd dev
>> $ bzr checkout --lightweight ~/local-repo/branch
>>
>> I'm not sure how he does the binding, but it does keep his repositories
>> (both local and remote) clean from working trees.
> 
> So again, if there's no working trees in the repo, how do branches appear
> within the repo?
> 
> Thanks,

bzr branch, bzr push, bzr init all can create a branch inside a
repository, without needing to have a working tree.

One note of warning, current bzr code will create a standalone 0.7
branch if the source branch is an 0.7 branch. (We want to help people
not have to force migration).

So to move branches into a repository, you want to use something like:

cd $repo
bzr init branch
cd branch
bzr pull ~/other/branch

Either that, or you can:
cd ~/other/branch
bzr upgrade
bzr branch . $repo/branch

Does that help?

John
=:->



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060510/3f41f982/attachment.pgp 


More information about the bazaar mailing list