CS 242 Fall 2011 : Using Subversion From Eclipse

This page last changed on Aug 08, 2011 by conadmin.

Using Subversion From Eclipse

these instructions were based on an older version of eclipse, so they may be slightly out of date

also, this years SVN url is https://subversion.ews.illinois.edu/svn/sp11-cs242/netid not what is shown below

Installing the Subversive Eclipse Plugin

Once Eclipse launches, select Install New Software from the help menu.

Select “Galileo” from the drop down list of update sites, and once the list populates, expand the Collaboration group and check the box next to Subversive SVN Team Provider (Incubation)

Click next

Agree to the license (read it through if you really want to), then click finish

The install process will take a few minutes:

Once the install is completed, you will be presented with a dialog like the one below. Although you could click “Apply Changes”, the results are not guaranteed, so I always click Yes. When you do, Eclipse will exit and restart.

Once Eclipse restarts, you will be presented with a welcome page from Subversive. Feel free to read any of the links there, but it is completely safe to close that tab. Once you close it, you will be presented with a normal looking Eclipse workspace.

Installing the Subversion connectors

Once you have a project created, the first thing you should do is add it to subversion. This way, as you develop, you can have subversion track all the changes you make to your code. This provides a way to undo changes, track the history of files, and keep a record of exactly what you did.

To add a project to subversion, right click on the project, select team, then select share project.

The first dialog you will see will ask you what type of version control you would like to use. Most likely it will look exactly like the one below. Select SVN.

When you click on SVN for the first time, Eclipse will probably prompt you to install subversion connectors. These connectors enable Eclipse to actually use subversion (whereas the plugin you installed earlier was mainly the GUI on top of SVN). I usually select “SVN Kit 1.2.3” because then any projects tracked by Eclipse will also be able to be worked with using the command line svn client version 1.5 or higher. Once you check the box, click Finish.

Make sure both boxes are checked in the following dialog and then click next.

Click next.

Agree to the license (read it through if you wish), then click finish.

You will then be brought back to the window where you selected the type of version control to use. Don’t click anything yet. Notice in the lower right corner of Eclipse, an install is in progress. Wait until that install finishes, it only takes a minute or two.

If a security warning like the one below appears, click ok.

Again, click yes to restart Eclipse once the install finishes.

Using the Subversive plugin to add your work to Subversion and commit changes

Adding your work to Subversion for the first time

To actually add your files to Subversion, first right click on your project, select team, then select share project.

Select SVN then click next.

The first time you use SVN from Eclipse it will automatically prompt you for repository details like the dialog below. Fill it out the same as shown below, except substitute your netid in the repository URL and in the username field where I have mine (cemeyer2). The Subversion server that we use requires that you use your netid as the username and your Active Directory password as the password. You can have Eclipse save your password, but as it warns, the password is hard to access, but not impossible. I generally have Eclipse save my password since I am the only one that uses my machine, but if you share the computer that you are developing on with others, I would recommend not saving your password.

Once the dialog is filled out, click next.

By default, Eclipse will want to use the standard subversion repository layout (trunk, tags, branches). While this is great and is used by most people, for this course, we specify a specific location where your code must be in your repository. The image shown below shows how to fill out the dialog to add a project (Assignment1.1 in this example) to the correct location for CS242.

Once the dialog is filled out, click next.

The default commit comment is sufficient, so you can click Finish.

In the next dialog, enter a brief message to go into the Subversion log to remind you later of what action you did, then click ok.

Eclipse will now add your files to Subversion. Once they are successfully added, the revision number of each file will be shown to the right of its name in the package explorer as shown below. You should also now be able to open a web browser to the repository location (usually something like https://csil-projects.cs.uiuc.edu/svn/sp10/cs242/NETID/AssignmentX, replacing NETID with your netid and X with the number of the assignment, and view all your code.

Updating Subversion once you make changes to your work

Once you make changes to a file and save it, Eclipse will automatically notice that the file in your workspace is different than the file that is stored in your Subversion repository. It will automatically mark the modified files by inserting a “>” before the file name in the package explorer, as shown below.

To send the changes you made to the Subversion server (to commit them in svn-speak), right click on your project, select team, and select commit.

You will be presented with a dialog that asks you to write a commit message and select which files you would actually like to commit to the repository. Enter a reasonable message, select the files you wish to commit (it should automatically select all the files that have been modified since your last commit), then click ok.

Eclipse will now send the changes to the Subversion server. The files that you just committed should no longer have the “>” before their names in the package explorer. You can verify that the files were updated in your repository by opening the URL to your repository in a web browser.

20.png (image/png)

13.png (image/png)

12.png (image/png)

11.png (image/png)

14.png (image/png)

15.png (image/png)

8.png (image/png)

7.png (image/png)

6.png (image/png)

9.png (image/png)

10.png (image/png)

3.png (image/png)

2.png (image/png)

1.png (image/png)

4.png (image/png)

5.png (image/png)

23.png (image/png)

21.png (image/png)

22.png (image/png)

25.png (image/png)

24.png (image/png)

17.png (image/png)

18.png (image/png)

19.png (image/png)

16.png (image/png)
Document generated by Confluence on Feb 22, 2012 18:09

  1. No comments yet.

  1. No trackbacks yet.