views:

388

answers:

6

We have 2 repositories, one for current code, one for project management.

Now we need to branch code to the project management repository.

SVN gives me an error, and I found in the doc that SVN cannot do this work (different repository),

So I export the code and check in to the project repository.

The questions:

  • how to branch code to another repository?
  • for my case, how can I move the changes back from the project repository to the current repository? (I haven't test it yet, but I think a diff or patch may work)

PS: I know there is a trunk/branch way, but we use two repositories.

+1  A: 

If, by responsibility, you mean repository (thanx, Blair), you found that you can't branch to another repository. But if your code and your project are related, then it makes sense to have them in the same repository. You will want to learn more about svn and use it better. For instance, "trunk" is just a directory name, so you can have one for the project, and a separate one for the code. Although, using those particular words, most of us would expect "code" to be inside "project".

Anyway, if you go outside of a repository, you lose all history and you lose all chance of branching or merging. So you need to rethink your organization. Or use a different version control system that does what you want.

gbarry
I know how to solve it in the right way, but we all face something that cannot easily change.. like organization..
linjunhalida
A: 

You should have all the code in one repository.

It could look like this:

name/trunk/src
name/branches/dev/src

Or, in the words you used:

name/current-code/src
name/project/src

Then, you can easily svn merge back and forth.

I know it will work, but We use 2 repository.......
linjunhalida
-1 for saying "should have" instead of dealing with the situation described in the question. The guy can't help that his company's code is stored in different repositories.
Sarah Vessels
+4  A: 

If I got it right you want to add contents already under version control from a repository to another ? If that's it you should probably have a look on svnsync which helps you merging different repositories.

Otherwise it may be simpler to keep the two repositories and add external definitions (links) to make them coexist. This way you won't have to bother to much about breaking anything.

Theo.T
+1  A: 

TortoiseSVN offers a "copy and add these files here" feature, but as of SVN 1.5.5, this feature was not supported. I have not yet tested it with 1.6.0

right-drag (not a normal left-drag) your files from repo A into a directory within repo B and release the mouse. A menu will appear asking what you want to do. There are, I think, 4 options to choose from (other than the normal OS options). Choose the one that is most appropriate.

KOGI
A: 

The official svn-book refers to a script that you can use to make this process easier, called svn_load_dirs.pl. Take a look at the online manual

Andrew Edgecombe