Menu Search Sign up

SVN

1.                Installation

 

1.1           Download URL

http://subversion.apache.org/packages.html

http://www.open.collab.net/downloads/subversion/linux.html

1.2           Documentation

http://subversion.apache.org/docs/

http://www.open.collab.net/products/subversion/whatsnew.html

http://help.collab.net/topic/csvn/action/setupcsvn.html

http://help.collab.net/nav/11 (csvn  admin user guide)

http://help.collab.net/nav/17 (csvn edge user guide)

http://svnbook.red-bean.com/en/1.5/index.html (SVN user manual)

1.3           Prerequisites

Download Python: http://www.python.org/getit/

Download JDK:

1.4           Installation

Follow http://help.collab.net/topic/csvn/action/setupcsvn.html

Just remember:

  1. You do not need Python.
  2. When unzip the csvn tar, untar it as a regular user (not as root), and when start csvn, start it as a regular user (not as a root). Otherwise you will not be able to start the csvn server (but you can still start the console).
  3. You can deploy SVN under /opt/csvn

2.                Basic Admin

2.1           Creating a repository

As command line:

svnadmin create /opt/csvn/data/repositories/di_r_general

In CSVN Admin Console:

3.                Basic Usage

3.1           Import a folder and all its contents into a repository

svn import /home/testuser/test file:///opt/csvn/data/repositories/di_r_general -m "initial import"

Where “di_r_general” is the repository name

3.2           Checkout the entire repository to a working folder

cd <your working folder>

svn checkout file:///opt/csvn/data/repositories/di_r_general

A folder called “di_r_general” will be created under <your working folder>

Where “di_r_general” is the repository name

3.3           Checkout a folder and all its contents from a repository to a working folder

cd <your working folder>

svn checkout file:///opt/csvn/data/repositories/di_r_general/utils

A folder called “utils” will be created under <your working folder>

Where “di_r_general” is the repository name

3.4           Edit a file and commit the change to a repository

vi test.txt

svn commit -m “any commit tag string”

3.5           Add a file and commit the addition to a repository

cat test_new.txt

svn add test_new.txt

svn commit -m “any commit tag string”

3.6           Delete a file and commit the deletion to a repository

svn delete test_new.txt (which will immediately delete the file from your working directory)

svn commit -m “any commit tag string”  (which will delete the file from the repository)

3.7           Summary of making changes

Here is an overview of the five Subversion subcommands that you'll use most often to make tree changes:

svn add foo

Schedule file, directory, or symbolic link foo to be added to the repository. When you next commit, foo will become a child of its parent directory. Note that if foo is a directory, everything underneath foo will be scheduled for addition. If you want only to add foo itself, pass the --depth empty option.

svn delete foo

Schedule file, directory, or symbolic link foo to be deleted from the repository. If foo is a file or link, it is immediately deleted from your working copy. If foo is a directory, it is not deleted, but Subversion schedules it for deletion. When you commit your changes, foo will be entirely removed from your working copy and the repository. [4]

svn copy foo bar

Create a new item bar as a duplicate of foo and automatically schedule bar for addition. When bar is added to the repository on the next commit, its copy history is recorded (as having originally come from foo). svn copy does not create intermediate directories unless you pass the --parents option.

svn move foo bar

This command is exactly the same as running svn copy foo bar; svn delete foo. That is, bar is scheduled for addition as a copy of foo, and foo is scheduled for removal. svn move does not create intermediate directories unless you pass the --parents option.

svn mkdir blort

This command is exactly the same as running mkdir blort; svn add blort. That is, a new directory named blort is created and scheduled for addition.

3.8           Update your working copy

cd <your working copy directory>

svn update (to receive changes other people made and committed to the repository, or yourself made in other working copy directory and committed to the repository)

3.9           Access Console

Access console: http://172.17.2.80:3343/csvn/  (admin/admin)

3.10      Browse Repositories

Browse repositories:

http://172.17.2.80:18080/viewvc/di_r_tr/

http://172.17.2.80:18080/viewvc/di_r_general/

Where both “di_r_tr” and “di_r_general” are names of repositories.

3.11      Integrate with a Windows SVN Client (TortoiseSVN)

3.11.1                        CSVN URL

The CSVN URL to use to integrate a Windows SVN client is http://<host name>:18080/svn/<repository name>

3.11.2                         TortoiseSVN Installation

Download TortoiseSVN-1.6.16.21511-win32-svn-1.6.17.msi from https://tortoisesvn.net/downloads.html 

Run TortoiseSVN-1.6.16.21511-win32-svn-1.6.17.msi to install TortoiseSVN on your Windows host (install all components in a folder of your choosing)

Restart your windows host

3.11.3                        TortoiseSVN Basic Usage

3.11.3.1                 Download a working copy of a repository

Open Windows Explorer

Navigate to the folder where you want to keep a working copy of your SVN repository

Right-click the folder

 image001.png

Click “Export...” to get a read-only copy of the repository:

 image003.png

3.11.3.1                 Checkout a repository folder

Navigate to the folder where you want to keep a checked-out folder of your SVN repository

Right-click the folder

Click “SVN Checkout...” to check out a folder in the repository:

 image005.png

3.11.3.2                 Update your checked-out folder of other users’ changes

Right-click the checked-out folder, and click “SVN Update” to update the checked-out folder of the changes made by other users that were committed to CSVN server:

 image007.png

3.11.3.3                 Commit your changes

After you have made changes to files in the checked-out folder, right-click the folder, and click “SVN Commit...” to commit the changes back to the CSVN server.

image009.png