Version Control Systems

A file server allows multiple users to access a centralized file system called a repository. The repository appears as a local drive or directory to each user. The file server prevents users from writing to the same repository file at the same time.

A version control system (VCS) is like a file server, except it also keeps track of the revision history of the repository. This makes it possible for users to track changes to the repository.

Revision History

A revision history can be viewed as a partially ordered collection of repositories. Each repository in the collection is called a revision. Revisions are identified by version numbers: r0, r1, r2, etc. Revision i is an ancestor of revision j in the partial ordering:

ri rj

if rj is created from ri by a series of modifications and copies.

Each time a user makes or commits a change to a file or directory in the repository, the VCS creates a cheap copy of the entire repository. (A cheap copy of a directory only copies the files and directories that have changed.)

It is also possible for a user to make a copy of the current repository. This copy may then undergo several revisions independent of the original. This is called a branch. The subsequent revision history of the original repository is called the trunk. Later the branch can be merged with the trunk:

Thus:

r0 r1 r3 r5 (the trunk)
r0 r1 r2 ≤ r4 ≤ r5 (a branch)

Note that this is a partial ordering because r3 and r4 are incomparable.

Version Control Clients and Servers

A VCS is the client-server application. The VC server manages repositories and users for multiple projects. Users access the VC server using a VC client. The VC client allows a user to copy files between the repository and a local directory. The files in the local directory are called working copies.

Copying a file or directory from the repository to a working directory is done using the checkout command. The copy in the working directory is called a working copy. The update command replaces the contents of the working directory with the latest versions from the repository. Copying files from the working directory back to the repository is done using the commit command.

The Readers and Writers Problem

The typical workflow for a programmer is:

What happens if two users are working on the same file? It's possible that their versions might get out of synch. There are two ways to solve this problem. The Lock-Modify-Unlock solution requires users to first lock a file before modifying it, then unlock the file afterwards. Only one user can lock a file at a time. The Copy-Modify-Merge solution requires users to modify a copy of the file. The modified file is then merged with the repository file, which may have been modified by another user.

Subversion

Subversion is a copy-modify-merge VC server. There are a number of Subversion clients. Some are plugins for NetBeans and Eclipse.

The first step is to download one of these clients:

            AnkhSVN - A Subversion addin for Microsoft Visual Studio .NET http://ankhsvn.tigris.org/

            CW Subversion - A VCS plugin for Metrowerks CodeWarrior http://www.soundgeek.org/software/SubversionPlugin/

            Eric3 - Python IDE with Subversion integration; written in PyQt, uses QScintilla editor widget http://www.die-offenbachs.de/detlev/eric3.html

            eSvn - cross-platform QT-based GUI frontend to Subversion http://esvn.umputun.com/

            JDeveloper - Oracle's free integrated development environment with end-to-end support for modeling, developing, debugging, optimizing, and deploying Java applications and Web services, now with a Subversion plugin. (Note that this is not an Open Source project.) http://www.oracle.com/technology/products/jdev/

            KDESvn - A Subversion client for KDE http://www.alwins-world.de/programs/kdesvn/

            KSvn - A Subversion client for KDE -- a plugin for Konqueror http://apps.intra-links.com/

            psvn.el - A Subversion interface for emacs http://xsteve.nit.at/prg/vc_svn/

            QSvn - A cross-platform GUI Subversion client http://ar.oszine.de/projects/qsvn/

            RapidSVN - A cross-platform GUI front-end for Subversion http://rapidsvn.tigris.org/

            RSVN - Python script which allows multiple repository-side operations in a single, atomic transaction. https://opensvn.csie.org/traccgi/rsvn/trac.cgi/wiki

            SmartSVN - A cross-platform GUI client for Subversion (Not open source. Available in a free and a commercial version.) http://www.smartsvn.com/

            Subclipse - A Subversion Eclipse Plugin http://subclipse.tigris.org/

            Subcommander - A cross-platform Subversion GUI client including a visual text merge tool. http://subcommander.tigris.org/

            SvnX - A Mac OS X Panther GUI client. http://www.lachoseinteractive.net/en/community/subversion/svnx/

            SVN SCC Proxy - A SCC add-in for SVN (Note that this is not an Open Source project.) http://www.pushok.com/soft_svn.php

            TMate - A Subversion tracking, reporting and browsing plugin for IntelliJ IDEA (This is a commercial closed-source product, but Open Source or Educational projects may apply for free licences.) http://tmatesoft.com

            TortoiseSVN - A Subversion client, implemented as a windows shell extension http://tortoisesvn.tigris.org/

            VisualSVN - Subversion integration for Visual Studio .NET 2003 & 2005 (This is a commercial closed-source product.) http://www.visualsvn.com

            WLW-SVN - WebLogic Workshop (8.1.3/8.1.4) Extension for Subversion https://wlw-svn.projects.dev2dev.bea.com/

            WorkBench - Cross platform software development GUI built on Subversion written in Python http://pysvn.tigris.org/

            ZigVersion - a Subversion Interface for Mac OS X. Aims to design an interface around the typical workflows of programmers. http://zigversion.com/

 

cvsdude

cvsdude operates a Subversion server for companies and universities. You can login to http://cvsdude.com using your assigned user name and password. You may change the password if you want.

Each CS160 team is a subversion user group. Each group is associated with a repository:

Crazy88              MVCWorkbench1
8 Drunken Masters    MVCWorkbench2
Deadly Viper Squad   MVCWorkbench3
Crazy88              MVCWorkbench4

You should be able to view your repository.

Create a directory on your computer. Create subdirectories corresponding to the packages you will create. Add some java files to these directories. If you have downloaded TortiseSVN, you should be able to right mouse click on the folder icon in Windows Explorer and select commit, update, or checkout. Use the following url:

https://svn4.cvsdude.com/sjsu_cs/MVCWorkbench*

where * is 1, 2, 3, or 4.

Here are a few screen shots:

Modify AAA.java

update