We'll need a Subversion (SVN) client in order to work with the remote repository.
There are several types of clients which are freely available. We will use TortoiseSVN which is an SVN client implemented as a Microsoft Windows shell extension. Go to http://tortoisesvn.net/downloads , download and install the client application. At the time of this writing, the current version is 1.6.2.
All TortoiseSVN commands are invoked from the context menu of the windows explorer. They are visible when you right click on a file or folder. There are simply too many SVN features to include everything in this short tutorial, so we'll just go through the basics in order to get started. For a comprehensive tutorial, I recommend the following site http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/index.html .
The Burst Analyzer source files currently reside in the SourceForge SVN repository. These files are the same version that's posted on the DRBIO website. We will check out a working copy of the source files from the SVN repository. It includes library modules (DLL and LIB) and Visual Studio 2005 project files, so you will also get these additional files in the checkout.
- First, create a new local folder anywhere on your hard drive. It will not matter how you name the new folder. Using windows explorer, change directory into the new folder, right-click anywhere within the empty frame and select from the context menu the item labeled SVN Checkout... , as shown below.
- If you are trying to access the repository for the first time, an authentication dialog will appear. Use the username and password of your new SourceForge account. Once the authentication is successful, you should see a new checkout dialog box as shown below. Enter the following in the URL of repository text field: https://forge.cornell.edu/svn/repos/burstdev This is the location of the remote repository for the Burst Analysis program. Enter the name of a local directory in the Checkout directory text field. This will be the destination on your hard drive where a local working copy of the program's source files is placed. Use the location of the new folder which you just created.
- You should now see a complete set of all the files for the Burst Analysis program. This is your local working copy. The green "check" icons next to each of the files indicate your local files are normal and up-to-date with the remote repository files.
Committing changes to the repository. Sending the changes you made to your working copy is known as committing the changes. For demonstration purposes, I'll make a trivial modification to the file Burst.c and commit it to the repository. I'll simply re-order a couple of #include directives at the top of the file.
- After making the changes and saving the file, open the windows explorer and take a look at the files. The icon next to the file Burst.c should change after the modification. There should be a red exclamation. This indicates that the file is now out-of-sync with the version in the remote repository.
- To commit the changes to the repository, right-click on the file and select the menu item SVN Commit... as shown below.
- A new dialog box should appear. Enter a message as shown below. The entry represents the log message for this particular revision of the file.
- If the commit was successful, you should get a confirmation dialog like the one below.
- Now take a look at the windows explorer. You may have to refresh it. The icon next to the file Burst.c should revert to the green "check" mark. The changes have been committed to the remote repository and the copy of the file in the SVN repository is now in-sync with your local working copy.
Viewing differences. A common requirement in project development is to see what has changed, whether it's the difference between two separate files or the difference between two revisions of the same file.
- In the windows explorer, rick-click on the file Burst.c and select the menu item sequence TortoiseSVN->Diff with previous version as shown below.
- You should now see a new split window displaying the previous version of file Burst.c and the current version side by side, as shown below. If you recall, the changes made to the file was trivial. We simply re-ordered a couple of #include headers at the top of the file. The window highlights what changes were made and where it happened.
Adding a new file to the repository.
- For demonstration purposes, I'll create an empty text file labeled sample.txt. In the windows explorer, the new file should be tagged with a "question" mark icon. Right-click on the file and select from the context menu TortoiseSVN->Add... , as shown below.
- The icon next to the file will change to a "plus". Right-click on the file once again and select the menu item SVN Commit...
- The commit dialog box should appear. Enter the initial log message. Once it's done, the new file will be committed to the SVN repository. Refresh the windows explorer, and the icon next to the file sample.txt should be the green "check" indicating normal (in-sync) status.
Deleting a file from the repository. We now delete the file sample.txt from the repository.
- Right-click on the file and select from the context menu TortoiseSVN->Delete , as shown below.
- The file will disappear from the windows explorer. But we need to perform one last step. Right-click and select SVN Commit... once again. And add a final log entry message. This final commit will remove the file from the repository.
Make sure you have first read Create Access to SVN Repository.