? SVN and (Shared) External Includes

omcbfyekyu
omcbfyekyu
Hi,    I’m new to (automated) version control and Subversion in particular. I need some help in setting up and organizing the repos.    I currently have things set up like this:     /data (general data folder)   +-/vc (visual c++ projects)   +-/proj1   +-/proj2    +-/asm (assembler projects)   +-/vb (visual basic projects)   +-/cpp (non visual c++ projects)    +-/h (c includes (mostly controls and components))      It’s set up so that say, proj1 (a VC++ project) includes for example MyFancyControl.cpp and MyFancyControl.h from /data/h, but so do proj5 and proj10.    I need a way of handling the shared external includes. How do I handle this sort of thing with Subversion?      Thanks a lot.

Last updated

erimag
omcbfyekyu
omcbfyekyu
Thanks for the tip; I’ll check it out.
omcbfyekyu
omcbfyekyu
I’m using TortoiseSVN to simplify Subversion, so I am removed from the low-level file access. Any idea how to use externals with that? TSVN doesn’t have a forum, so you have to use the mailing list which is not good.    Single-file externals are not currently supported by SVN right? I think I read somewhere that they are supposed to be supported in 1.6, which means that it won’t be of any help for some time to come.
JNiven
JNiven
Hi omcbfyekyu    The TortoiseSVN manual describes how to use svn:externals: http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-howto-common-projects.html#tsvn-howto-common-externals.    Single file externals aren't supported, but why couldn't you externalise the parent directory? e.g. instead of...    ProjectA/  - ProjectA_File  - ProjectB_File [via svn:externals]  ProjectB/  - ProjectB_File    ...you do something like...    ProjectA/  - ProjectA_File  - External/ [via svn:externals]  -- ProjectB_File  ProjectB/  - ProjectB_File    Cheers  John
omcbfyekyu
omcbfyekyu
Hmmm, I’m not really sure what you are suggesting.    What about this: instead of having a bunch of loose CPP/H files in the include dir, I put them in their own subfolder in /data/h, then SVN can use that dir as external right? Finally, I just add the subfolder to my #include lines since /data/h is in the include path. (eg. instead of #include "fancyctrl.h", I use #include "fancyctrl/fancyctrl.h".)    I can’t do any dev stuff right now, so I can’t test it, but it sounds like it should work from all angles.
JNiven
JNiven
Hi omcbfyekyu    I'm not sure what you're suggesting (too early, not enough coffee...) but it sounds as if your suggestion is more or less the same as my suggestion (try typing that when you've just woken up) :-)    Give it a go and shout if you run into difficulties.    Cheers  John

1-7 of 7

Reply to this discussion

You cannot edit posts or make replies: You should be logged in before you can post.