Beginner: Setting up Subversion externals
I believe svn externals is what I want to use but would like some clarification on setting it up. I've never done so.
My environment is:
Mac 10.6.2
Xcode
Cornerstone
Subversion 10.6 (file based/single developer)
Single repository
My svn folder structure is:
\projects\projectA
\projects\projectB
\projects\projectC
\projects\projectX (.lib file)
\projects\projectY (images)
All projects have trunk, tags, and branches folders (just as Subversion suggest). Projects X & Y are really shared code. What I'm wanting to share in them are images and .lib files. For example, projectY will contains PSDs for images plus the product, which is a PNG. projectX will contain Xcode source files plus the product, which is a .lib fi开发者_StackOverflow中文版le.
In projects A thru C, I want to reference the PNG and .lib files and would like to have the option of either referencing latest or a particular version, which I understand externals will do. projectY will contain all of its PNG files. However, projectX will output its .lib to a common build folder that all Xcode projects use.
If I create an external property from projectA to images in projectY, doesn't that mean all of projectY is an external, source code (PSDs) and all? I'm just interested in the PNGs.
Additionally, if I want to reference particular versions of the .lib file in projectX from projects B and C, how is that done since projectX outputs its .lib file to a common Xcode build folder?
When I update an image in projectX, how does projectA get the latest image? Just by doing an update?
If I put all of projectY's images into a product folder and only need three of its say 50 images in projectA, will all 50 still show up in projectA? Is that a performance issue?
You can set an externals reference to any folder in Subversion - you can point to the folder containing the PNGs only. As for particular built versions, you should consider committing the build output, and tagging each version, then setting an svn:externals reference to the tag.
Yes, an upate to projectA will pick up the updated image in projectX via the externals link (as long as you didn't check it out with the option to ignore externals...).
Tagging is quite useful for such scenarios (depending on whether the complexity of your requirements warrants it). The practice I use at work for shared resources is to tag each version (1.0, 1.1, 2.0, etc.) of the code to be distributed via externals, and point the externals at the latest tagged version.
This means that, for whatever reason, should I need to check out an old version of some project, it's always referencing the same shared files, not just the latest revision.
精彩评论