Difference: CemSvnUsage (6 vs. 7)

Revision 704 Dec 2011 - Main.DavidStokes

 
META TOPICPARENT name="CemITSystem"
Contents

Initial Setup

  • need following packages: Apache, subversion, mod_dav_svn (install with yum)

configuration

  • edit /etc/httpd/conf.d/subversion.conf as follows:
<Location /repos>
   DAV svn
   SVNPath /var/www/svn/repos

   # Limit write permission to list of valid users.
   <LimitExcept GET PROPFIND OPTIONS REPORT>
      # Require SSL connection for password protection.
      # SSLRequireSSL

      AuthType Basic
      AuthName "Subversion repos"
      AuthUserFile /etc/svn-auth-conf
      Require valid-user
   </LimitExcept>
</Location>

  • add subversion users:
    [root@lucifer ~] htpasswd -cm /etc/svn-auth-conf yourusername
    New password:
    Re-type new password:
    Adding password for user yourusername
    [root@lucifer ~] htpasswd -m /etc/svn-auth-conf anotherusername
    New password:
    Re-type new password:
    Adding password for user anotherusername
    

  • configure repository
cd /var/www
sudo mkdir svn
cd svn
sudo svnadmin create repos
sudo chown -R apache.apache repos
sudo service httpd restart

Setting up repository and importing

  • set up standard directory tree
mkdir myproj
cd myproj
mkdir trunk
mkdir branches
mkdir tags
cd trunk
<put all main files here>
  • import the tree (assuming myproj is in current directory):
   svn import myproj file:///var/www/svn/repos/myproj -m "Initial layout and import for myproj"

to checkout repository

  • svn co http://cronus/repos/emip_distr
  • once you checked out the repository from a particular server, then all update and commit commands refer to this server
  • there is an .svn file hiding in all the directories

to commit changes to repository

  • svn commit -m "comment"
  • svn ci -m "comment" (same thing)
  • can apply to entire trunk or only to individual directories
  • in order to do be able to commit changes, run the following command on the server (cronus)
    • sudo htpasswd -m /etc/svn-auth-conf stokes

to add or remove files from svn logging

  • svn add filename
  • svn rm filename
  • svn mv file1 file2
  • svn cp file1 file2
  • if you simply remove the file then svn will not commit those change
  • if you modify a file that svn is already aware of, then these changes will be committed
  • if you copy a new file into the repository, then you need to use "add" command to make svn aware of it

to make sure programs and scripts are executable

  • svn propset svn:executable on [filename]
    • you can use wildcards on the filename
  • this applies to local directory, then commit your changes to the repository
  • svn proplist http://cronus/repos/emip_distr/emip.py to check on current properties

to update local file with contents of the repository

  • svn update
Added:
>
>

to ask about status of local files

  • svn status
  • svn info filename
 

to tunnel to svn server

moving repository to new server:

  1. Backup current repository to file
sudo svnadmin dump /var/www/svn/repos >current_repo_backup
  1. Install svn on new server (see above) and make empty repository
cd /var/www
sudo mkdir svn
cd svn
svnadmin create repos
sudo chown apache.apache repos
  1. Restore repo backup:
sudo svnadmin load /var/www/svn/repos <current_repo_backup

telling your client that the server has moved

svn switch --relocate http://cem100/repos/myrepo http://cronus/repos/myrepo .

  • Set ALLOWTOPICVIEW =

-- DavidStokes - 03 Feb 2011

 
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding this intranet, Send feedback