Shared Repository Layouts

Asked by Deepinthekernel

I am reading the Bazaar documentation "SharedRepositoryLayouts" at http://bazaar-vcs.org/SharedRepositoryLayouts it seems to be clear, and best of all short. But the more I read it the more confused I become.

I am used to CVS, maybe thats my problem. BUT I dont see why there should be ANY structure for branches other than the genealogical one. This is the case in CVS, and CVS has the problem, amongst many others (!!) that if you are not careful you completely loose track of where the branches branched from.

So I ask myself what would I expect from an IDEAL VCS? Well first I would expect that if I want one branch or tagged version checked out I can just do that. This doesnt seem to be a problem in Bazar or CVS: (Well, obviously its a rather basic requirement.)

In CVS I do

cvs co -r sometag somepath

If sometag is a "branchtag" or the special tag "HEAD" I get something I can checkin against, if an ordinary tag, I cannot check it in.

In Bazaar I am still struggling to determine weather to do a pull or a checkout, but both seem to work. In Bazaar I dont have to worry about weather I am using a branch or ordinary tag, I will still be able to commit my changes regardless and if needed a branch will be created on the fly - Great!

Now if I choose to work on two or more branches at once (in CVS) I might do (for the b1stable branch)

cvs co -r b1stable somepath
mv somepath somepath-b1-stable
cd somepath-b1-stable
(do work and cvs stuff)

The point here is that the name I am using is my name, and never gets into the repository. I can checkout another copy if I want and call it something else too.

cvs co -r b1stable somepath
mv somepath somepath-b1-stable-marks-start-over-attempt
cd somepath-b1-stable-marks-start-over-attempt
(do work and cvs stuff)

And when I checkin from within these directories, there is no contamination between the names I have used for my private developer names and the actual branch names in use.

I can use a flat structure, or one with prjects followed by branches or branches followed by projects, or I can just call it foobar if that amuses me or should I say if that is memorable to me. My choice, doesnt affect any other developers though, note. When I commit, provided I am able to commit at all, everything just goes back where it came from, perfect.

Now in Bazaar, how do I do this?

Please, can someone in the know add an example to this page (http://bazaar-vcs.org/SharedRepositoryLayouts) or reply to this post showing how we AVOID putting directory branches into directory paths, at all? Because thats what I would like to do in an ideal VCS system. Or is there something I am missing here?

Either way I dont understand this.

Question information

Language:
English Edit question
Status:
Answered
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Martin Pool (mbp) said :
#1

Your checkouts or working directories can be called whatever you like.
 The only names visible to the rest of the world are whatever they're
called on the server or place from which you publish them.

hope that helps
--
Martin <http://launchpad.net/~mbp/>

Revision history for this message
Deepinthekernel (mark-winder4) said :
#2

But there is a big discussion in this document about structure. The document contains sections 1 to 6 containing 5 different structures. This is what I do not understand.

Revision history for this message
Martin Pool (mbp) said :
#3

Can you explain more about what you're wanting to do?

Revision history for this message
Deepinthekernel (mark-winder4) said :
#4

This is what I would like to do and I cannot seem to find a sequence of Bazaar commands that makes it work. I want to use a central repository model. Each of the changes I suggest below could be multiple checkins worked on by several people, but I can illustrate my problem quite simply.
Heres what I have been doing:

#!/bin/bash

# remove any directories left over from last run, if present.
rm -fr jjj2 jjj jjj-central

#make and initialise a local repository. This is my sandbox
bzr init jjj

#make and initialise a repository that we use here as the central one,
#eventually this could be on a server on another machine but for illustrative purposes
#I just call it jjj-central
bzr init-repo jjj-central

#Now I create some work
cd jjj
echo one > myfile.txt
bzr add
bzr commit -m'1st commit'

# now we bind commits to the central server
bzr push ~/jjj-central

# I now do some further work
echo two >> myfile.txt
bzr commit -m'2nd commit'
bzr push
cd ..

# Now I need to make some changes to the first body of work , starting at some point in the past, in CVS terms I would branch after the first checkin. But I have some problems with Bazaar. I am using single file single changes to illustrate this, but it might be hundreds of changes and files of course so just undoing the last commit is not an option. I want a previous state as the starting point.
# I might also use a tag here, but lets keep it simple.

#I create a branch:
bzr branch -r revno:1 ~/jjj-central jjj2
cd jjj2
cat myfile.txt
# one

#Good! It does not contain the changes after the 1st commit!
#I make a further change: and commit that.
echo three >> myfile.txt
bzr commit -m'3rd commit'
bzr push ~/jjj-central

#But any attempt to push this to the central repository says I must merge first!
#I dont want to merge yet! I need to make releases before I merge. I might not ever merge. I need two seperate "heads"!
# bzr: ERROR: These branches have diverged. Try using "merge" and then "push".

Revision history for this message
Martin Pool (mbp) said :
#5

If you want to push two different branches into the server's
repository you must actually make two branches in there. In the
instructions above you're trying to push them both into the same
branch which of course gives an error.

So for example

bzr init-repo client
bzr init-repo server # could be remote
bzr init client/trunk
cd client/trunk
vi foo
bzr add
bzr commit
bzr push ../../server/trunk # ok now it's uploaded
bzr commit
bzr commit # more stuff
bzr push # now both client and server trunk are on r3
# now we want to make a new branch from a historical revision
bzr branch -r 1 ../bugfix
cd ../bugfix
# this now contains a copy of the originally committed code
vi foo
bzr commit -m "my fix"
# now push to a _different_ branch on the server
bzr push ../../server/bugfix

(You can avoid needing to specify the urls by hand every time by
setting up locations.conf; see the manual)

hope that helps

--
Martin <http://launchpad.net/~mbp/>

Can you help with this problem?

Provide an answer of your own, or ask Deepinthekernel for more information if necessary.

To post a message you must log in.