Is there any way to have something like svn externals for files stored in source control (Subversion preferably but I'd be interested if it's possible or easier for other SCM systems).
Here's what I mean. Say I've got a whole bunch of SQL scripts and these have to be merged into one big script for packaging each release. It would be good if I could create a file for the entire scripts and then just link to the other files some how and the file would automatically get updated (after an SVN update) when any of the referenced files change in subversion. The concatenated file would have to be readonly I guess.
Thinking about this a bit more having too files would probably be easier. One for the template definition and another for the file itself.
It might look something like this.
Template file (maybe .sql.svntemplate extension or something):
<external file="relative/repository/url/Script1.sql"/>
<external file="relative/repository/url/Script2.sql"/>
<external file="relative/repository/url/Script3.sql"/>
<external file="relative/repository/url/Script4.sql"/>
Of course it doesn't have to be XML.
Then when you add and commit the .sql.svntemplate file Subversion will automatically generate a readonly file with the same name except without the .svntemplate extension.
E.g.
DBScripts.sql.svntemplate
would generate a readonly file called:
DBScripts.sql
which would contain the contents from all the scripts.