Advanced Features of SVN


For help with basic operations regarding Eclipse and SVN, please see the following link: Eclipse and SVN help.

Rolling back local changes

There are times where you may want to "undo" changes that you have made to a file, but are unable to do so through the usual undo command. SVN and Eclipse allow you to replace a file with one from its history.

  1. Using Eclipse (Local history)

    1. Select the file that you want to replace, and select "Replace With->Local History...". Eclipse will now list the history of the file on your local machine. This should show up in the Compare view.
    2. Double click on an item and it will compare the current copy with the one you double clicked.
    3. To replace, click "Replace".
  2. Using SVN (Remote History) - Last revision

    1. Select the file that you want to replace, and select "Replace With->Latest from Repository..."
    2. Eclipse may ask you if you really want to do the replace. If you do, click "yes" and it will replace your local copy with the latest copy from your repository.
  3. Using SVN (Remote History) - Older revisions

    1. Select the file that you want to replace, and select "Replace With->Revision...". Eclipse will now list the history of the file on the SVN server. A window should appear in your editor with the file's history.
    2. Double click on an item and it will compare the current copy with the one you double clicked.
    3. Eclipse will not compare the files. There will be a series of 6 buttons in the editor. If you move your mouse over them it will tell you what each one does. From left to right they are copy all changes, copy the current change, and cycle through the next/previous difference/change.
    4. Save the file once you have copied all the changes that you want.

Comparing with previous versions

In Eclipse you can compare two files with each other by selecting them and right clicking and going to Compare With->Each other. You can also do this with previous versions of a file by following the same steps as rolling back changes with one main difference. When you right click on an item, instead of going to Replace With, goto Compare With. The options under there that you select are the same as before. Depending on which compare with you selected, a window will show up for you to compare files with each other.

Viewing your repository through your web browser

You can view your SVN repository through your web browser by using the same repository URL you use in Eclipse. From there you can view your latest revision, all your folders, and your files.