Ctroy
Ctroy

Reputation: 587

Tortoise SVN Multiple repository question

I use Tortoise SVN and I have one repository called "First". My SVN Location is C:\SVN.

Now, I created a new project in repository "Two".

The current structure is
C:\SVN
-> First
-> Second

I have few classes in First that I want to use in Second. Earlier, I just used to copy the files and modify it in second, but now since I am using SVN, I think it makes sense having just one copy of the class files and reusing them.

How can i check out the classes in First to be used in Second? And when I modify the classes, how can i update First??

Thanks.

Upvotes: 0

Views: 3053

Answers (2)

skaz
skaz

Reputation: 22580

Either add projects that exist in First in Second, or add the files from First into your project/solution in Second. Note that this will assume a directory structure. For example: if First needs class A from Second, in the first solution, provide a link to file "..\First\A.class". Then it will be compiled into your Second project, but will really reference the file in the other repository, so updates to it will be made in the first repository.

Upvotes: 0

D'Arcy Rittich
D'Arcy Rittich

Reputation: 171351

You can reference a sub folder (or the entire repository) of repo First in repo Second using svn:externals.

This way when Second is checked out, it will also check out the files referenced from repo First.

Then, when you are using repo Second, and you modify the referenced class from First, you can commit them back. You will have to do this explicitly at the folder level used in the svn:externals reference, though. If you commit at the top-level of Second, it will not automatically commit changes to the sub-folder referencing First.

Upvotes: 1

Related Questions