views:

70

answers:

3

We currently have a SVN repository that we store our sourcecode in. We have a large range of projects in there (hundreds) and multiple common libraries etc.

It all works quite well but it's non-standard in structure. Initially we were aiming for the standard "Trunk\", "Tags\Tag_1.0.0\" style model but the problem we had was that the relative paths for our projects stopped working.

EG:

- Common
|- Trunk
|- Tags
||- Tag_1.0.0
- OtherProject
|- Trunk
|- Tags
||- Tag_1.0.0

In this structure (which I'd call fairly standard, correct me if I'm wrong) a reference in OtherProject to common's tag from the trunk folder would be "../../Common/Tags/Tag_1.0.0" which resolves to /Common/Tag_1.0.0 (actually there'd be more ..'s cause the projects aren't flat in the trunk, but this save a huge diagram). Once that's tagged though the same relative path goes to "/OtherProject/Common/Tags/Tag_1.0.0".

Workarounds I could think of included absolute paths, but not all the dev's use the same folders for our files (Or even same hard drive letter), changing the reference right before tagging, but there's something horrible about tagging a trunk when it won't compile and hoping once it's in the tag folder it'll just work, or putting each project's references within the project itself in DLL form but that's not as easy in Visual Studio (It's not unheard of for us to reference trunk to trunk and edit both projects simultaneously - tagging later of course) and it would bloat our SVN repository to include all the builds for every tag that's been released.

This has resulted in us putting our tags at the same hierarchy level as Trunk.

EG:

- Common
|- Trunk
|- Tag_1.0.0
- OtherProject
|- Trunk
|- Tag_1.0.0

We can't be the only ones who've had this issue, so I'm curious to hear if anyone else has fought this beast and what they've done to fix it? Is it our methodology that's wrong or have we overlooked a tool that helps with this?

+1  A: 

It looks like you're checking out the whole tree at once? Just check out the tags/trunks you need, so they're all at the same level, i.e:

  • check out Common/Tag_1.0.0 into a local directory called Common
  • check out OtherProject/Trunk into OtherProject, next to Common

Then OtherProject can reference files in Common as ../Common/<whatever>.

SimonJ
We generally keep our checkouts in the same folder structure as our SVN repository, different people take different approaches to the checkouts - most either do a "update depth"-based checkout of the folder structure then check out individual folders within. I really don't like the idea of making the folder structure required to develop different to that of SVN, it adds overhead to checkouts and seems to me like it opens the door to screw-ups (Accidentally checking out a tag to a misnamed folder and building against the wrong code or something)... Is this really what most people do or?
Tim Schneider
A: 

If all your projects are not having their own release cycle, i.e. always release together in the same time, then you can use

\trunk
  - Common
  - OtherProject
\tags
  \ Tag_1.0.0
       - Common
       - OtherProject
DJ
Unfortunately they aren't all on one release schedule - we have quite a few different projects released on their own schedules with a lot of different inter-dependencies referencing a variety of tags of other projects (No circular dependencies at least)
Tim Schneider
+1  A: 

Another option that I can think of, instead of of checking out all the project out directly, you can use svn:externals features.

For example, your main project will be OtherProject, then you can define dependency to Common project as svn:external in OtherProject with the structure you want.

See svn book on externals for more details.

DJ
That's actually a good idea, and one we almost went for. In the end we decided against it simply on the size that the checkouts would become if our shared libraries were checked out individually with each referencing app. It is the best answer I've seen yet so I'll give it a tick, but I'm starting to think maybe my mistake was trying to fit the standard even when it doesn't work for us (Most of these examples seem like they'd work great for a company that does a few big projects, but that's doesn't match our business model. We have a ton of small projects with lots of shared code).
Tim Schneider