Using Subversion
Version Control Software Concepts
Version control software is used by teams of professional programmers
for centralized storage of source code, simplification of team
development, keeping track of changes, etc.
Subversion is a particular version control system. In this
course Subversion is used for lab assignment submission and grading.
Subversion stores the projects in a
centralized repository. From this repository the projects can
be checked out, i.e. copied to local machine. Then,
modifications can be made locally. After modifying the project, it can
be committed, i.e. put back in the subversion repository. Once
in the repository, the project files can be viewed on the web. This is
a common way of verifying that the assignment submission was
successful. The repository contents is referred to using URLs
similar to web-pages.
Using Subversion in Eclipse
Subclipse is an extension of Eclipse that allows it to interact with
Subversion. It comes with its own Team Synchronization
perspective. However, most of the functionality is accessible from the
standard C/C++ CDT perspective.
Adding a Project to Subversion Repository
Before further subversion manipulations can be made with a project, it
needs to be added to the subversion repository. To add a project to
the repository:
- Right click on your project in the Project Explorer view;
- Select Team --> Share Project...
- Select SVN repository type, click Next
- If this is the first time you are connecting to subversion, select
Create a new repository location, otherwise select the
location from the list, click Next
- Type for the url location:
http://classes.cs.kent.edu/courses/cs23021/svn/SECTION/USERNAME/
Replace SECTION and USERNAME with your (three digit)
lab section and your username (CS Dept. login name).
Click Next
- Select Use project name as folder name, Click Next
- Enter a comment that describes what you have done. For example, "Adding Lab01_FirstProgram to the repository.". Click Finish
- In the dialog box, enter your CS department username and password. Note
that you might have to enter name/password multiple times. Do
not select "save password" option as Eclipse will save it and
it will be available for other users after you leave.
Note that Console view shows information about adding the
project to the repository. Your project has now been added to the
subversion repository. Now, if you right click on your project in
the Project Explorer or C/C++ Projects view and
select Team you will see a submenu that allows you to
manipulate the project in the repository.
Committing to Repository
As you make changes to the local copy of your project, they are not
stored in the subversion repository. To save it in repository, for
example, to submit for grading, you need to commit the changes
to the repository. To perform a commit in Eclipse:
Right click on your project in the Project Explorer view;
Click Team --> Commit...
Enter a comment that describes what you have done.
Click OK
in the dialog box, enter your CS department username and password
Your changes made in Eclipse have now been sent to the
repository. To verify your submission, enter the URL of the repository
in a web-browser and confirm that your changes have been saved.
After you are done working with Eclipse, remove the project from the
local computer:
- Right click on your project in the Project Explorer view;
- Select Delete
- Mark Delete project contents on disk in the dialog box that appears, click OK
Checking a Project Out
As you work on your project on various computers, a new computer may
not have a local copy of your project, you need to check out
the project from the repository, i.e, download it to the local
computer. To check out your project in Eclipse:
- Right click in the white space of the Project Explorer view
- Click New --> Other...
- Expand SVN in the list
- Select Checkout Projects from SVN, click Next
- Select Create a new repository location, click Next
Enter the url of the location of the project you want to check out:
http://classes.cs.kent.edu/courses/cs23021/svn/SECTION/USERNAME/
Replace SECTION and USERNAME
Click Next
- Enter your CS dept. login name and password in the appearing dialog box.
- select the project you want to check out from the project list
You should see the checked out project in the Project Explorer
view. Remember to commit any changes you make to the project back to the repository.
Updating in Eclipse
Sometimes the project in the repository is newer than the one on the
local machine. Update copies newer files from the repository
to local machine. To perform an update in Eclipse:
Right click on your project in the Project Explorer view;
Click Team --> Update...;
A window will appear, enter your CS dept. username and password.