0

We have a project which contains many subprojects, which contain relative links to files outside their trunk, to a parallel project containing shared code, for example:

shared/trunk/functions.sh
subproject1/trunk/main.sh
subproject2/trunk/main.sh
..
subproject99/trunk/main.sh

Where subproject*/trunk/main.sh invariably contains code like this:

# subprojectXX/trunk/main.sh
#!/bin/sh
source ../../shared/trunk/functions.sh

During the life of this project, we have made release tags for each of the subprojects, for example:

subproject1/tags/1.0.0
subproject1/tags/2.0.0

Now, I need to make a branch based on the 1.0.0 tag, but if I do

svn cp subproject1/tags/1.0.0 subproject1/branches/1.0.1

Then the relative paths to the shared functions no longer work.

I am tempted to do:

svn cp subproject1/tags/1.0.0 subproject1/trunk

Then do my work in trunk, and then copy it to a new tag when I'm done, eg:

svn cp subproject1/trunk subproject1/tags/1.0.1

However I am worried that this will cause all sorts of problems. Are my instincts correct?

Thanks for the suggestions about svn:externals, but I was looking for a solution that would be a little less intrusive to the (large) existing code base.

Thanks,

pix

pix
  • 5,052
  • 2
  • 23
  • 25
  • Do you mean by parallel repo the same repo your current code is inside? Why don't you use svn:externals ? – khmarbaise Aug 17 '11 at 06:47
  • What do you mean with “intrusive”? Externals were specifically designed to avoid the problem you're having. Instead of referring some outside folder, you'll be referring a folder inside the repo, there is no more difference, no more changes required. – hamstergene Aug 17 '11 at 09:42
  • By intrusive, I simply mean it will involve changing the 100+ subprojects. I guess most suggestions will involve this kind of change, but I'd like at least one alternate solution to compare against in terms of disruption. – pix Aug 18 '11 at 00:01

1 Answers1

2

You are looking for svn:externals.

hamstergene
  • 24,039
  • 5
  • 57
  • 72