1. Where to download AnkhSVN
  2. How to Install AnkhSVN
  3. How to use AnkhSVN

For more information on Subversion in general, refer to the Subversion book.

You will also want to take a look at the document entitled "Using Subversion in the .NET Environment"

Where to download

Click here to download the (AnkhSVN.0.6.0.2461) version


How to Install AnkhSVN

Once you have downloaded the AnkhSVN client, you need to install this client on your system. Here are the steps to install this client:

Step 1:

Locate the path where you have downloaded AnkhSVN installer for example, C:\Program Files\AnkhSetup-0.6.0.2439-snapshot_32. Double click the file
AnkhSetup-0.6.0.2439-snapshot_32 to start the installation


Step 2:

The first dialogue of your installer will display a welcome message. This dialogue will give some help tips to continue with the installation. Throughout the installation process, to continue to the next dialogue, click 'Next' button and to abort the installation process click 'Cancel' button





Step 3:

The next dialogue of your installer will require you to accept the License Agreement of AnkhSVN. Read the license agreement and select the 'I Agree' option and click 'Next'.
The installation cannot proceed if you select 'I Do Not Agree' option





Step 4:

Enter the path in which you wish to install the AnkhSVN plugin. In the 'Install AnkhSvn for yourself or for all users that share this computer:', option choose the suitable option:





Step 5:

The installation begins here. If you wish to abort the installation, click <Cancel> button





Step 6:

Once the installation completes successfully, the last installer dialogue will be displayed with a success message. Click the <Finish> button to complete the installation process





How to use AnkhSVN

Let us now learn to execute some basic Subversion commands using AnkhSVN. This set of instructions is for VS.NET Professional Edition only. The steps may differ for VS.NET Team Edition

AnkhSVN is a Visual Studio .NET addin for the Subversion version control system. It allows you to perform the most common version control operations directly from inside the VS.NET IDE

General

Once you have successfully installed AnkhSVN you would find it as one of the menu options on Visual Studio.Net main window.

You would also find the AnkhSVN commands in the right click pop up menu in the solutions explorer window of Visual Studio.NET.





Add a Solution to your Subversion repository

Now that you have AnkhSVN installed, you can now version control your VS.NET Content in a Subversion repository. To start saving your content in Subversion, make sure to have created your subversion repository. Lets say for example, the repository we have created has the URL https://foobar.collabnetdemo.net/. Let us now add the solution to the Subversion repository

  1. Right click on the solution
  2. Click on 'AnkhSVN' option in the right click pop up menu
  3. Select the 'Add solution to Subversion repository...' option

  4. To add the solution to the directory 'src' of your Subversion repository, enter the complete path to this directory i.e https://foobar.collabnetdemo.net/svn/foobar/trunk/src/ in the 'Add solution to repository' window.

    You can also add the solution to a new subdirectory by clicking the 'Create subdirectory' checkbox. You can give a name to the subdirectory and a log message.

  5. Click the 'OK' button
  6. A progress bar will be displayed while the solution is being addded to the subversion repository

  7. If your subversion repository uses cetificates, a window authenticating it will be displayed. Click 'Accept' button. You can check the 'Store credentials?' check box to ensure that the certificate check is not performed everytime.

  8. Enter the username and password to the Subversion repository in the 'Authenticate' dialogue. You can check the 'Store credentials' check box to save the username and password entered here.
  9. After authenticating the user, the 'Commit' window must be displayed. You can enter a log message of your choice in the text box and click 'Commit'

  10. A success message 'Committing added files' must be displayed in the output window. You will also find a tick mark against your solution file in the Visual Studio.NET window once the changes are committed.

Adding more items

Once the solution has been added to the Subversion repository, any item added to the solution is automatically queued for being added to the Subversion repository. The item needs to be committed to get added to the Subversion repository

  1. Add a new item to the solution, say a text file namely foobar1.txt
  2. Right click on the newly added item, foobar1.txt
  3. Click on 'AnkhSVN'
  4. Click on 'Add' sub menu

  5. In the 'Select items to add' window, put a check mark against all items to be added. In this case we have only 'foobar1.txt' file. Click 'OK'

  6. Once the item has been queued for addition, right click on the item and select 'Commit'

  7. In the commit window, enter a log message, click 'Commit'

The item will now be committed to the Subversion repository. Look for a check mark against the item to confirm that the item was committed to the Subversion repository.

Modify the items

To modify the items:

  1. Open the item say foobar1.txt
  2. Modify and save the file
  3. There must be an 'M' symbol displayed against the file which indicates that the file has been modified
  4. Right click on the filename, click 'Commit'

  5. In the commit window, enter a log message, click 'Commit'

The changes must now be sent to the Subversion repository. The item as well as parent solution must now have a check symbol against their names. The success message must also be present in the output window

Update

To update the items:

  1. Right click on the filename, click 'Update'.
  2. In the update window, check all the items that you wish to update. In this case we have foobar1.txt alone. Select it and click 'OK'
    When you update a folder, you can check the 'Recursive' check box to update the subfolders and files inside the folder.

Revert to revision

To revert to an old version of a document:

  1. Right click on the filename, click 'Revert to Revision' under 'AnkhSVN' menu

  2. Enter the revision of the document you wish to revert to in the 'Choose the revision you want to rever to' text box in 'Reverse Merge' window

  3. Click 'OK'
  4. In the 'Microsoft Development Environment' window, click 'Yes' if you wish the modified document to be opened

The modified document will get opened

Revert

To revert changes made to a document:

  1. Right click on the filename, click 'Revert' under 'AnkhSVN' menu

  2. Select all the files of which you wish to revert the changes in the 'Select items to revert' window

  3. Click 'OK'
  4. Click 'OK'
  5. In the 'Microsoft Development Environment' window, click 'Yes' if you wish the modified document to be opened

Retreiving the log messages

If you wish to view the log messages entered by users while committing changes to this file, do the following

  1. Right click on the filename, click 'Log' sub menu from the 'AnkhSVN' menu

  2. Enter the range of revisions in which you wish to view the log messages in the 'Revision Start' and 'Revision End' text fields of the 'Log' window

  3. Click 'OK'
  4. The 'Retreiving log' window will be displayed while the log messages are being fetched
  5. Check the 'Log' tab to view the log messages

Lock

If you wish to prevent the item you are working on to be edited by other users, you can place a lock on the file. This will ensure that you are the only user able to edit the file. This reserves a right for you to commit the file first

  1. Right click on the filename, click 'Lock' sub menu from the 'AnkhSVN' menu

  2. Enter a lock message

  3. Click 'OK'
  4. The 'Locking files' window will be displayed while the file is being locked
  5. After the file is locked, you'd find a lock symbol next to your file

Unlock

To release the lock obtained on a file, you must unlock it. This will make it possible for the other users to be able to edit the file.

  1. Right click on the filename, click 'Unlock' sub menu from the 'AnkhSVN' menu

  2. In the 'Unlock files' window, click 'OK'
  3. The 'Unlocking files' window will be displayed while the file is being unlocked
  4. After the file is unlocked, the lock symbol will be removed

Blame

If you wish to know the changes a file went through in the various revisions, you can use the blame option. This will list the users who changed the item.

  1. Right click on the filename, click 'Blame' sub menu from the 'AnkhSVN' menu

  2. In the 'Blame' window, enter the revision range in which you wish to know the changes. Use the 'Revision Start' and 'Revision End' text fields to enter the revision range

  3. Click 'OK'
  4. The 'Figuring out who to blame' window will be displayed while the information is being retrieved
  5. You will find the information about the changes the file went through in the 'Blame' tab

Clean Up

Sometimes a repository gets locked due to some incomplete commits

  1. Right click on the main solution, click 'Clean up' sub menu from the 'AnkhSVN' menu

    >

  2. After a successful clean up, the success message will be displayed in the 'AnkhSVN' window

Relocate

This command is very rarely used. If your repository URL changes, you need create your repository all over again. You can use the relocate command to make your repository point to the new URL

  1. Right click on the main solution, click 'Clean up' sub menu from the 'AnkhSVN' menu

  2. Enter the old repository URL and the new repository URL in the 'From' and 'To' text boxes respectively

  3. Your repository will not point to the new URL

Resolving a conflict

Conflicts occur when two or more developers change the same few lines of a file. In such cases, AnkhSVN fails to merge changes automatically. The changes must be merged by the users manually

  1. If you find an exclamation symbol next to your file name, this means there's a conflict that has taken place

  2. Look in the directory where you have saved your project, you will find three new hidden files namely filename.ext.mine , filename.ext.rOLDREV and filename.ext.rNEWREV
  3. Right click on the file and select 'Resolve conflicted file...'

  4. The four files (Conflicted file and the three new files) will be displayed as options. Choose the file that you want to make as the final version

    • filename.ext: This will have the conflicts in it. After choosing it you will have to correct the conflicts manually. Merge the changes by deleting the unwanted text
    • filename.ext.mine: File that existed in your working copy before doing 'Update'. It will contain your latest changes. However, the changes done by other developers will be lost
    • filename.ext.rOLDREV: File as it existed before you made your changes. If you choose this the changes done by you and other developers will be lost
    • filename.ext.rNEWREV: File that SVN client received from the repository. This corresponds to the HEAD revision of the repository. If you choose this option, your changes will be lost
  5. Choose the option which suites you best and click 'Resolve'.
  6. If you had chosen one of filename.ext.mine, filename.ext.rOLDREV or filename.ext.rNEWREV, the system will prompt you to reload the file with modified contents, click 'Yes'
  7. After the conflicts a resolved, the file will be displayed in modified state. and the additional files will be deleted
  8. Commit the file to save the changes permanently

Repository Explorer

If you wish to view the hierarchy of the repository:

  1. Click on 'Tools' option in the main menu and select 'Repository Explorer' option under 'AnkhSVN'

  2. Click on the 'Repository Add' button in the 'Repository Explorer' window

  3. In the 'Add respository URL' window, enter the URL of the Subversion respository of which you wish to view the hierarchy and click 'OK'

  4. The URL will get added to the repository URL list. Expand each of the directories by clicking the '+' symbol. Each time a directory is expanded, the 'Retreiving directory info' window will be displayed

Commit log dialog

To view the commit log dialog:

  1. Click on 'Tools' option in the main menu and select 'Show the commit log dialog' option under 'AnkhSVN'

  2. The commit log dialogue window will be displayed

Send suggestion error report

If you wish to alert the AnkhSVN team regarding any error, you can use the 'Error report' option

  1. Click on 'Tools' option in the main menu and select 'Send suggestion error report' option under 'AnkhSVN'

  2. The 'Compose new' mail window of your email client will open and the mail will be addressed to: error@ankhsvn.tigris.org with the subject 'Exception'. The version of AnkhSVN will automatically be filled up

Switch

If you wish to switch between branches, use the 'Switch' option

  1. Right click on the filename, click 'Switch' sub menu from the 'AnkhSVN' menu

  2. Enter the URL of the branch you wish to switch to in the 'Switch to' field

  3. Click 'OK'
  4. The 'Switching' window will be displayed while the branch is being switched

Exporting a Subversion repository to local directory

If you wish to export a Subversion repository to your local directory you can do the following:

  1. Click on the 'Tools' menu and choose 'Export a repository or a local directory' from 'AnkhSVN' submenu

  2. In the 'Export' window, select whether you wish to export from a Local directory (SUbversion working copy) or a URL (Subversion repository)

  3. Select the 'Export from URL' or 'Export from local directory' radio button
  4. If you chose 'Export from URL' option, enter the Subversion repository URL in the 'URL' field. If you chose the 'Export from local directory', enter the Subverion working copy path in the 'Local directory' field. Note that this field label will change automatically as you pick your option
  5. The 'Exporting' window will be displayed while the project contents are being exported

Checking out a Subversion repository contents

If you wish to checkout a Subversion repository to your local directory you can do the following:

  1. Click on the 'Tools' menu and choose 'Checkout a repository directory' from 'AnkhSVN' submenu

  2. In the 'Export' window, enter the Subversion repository URL in the URL field
  3. Select a local directory path in which the repository contents will be checkedout in the 'Local Directory' field and click 'OK'

  4. The 'Checking out' window will be displayed while the project contents are being checked out

Edit the AnkhSVN config file

If you wish to edit the AnkhSVN config file you can do the following:

  1. Click on the 'Tools' menu and choose 'Edit AnkhSVN config file' from 'AnkhSVN' submenu

     

  2. The configuration file 'ankhsvn.xml' will open up which you can modify to set your configurations

Disable Ankhsvn for a solution

If you wish to disable AnkhSVN for a solution, you can do so by choosing the 'Disable AnkhSVN option'

  1. Right click on the solution, click 'Disable AnkhSVN for this solution' sub menu from the 'AnkhSVN' menu

posted on 2007-12-11 20:22  shawnliu  阅读(2757)  评论(2编辑  收藏  举报