adding a sub-branch to an existing branch

Asked by Rico Suave

Hi All,

My problem is as follows:

We have a big project consisting of different parts. The main part is a website, but we also have some Visual Basic code, some translation files that change sometimes and some reports.

All of these things are in separate folders in the main (versioned) folder. Now I want to try to be able to push only the "wwwroot" folder separately to our staging webservers. If I install bazaar on them I could use bzr push to update their code.

In our current situation this would not only push the wwwroot folder, but all the other versioned folders aswell. To solve this I have used bzr init to make the wwwroot folder a separate branch nested inside the main branch. It now has it's own .bzr folder, and I also added a .bzrignore file.

The problem is I can't add the .bzr folders to the main branch one level up. When I try to, bzr says:
"bzr: ERROR: Cannot operate on ".bzr" because it is a control file"

If I can't add them, the other developers won't see this new, separate branch. We work with a central repository and a local checkout for each developer. We all commit to the central server.

So the main question is, how can I add a new branch under the existing one and have the other developers updated aswell?

Thanks for any help you can give me on this,

Erik

Question information

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

If all the code needs to fit together, perhaps you should have just
one branch and use a filtered view
<http://doc.bazaar.canonical.com/bzr.dev/en/user-guide/filtered_views.html>
have just the wwwroot directory visible on the server.

Alternatively if the website is not tightly connected to the source
code, if it's just "about" the project, then perhaps it should be a
totally separate branch and people should just get a separate checkout
of it.

Revision history for this message
Rico Suave (erik-supportprofessionals) said :
#2

Hi Martin,

Thanks for your answer. I'm afraid both suggestions do not match what I want completely;

The "translations" folder for example, is shared amongst all our customers, and is therefore only on a single location on the server. The "wwwroot" folder is per-client (they all have their own revision), so there are multiple wwwroot folders on the server.

So even though the two are related; there should be only one translation folder on each server, and for every wwwroot folder we'd like to just be able to "push" a revision to a specific customer using bazaar.

I think your second suggestion comes closest to what we want. I thought it should be possible in bazaar to have a branch nested inside another. We could then just go to the "sub-branch" and push that (independently of the parent branch). When committing we would commit in the parent/top branch.

The thing is, even though I can create that sub-branch, the parent branch won't let me add the .bzr folder that gets created. I was hoping the situation I want was possible, but that I'm doing it wrong :)

Erik

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

You shouldn't try to add the .bzr directory. If you want the combined
tree to automatically be checked out together, look at
http://doc.bazaar.canonical.com/plugins/en/scmproj-plugin.html

It sounds to me like you want wwwroot and translations to be versioned
separatel; then you can have a branch of wwwroot for each customer.

Revision history for this message
Rico Suave (erik-supportprofessionals) said :
#4

Thanks Martin,

I'll have a look at scmproj, but I think your second suggestion does make sense. They are separate things, although adding a translation in the website would need change in the translation folder as well. I guess we need to get used to doing two separate commits when we add a translation and a new part of the site.

Can you tell me what the easiest way is to accomplish this, without losing the "wwwroot" history?

Do I "bzr init" a new, empty folder and "bzr mv" the contents of the current wwwroot folder in there?

Thanks,

Erik

Revision history for this message
Rico Suave (erik-supportprofessionals) said :
#5

Thanks Martin Pool, that solved my question.

Revision history for this message
Marius Kruger (amanica) said :
#6

> Can you tell me what the easiest way is to accomplish this, without losing the "wwwroot" history?
> Do I "bzr init" a new, empty folder and "bzr mv" the contents of the current wwwroot folder in there?

see `bzr split --help` or http://doc.bazaar.canonical.com/bzr.dev/en/user-reference/split-help.html