Web designer needs help setting up repository

Asked by Yuvalik

I am a webdesigner and about half a year ago I decided to start using a vcs. I tried SVN, Git and Mercurial, and now I am trying Bazaar.
I understand that all vcs are primairilly aimed at programmers and not designers, and it shows in the way SVN, Git and Mercurial work. I read the bazaar documentation and some of the topics in this forum, and have high hopes that Bazaar is better suited for (Web) design & Development.
If you can and want to help me with my setup: I am not a complete noob to the command-line, but being on windows I usually use the tortoise-xxx tools. And also, being neither programmer nor native English does sometimes make it difficult for me to understand the docs.

Anyway, here's my "problem". My work-flow is as follows:

I have a C-drive containing all my documents which is backuped every day (to my E-drive), on this drive I would like to put a central repository for all my projects (in future this central repository may be placed on line when I work together with others).
I have a D-drive on which I keep my development-server's root. In this root I have my working directories.
So visually, it looks something like this:

C
|---Repositories
.......|---ProjectA
.......|---ProjectB

D
|----Localhost
.......|---ProjectA
.......|---ProjectB

When a project is finished I remove it from "localhost" but keep it in the central repository (I need to be able to checkout a project quickly if a client needs something changed)

When a project is ready to be put online I want to be able to push it onto the server (I gather Bazaar can do this using simple FTP?)

Anyway, like I said, I used SVN for a while and tried out both Git and Mercurial, of which SVN was easiest to use so far. But it didn't give me much flexibility (for example when I want to work from my laptop on the road).

All I see is that Bazaar handles trunks and branches differently, but I don't really get it.
I created a repository call "projectA" in C:/Repositories with: "bzr init-repo --no-trees"
Now, how do I get my project-files from D:/localhost in there? The documentation tells me to create a trunk directory, but I dont' want a trunk directory on my localhost for obvious reasons.

Anybody able to give me some advice and help to what would be best for my circomstances, if this means changing my general workflow somewhat I am open to suggestions.

Question information

Language:
English Edit question
Status:
Solved
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Solved by:
John A Meinel
Solved:
Last query:
Last reply:
Revision history for this message
Alexander Röhnsch (roehnsch) said :
#1

As I understand it, your every C:\Repositories\ProjectA or C:\Repositories\ProjectB or D:\Localhost\ProjectA or ... each is what I'd call a branch respectively. That's the most simple layout. You may start with:

cd C:\Repositories
mkdir ProjectA
cd ProjectA
bzr init
D:\
cd D:\Localhost
bzr checkout C:\Repositories\ProjectA

There you got your ProjectA main branch in C:\Repositories and your checkout branch in C:\Localhost. Work on your checkout branch, then commit and you will get the changes in your main branch. Do that with every project.

So far, each branch stores its own history, i.e. owns its own repository, even the checkout branches. That may be confusing but does not hinder your work flow. Deleting a checkout branch doesn't affect its main branch.

There are several derivations of that procedure, each having their own advantages in certain situations:

- You may do a so called lightweight checkout of a project by passing the -lightweight flag. Then that branch doesn't store its own repository but uses that of its main branch. That's more SVNish but slow over networks.

- You may specify a so called shared repository above all your projects. Call "bzr init-repo . --no-trees" on your C:\Repositories folder. When you now "bzr init" a new project under C:\Repositories, it doesn't create its own repository but uses C:\Repositories. When multiple projects do that you may save space, especially with projects inherited from each other. This may be what you had in mind with a "central repository".

There are other derivations, many of which I haven't digged into, either. One more thought: When reading about a trunk directory in the Bazaar documentation, it just refers to a main branch with other branches branched from it for feature development or what else. It need not be named "trunk" literally.

Revision history for this message
Yuvalik (info-yuvalik) said :
#2

Ok, that clears up a bit. One more question. When I use the second derivative (shared repository created with --no-trees), will that still start each new project with revision 1? Or does this work like SVN and it increments the revision regardless of the project?

Revision history for this message
Best John A Meinel (jameinel) said :
#3

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Yuvalik wrote:
> Question #88515 on Bazaar changed:
> https://answers.launchpad.net/bzr/+question/88515
>
> Yuvalik posted a new comment:
> Ok, that clears up a bit. One more question. When I use the second
> derivative (shared repository created with --no-trees), will that still
> start each new project with revision 1? Or does this work like SVN and
> it increments the revision regardless of the project?
>

Every branch has its own revision numbers. So:

bzr init A
cd A
for i in `seq 10`; bzr commit --unchanged -m $i; done

bzr revno # 10
cd ..
bzr branch A B
bzr revno B # 10
bzr commit -m "one in A" A
bzr commit -m "different one in B" B
bzr revno A # 11
bzr revno B # 11

Revision *numbers* aren't considered unique. A branch + revision number
*does* define a unique revision (in a way that is mostly stable, though
there are things like 'pull --overwrite' that can effectively change
what a branch *is*, and cause renumbering to occur.)

So 'bzr init' will always start the branch over at 1, 'bzr branch' will
start at whatever revision number it is currently at.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkr1yQcACgkQJdeBCYSNAAPeJACeOFw2A/WSmNN32fYEectDiMg9
dNwAn1WRDeLJaT62bDEOacbwmzFQtcPU
=0NiH
-----END PGP SIGNATURE-----

Revision history for this message
Yuvalik (info-yuvalik) said :
#4

Thanks John A Meinel, that solved my question.