Bazaar Repository Structure, Branches, Tags

David Cournapeau david at ar.media.kyoto-u.ac.jp
Wed Jun 4 03:19:17 BST 2008


JetMark wrote:
>
> Its not just Bizaar that does this type of thing, for a while I 
> considered subversion and a major point against subversion (in my 
> view) is that it seems to have confused/polluted the 
> directory-structure name space with that of the tag names name space. 
> Now it seems that Bizaar does the same.
>

I don't know cvs at all, so maybe I am missing something, but svn and 
bzr are really different in that respect. bzr, at its core, has the 
branch concept. You can tag a particular revision in a branch, but tag 
is not a branch, just a nickname to a particular revision in a branch.

bzr does have "a branch is a directory" concept (contrary to git and 
mercurial), though.

> In CVS, when checking out to do a build (so this is a checkout not for 
> modification purposes.) If I have a tag of any description, weather 
> its a branch tag, HEAD or some other tag, that is all I need to know. 
> It appears that in Bazaar I need in fact to know if the tag I have 
> been given is a branch or a tag, and worse, that the name space here 
> is not mutually exclusive. In other words, I can create branches and 
> tags with the same name that are not the same. Is this true? [Question 1]
>

What do you mean by branch name and branch tag ? As a tag is just an 
alias for a revision, you do:

bzr branch -r tag:"foo" mybranch

And this is exactly the same as

bzr branch -r rev mybranch

where rev is the revision corresponding to tag:"foo".

> Second I think its very strange that Bizaar would incorporate tag 
> information into the repository structure. To checkout I need to do
>
> bzr checkout mytopdirectory/[branch or tag identifier]/[branch or tag 
> name] .
>

I am afraid I don't understand this at all: what is a tag identifier and 
tag name ? Also, what do you mean by repository structure ? You never 
need to even look into the repository structure (the .bzr directory), 
normally.

> As it happens, with CVS the directory structure of the repository is 
> the same as the files in it, but it doesnt have to be like that: you 
> could write a CVS server where all the information was stored in one file
>

Actually, in bzr, with the default format, almost everything is put in a 
few files (the .pack files), but as you said, it is an implementation 
detail, and you never ever have to know where and what they are to use bzr.

> , a database or whatever, the user view of the system is through the 
> interface and ought to allow anything to be stored under any tag. 
> [Question 2] Why is it done like this? Why do other modern VCS systems 
> appear to make the same mistake? Is it a mistake or do I just not get 
> something here?
>

I think you are missing something. As I have never used CVS, I can't 
really think "the CVS" way, but I know I never really understood the 
Subversion way either. The branch concept is the only thing you really 
need to understand to use bzr effectively. A branch contains all the 
revisions in its repository (which is in the .bzr directory of the top 
directory of your project, but again, an implementation detail, you 
should not have to look into it). A tag is then an alias to a particular 
*revision* in the branch.

All bzr commands in a branch are done with respect to that branch, and 
are an interface to the repository.

> Lastly if I use Bizaar, its likely I will want to use the hooks. These 
> will be complex, custom, and require creation and maintenance over a 
> period of time. Am I disadvantaged by the fact that I am not very good 
> at python and not really keen to spend time learning yet another 
> language? Its bad enough Bizaar "runs on anything that will run Python 
> 2.4" (All the systems we use use only 2.3) but I dont see anything 
> about how to use an executable as a hook.
>

I have never used the hook, calling an external command is not difficult 
in python. Look for example at the subprocess module in python:

http://docs.python.org/lib/module-subprocess.html

from subprocess import call
call(["ls", "-a"], shell = True)

Will call ls -a.

David



More information about the bazaar mailing list