Source control versioning and references
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?
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.
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 calledCommon
- check out
OtherProject/Trunk
intoOtherProject
, next toCommon
Then OtherProject
can reference files in Common
as ../Common/<whatever>
.
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
精彩评论