Registry Operations Curriculum
Subversion (SVN) and Change Control Exercises

Notes:
------
* Commands preceded with "$" imply that you should execute the command as
  a general user - not as root.
* Commands preceded with "#" imply that you should be working as root.
* Commands with more specific command lines (e.g. "RTR-GW>" or "mysql>") 
  imply that you are executing commands on remote equipment, or within 
  another program.

Exercises
---------

Exercises Part I
----------------

0. Log in to your PC or open a terminal window as the root user.

Once you are logged in you can continue with these exercises.
If Subversion is not already installed:

	$ apt-get install subversion

1. Create a root directory for the SVN repository:

	# mkdir /svn

2. Create the repository:

	# svnadmin create /svn/arocarchive

3. Create user and password

	# vi /svn/arocarchive/conf/passwd
     	aroc = YourPassword

4. Configure access

	# vi /svn/arocarchive/conf/svnserve.conf

	Remove comments and don't leave space at the start of the lines:

       	auth-access=write
       	passwd-db=passwd

5. Start the service:

	# svnserve -d -r /svn/arocarchive

6. Go to your home directory and create a test file:
 
    	# cd 
    	# vi config.txt

Maybe type some text in the file. Save and exit.

7. Import the test file in to the repository:  

	# svn import config.txt svn://localhost/config.txt

You'll be placed in an editor where you can make a comment about the 
file being placed in the repository. At the top of the file add some
short comment, then save and exit from the file. Accept the default filename.

Next you'll need to enter in a root password, the username you defined and
the password for the user.

Finally, you may see a warning about storing unencrypted passwords. For now
say "yes" to the prompt to continue.

If it all works you should see something like:

	Sore password unencrypted (yes/no)? yes
	Adding		config.txt
	
	Committed revision 1.

8. List the repository:

	# svn list svn://localhost

You should just see the name of the file we have committed, or:

	config.txt

9. Create a local copy of the repository
       
	# cd /tmp
	# svn checkout svn://localhost
	# cd localhost

The default directory name is "localhost" in this case.

10. Edit and make changes to config.txt

	# vi config.txt

11. Commit the changes you just made in your local repository to the master SVN
    repository:

	# svn commit

	Again you'll have a change to add some comments. Do this save the file 
	and exit. 

	You should see:

	Committed revision 2.

	That's it. You are now using subversion in a local repository:

	/tmp/localhost

	In conjunction with the master repository:

	/svn/arocarchive

12. Run a few more svn commands on the local copy of the master repository

	As you are in /tmp/localhost if you type:

	# ls -lah

	you'll see a hidden directory ".svn" - This is what tells the svn
	command that there is a repository. So, if you type:

	# svn list

	You'll get back:

	config.txt

	Try running a few more svn commands:

	# svn log
	# svn info
	# svn help







