Difference between revisions of "Public Subversion"

From CSEE Documentation
 
Line 1: Line 1:
CS systems have the Subversion versioning system (similar to CVS) installed on them in <tt>/usr/bin/svn</tt>.  Private SVN repositories are creatable by means described in [http://svnbook.red-bean.com/ the SVN book], but a method is also provided to create repositories that are publicly accessible over HTTP.
+
Subversion (SVN) provides a convenient means of collaboration for groups of developers, as well as version control, branching and merging, and a number of other excellent features.
  
To share a repository in this way, first create it in a directory of your choosing.
+
We now support automatically creating public svn repositories on a CSEE system (svn.cs.umbc.edu). Users may create, share, and manage permissions on their own repositories from within the my.cs web interface. To begin, log into my.cs and select "Subversion" from the left.
willm1@linuxserver1:~$ mkdir svn
 
willm1@linuxserver1:~$ cd svn
 
willm1@linuxserver1:~/svn$ svnadmin create myrepo
 
This will create a directory <tt>myrepo/</tt>, and contents in that directory.  This is a fully functional SVN repository:
 
willm1@linuxserver1:~/svn$ svn checkout file:///home/csee1/willm1/svn/myrepo ~/myrepo
 
Checked out revision 0.
 
willm1@linuxserver1:~/svn$ cd ~/myrepo
 
willm1@linuxserver1:~/myrepo$ echo 'Hello, World!' > greeting
 
willm1@linuxserver1:~/myrepo$ svn add greeting
 
A        greeting
 
willm1@linuxserver1:~/myrepo$ svn commit --message "Add a friendly greeting"
 
Adding        greeting
 
Transmitting file data .
 
Committed revision 1.
 
However, this is not yet accessible over the web; even if you put the repository in your web directory, browsing to this directory over HTTP will show the file contents of the SVN repository (<tt>README.txt</tt>, <tt>conf/</tt>, etc.), rather than the SVN contents. To make this happen, the web server needs to be informed that the <tt>myrepo</tt> directory contains SVN information, and SVN should be used to determine what is actually shown over the web. There is a web interface at [http://my.cs.umbc.edu my.cs.umbc.edu] that can be used to accomplish this.  Go there, and log in using your UMBC username and password as normal.  Under "CSEE Account", click on "Subversion". You should see a menu like this:
 
[[Image:svn-repo.png]]
 
  
In the box on the left, fill in the name that will be visible over HTTP. For example, <tt>myrepo</tt> would be a good choice for this repository, but if something more descriptive applies to your code you may choose whatever you like. In the box on the right, fill in the path to your repository, excluding the part which is your home directory.  For example, the full path to the repository I created is <tt>/home/csee1/willm1/svn/myrepo</tt>, and my home directory is <tt>/home/csee1/willm1</tt>, so I would enter <tt>svn/myrepo</tt> in the box.  Finally, click "Add" to make the changes take effect.  Your repository will be exposed immediately, and the interface will look like this:
+
You will be presented with two lists: The top one is the list of repositories that you own, and the bottom the list of user groups. To create a repository, click "Create Repository". Give it a unique name. All other fields are optional. The path is the location above ~/svn in your home directory, generally this should be left blank. If you are part of a research group and would like the repository in your lab's storage, please file a ticket with us for information of how to do that.  
[[Image:svn-repo-created.png]]
 
  
You can click on the link under "URL" to take you directly to the repository. Congratulations, your repository is completely set up!
+
Read Only Names are the users that are allowed to fetch the repository, but not add or commit to it. Read Write are people you would like to share full access with. The groups are the names of groups you have created on the previous page, so that you may more easily control access for larger numbers of people, i.e. a class of students or a group of TAs. You may leave any of these blank, and you will automatically be given read/write access to all repositories that you own. Submit to finish.
  
If you are using the directory-listing feature of Apache to generate an <tt>index.html</tt> file for your CS account webpage, do not create a directory with the same name as the name you gave your repository, so that the repository shows up in that list.  This will prevent others from checking out your repository properly using an svn client. It will still be accessible over the web, but error messages like the following will be generated:
+
When you return to the first page, you should see that the status of your new repository is "Initializing". This should only take a second, select "Subversion" on the left to refresh the page. (Refreshing may attempt to create a new repository, which will be blocked due to an identical name) Once your repository is "Online" the url will be populated, and you are now able to use the repository. To view it in your browser, simply copy the url given into the address bar, and you will be given a navigable page of your current source. To check out on the command line, use:
  willm1@chasca:/tmp$ svn checkout http://www.csee.umbc.edu/~willm1/myrepo/
+
  svn co https://svn.cs.umbc.edu/<rest of url>
svn: PROPFIND request failed on '/~willm1/myrepo'
 
svn: PROPFIND of '/~willm1/myrepo': 301 Moved Permanently (http://www.csee.umbc.edu)
 
It is recommended, instead, to create an HTML page that lists the things available on your web site.
 
  
==Debugging==
+
This will create a directory of the same name as your repository. For more information on using svn, please see:
You may need to make sure that this directory is readable by the webserver. The web server currently runs with group id 48 (apache), so if you don't wish to give "o+rx" permissions on this directory you may use
+
http://svnbook.red-bean.com/
chgrp -R apache ~/svn
+
 
chmod -R g+rx ~/svn
+
If you have a large number of users, I suggest using groups to help manage them. To do so, on the main subversion site, select "Create Group". Supply a group name and the usernames of the people in the group, separated by spaces. When creating and editing repositories, you can add these groups as read only or read write, and all of the users in them will receive the same rights.
Otherwise, a simpler set of permissions can be given:
+
 
chmod -R o+rx ~/svn
+
Our system will also support modifying permissions of subdirectories within your repository. In order to do so, click the name of the repository on the main page, then create an entry for each subdirectory you want to control. Note that this page will not be automatically populated as you edit your repository. You may also add directories below directories by clicking "Add Subdirectory".
Depending on your configuration, this step may not be necessary. If you run into a problem with this and are unable to make your repository visible, please submit a ticket detailing the problem via the [http://my.cs.umbc.edu my.cs.umbc.edu interface].
+
 
 +
This system has only just been rolled out, so a few issues may be present. If you encounter any difficulty, please submit a ticket with the CSEE systems group at my.cs. Thanks!

Latest revision as of 15:57, 29 May 2013

Subversion (SVN) provides a convenient means of collaboration for groups of developers, as well as version control, branching and merging, and a number of other excellent features.

We now support automatically creating public svn repositories on a CSEE system (svn.cs.umbc.edu). Users may create, share, and manage permissions on their own repositories from within the my.cs web interface. To begin, log into my.cs and select "Subversion" from the left.

You will be presented with two lists: The top one is the list of repositories that you own, and the bottom the list of user groups. To create a repository, click "Create Repository". Give it a unique name. All other fields are optional. The path is the location above ~/svn in your home directory, generally this should be left blank. If you are part of a research group and would like the repository in your lab's storage, please file a ticket with us for information of how to do that.

Read Only Names are the users that are allowed to fetch the repository, but not add or commit to it. Read Write are people you would like to share full access with. The groups are the names of groups you have created on the previous page, so that you may more easily control access for larger numbers of people, i.e. a class of students or a group of TAs. You may leave any of these blank, and you will automatically be given read/write access to all repositories that you own. Submit to finish.

When you return to the first page, you should see that the status of your new repository is "Initializing". This should only take a second, select "Subversion" on the left to refresh the page. (Refreshing may attempt to create a new repository, which will be blocked due to an identical name) Once your repository is "Online" the url will be populated, and you are now able to use the repository. To view it in your browser, simply copy the url given into the address bar, and you will be given a navigable page of your current source. To check out on the command line, use:

svn co https://svn.cs.umbc.edu/<rest of url>

This will create a directory of the same name as your repository. For more information on using svn, please see: http://svnbook.red-bean.com/

If you have a large number of users, I suggest using groups to help manage them. To do so, on the main subversion site, select "Create Group". Supply a group name and the usernames of the people in the group, separated by spaces. When creating and editing repositories, you can add these groups as read only or read write, and all of the users in them will receive the same rights.

Our system will also support modifying permissions of subdirectories within your repository. In order to do so, click the name of the repository on the main page, then create an entry for each subdirectory you want to control. Note that this page will not be automatically populated as you edit your repository. You may also add directories below directories by clicking "Add Subdirectory".

This system has only just been rolled out, so a few issues may be present. If you encounter any difficulty, please submit a ticket with the CSEE systems group at my.cs. Thanks!