2010-12-15

Using the SVN client RapidSVN

12/15/2010 11:57:00 AM Posted by Hoàng Dũng No comments
RapidSVN is a graphical SVN client available for many flavours of Linux, as well as Windows and Mac OS X. This tutorial will demonstrate setting up RapidSVN for Nengo development.

Installing RapidSVN

Ubuntu
If RapidSVN is not installed on your system, then open the Ubuntu Software Center (Applications > Ubuntu Software Center) and search for RapidSVN. Click on the right arrow, then Install to install it.

After installation, RapidSVN can be found in Applications > Programming.
Other operating systems
RapidSVN is also available for Windows and Mac OS X. Go here to download the installer for those platforms.
The screenshots in this article will be from Ubuntu, but the steps outlined will work the same regardless of what platform you’re using.

Checking out a repository

The following steps should be followed for each repository you want to interact with on your local machine. For typical Nengo development, this means both simulator and simulator-ui. Both are required to build Nengo with a graphical environment.
In RapidSVN, click on Repository > Checkout.

Fill in the URL with the URL on the SVN server. For Nengo, the two URLs you will need to add are:
http://ctnsrv.uwaterloo.ca/svn/bryan/simulator
http://ctnsrv.uwaterloo.ca/svn/bryan/simulator-ui
The destination directory is up to you. The default options for the rest should be fine, but ensure that “Add to Bookmarks” is checked.

The files from the repository will be downloaded to the directory that you chose earlier. A new bookmark will be added in RapidSVN; this bookmark offers an easy way to interact with the repository later on.

Downloading new updates from a repository

You’re not the only developer contributing to Nengo. When they change files in the repository, you will want to get those changes to ensure that any code that you contribute to the repository does not conflict with their changes.
To update your local copy of the repository, right-click on the bookmark you created above and select Update. Any files that have changed since the last time you performed an update will be downloaded.

If a file that you have been editing has been updated in the repository, you may be prompted to select an action. In most cases, merging the two files is the right choice, but to be safe, you may want to make a local copy of the file you were editing, to ensure that the merged file contains your changes.

Using a diff tool

A good way to visualize your changes remain is to use a diff tool. While Linux has the command line program “diff” built in, graphical tools exist and illustrate changes well. We’ll use the diff tool “meld”.
To install it, open Applications > Ubuntu Software Center and type “meld” into the search box. Click the right arrow, and then Install to install it.

Next, we’ll configure RapidSVN to use Meld for doing diffs. Click on View > Preferences.

Click on the Programs tab, and then the Diff Tool subtab. In the text box, enter /usr/bin/meld (unless you’ve installed meld to a different location). For program arguments, enter %1 %2.

Now, if you ever want to compare your local copy of a file to the copy in the repository, right-click on it in the right pane of RapidSVN and select Diff to Head.

Committing changes to a repository

Once you’ve made changes to Nengo, we encourage you to commit them to the repository so that all Nengo users can benefit from your work. However, caution must be exercised to ensure that the changes you make don’t break Nengo for other developers.
Before committing changes, you should first do an Update. Right-click on your bookmark and select Update. If you have an updated copy of Nengo, your Update should produce the following output in RapidSVN.

Once you’ve done an update and fixed any conflicts with merging files (testing your code afterwards), you’re ready to commit. Right-click on your bookmark and select Commit.

A window will come up with a list of the files you’ve changed. At the top, you are prompted to enter a log message; please do so, being as verbose as possible. If your update happens to break Nengo, the more you’ve entered in the log, the easier it will be for other developers to figure out what’s gone wrong.
Before doing the final commit, check the diff for each file to ensure that the changes you’re committing are what you think you’re committing.


If this is the first time you’re committing to the Nengo code base, or if you’re unsure of your implementation of a particular change, then ask a CNRG group member to review the file diffs.
When you’re ready to commit, click OK in the Commit window.

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.