Subversion
Contents |
Modifications without a Working Copy
Some repository changes can be made without a working copy.
These commands include svn mkdir, svn copy, svn move, and svn delete.
You can supply a repository URL instead of a path for certain operations with these commands.
Also, use -m "Message" to supply a commit log message.
Using a Vendor Branch
The svn_load_dirs.pl script is designed to help with maintaining vendor branches.
These are often set up as follows:
-
/vendor/current -
/vendor/1.0.0 -
/vendor/1.0.1
etc. where current is a tag of the latest version of the vendor's product.
This page has a very detailed walkthrough of how to use vendor branches and svn_load_dirs.pl in particular.
My typical commands for updating a new version
Example: Loading a new version of WHMCS:
~/svn_load_dirs.pl https://svn.example.com/svn/WHMCS/originals current ~/Downloads/whmcs_v431/whmcs -t 4.3.1 -no_auto_exe
(Note: I currently have svn_load_dirs.pl in my home directory, but modify this path as necessary for where you have this script.)
The -no_auto_exe flag prevents the script from automatically setting svn:execute on executable files.
Then to merge the changes into my current working copy (trunk):
svn merge https://svn.example.com/svn/WHMCS/originals/4.2.1 https://svn.example.com/svn/WHMCS/originals/4.3.1 .
Note that, depending on how the working copy is set up, it may be necessary to specify your username in the URL. (e.g., https://user@svn.example.com)
Also, in the case of WHMCS, it is necessary to upload the install directory to the web server so it can perform the necessary DB updates.
(This directory is then removed after the updates have been performed.)
Using a Working Copy on a Live Site
.htaccess
This will prevent users from browsing .svn folders.
# Disallow browsing of Subversion working copy administrative dirs. <IfModule mod_rewrite.c> RewriteEngine On # Prevent .svn directory browsing. RewriteRule ^(.*)(.svn)(.*)$ ./ [L,F] </IfModule>