RE: Can I set the external property on a repository from svn?
From: Méresse Christophe <christophe.meresse_at_nagra.com>
Date: 2007-03-08 17:24:22 CET
From: Tom Malia [mailto:firstname.lastname@example.org]
I'm trying to create batch scripts that will build new repositories for my projects. In many cases each project needs to have a "canned" setup external references included. I would like to be able to build as much of the initial state of the repository as possible prior to actually having to create any working directories.
For example, let's assume that I already have several repositories for some vendor products and some internal shared code sets that I use in most of my new programming projects. So let's say I have the following existing repositories:
Now, I want to be able to easily build new repositories for new development projects that use the code in the two above listed repositories so I want to do something like:
Svnadmin create c:\scc\TTDSProjects\MyNewProject
svn mkdir file:///c:/scc/test01/MyNewProject/Trunk -mInitializtion
svn mkdir file:///c:/scc/test01/MyNewProject/Branches -mInitializtion
svn mkdir file:///c:/scc/test01/MyNewProject/Tags -mInitializtion
svn propset svn:external Solomon File:///c:/scc/Vendors/Solomon/Versions/55 <file:///c:\scc\Vendors\Solomon\Versions\55>
svn propset svn:external TTDS_LIBS_SchemaManager File:///c:/scc/Vendors/Solomon/Versions/55 <file:///c:\scc\Vendors\Solomon\Versions\55>
How can I do this? It's the external property setting that is giving me trouble. It tells me I can't perform this operation on a remote repository but rather have to do it to a working directory. Is this true? Isn't there some way around this? I'm trying to create a "Canned" initial state for my repositories to start from.
1- The property name is svn:externals (note the s) not svn:external
2- You must apply the property to your c:\scc\TTDSProjects\MyNewProject\trunk (I guess)
3- You have to apply it on a workspace, so you'll have to checkout (non recursively (-N) may be the best)
4- Applying a multiline property (as you want 2 different libraries) with propset is not easy, I'd advice you to do it with a propedit.
svn co -N File:///c:/scc/TTDSProjects/MyNewProject/Trunk
svn propedit svn:externals Trunk
And edit the content like this (you must have the $SVN_EDITOR variable set):
svn commit -m "Set the different svn:externals libraries" Trunk
Now you can delete your local temporary Trunk directory.
Uppercase on Tags, Branches and Trunk directories are not usual (but ok why not, if you are not affraid to use third party tools that will not recognize them...)
This is an archived mail posted to the Subversion Users mailing list.