How to Edit svn:externals from Unix Shell or from TortoiseSVN on Windows
This is a mini how to that shows how to edit svn:externals from a UNIX shell or from TortoiseSVN on Windows. Follow the simple directions below to modify the svn:externals and commit to your SVN repository. I performed the below two sets of steps on CentOS 5.2 for the Linux steps and on Windows XP Service Pack 3 for the Windows steps.
svn:externals from UNIX/Linux shell
- Set SVN_EDITOR: First you will need to set the SVN_EDITOR to your favorite UNIX/Linux editor. I perfer vi so following this exact will open the svn:externals in the vi editor. If you want to use a different editory simply change /bin/vi to the path of your favorite editor.
- Edit SVN Externals: Now you will need to edit the existing externals or add new ones using the following command and example file contents below. Make sure to keep in mind the path of the directory you are setting as external. Please note that this is outdated for rspec and currently it is recommended to run the rspec gem instead so this is only being used as an example. So if you wanted to add <svn-root>/vendor/plugins/rspec then you might add the svn:externals to the plugins directory with the below contents:
- Commit Changes: Now run the below command to commit the changes so they can be updated to any servers using this SVN tree.
[root@server ~]$ SVN_EDITOR='"/bin/vi"' [root@server ~]$ export SVN_EDITOR
rspec svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec rspec_on_rails svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails
The command to actually edit the externals file for this directory would be the following:
[root@server ~]$ cd /vendor/plugins [root@server ~]$ svn propedit svn:externals .
When you are done modifying the file or adding the directories that will sync with external sources then you should write/quit the file from vi with “:wq!”.
[root@server ~]$ svn commit -m "updated externals"
svn:externals from TortoiseSVN on Windows
- Navigate to Folder: Open up Windows Explorer and navigate to the folder where you will add the svn externals.
- Open Folder SVN Properties: Now right click on the folder and select Properties from the drop down. Next click on the SVN tab and then click the Properties button.
- Modify or Add SVN Externals: If you already have an SVN:Externals entry you can modify it by double clicking on it. If you do not have an SVN:Externals entry than click the New button, select SVN:Externals from the drop down, and add the entry. After either action click OK and then click OK again.
- Commit Changes: Now right click the folder you just added the SVN Externals to and choose SVN Commit. Enter a message describing your changes and click OK.
Following either of the set of steps above should have updated your svn:externals for that specific folder.