|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Announcements
Chapters
Services
Feature Zones
|
Note: This is an unedited contribution. If this article is inappropriate,
needs attention or copies someone else's work without reference then please
Report This Article
IntroductionSubversion is an open source application which is used to build version control system. This document will give a detailed idea about the installation and usage of subversion by using the tool TortoiseSVN. Install Subversion ClientTortoiseSVN is a very useful and very easy tool for doing all the subversion repository operations and is freely available. For installing TortoiseSVN, do the following steps.
Accessing the RepositoryRight click on the desktop and from the menu select TortoiseSVN->Repo Browser as shown in the figure In the coming screen type the url of the repository say [http://MyServerName/svn/MyRepos or svn://MyServerName/MyRepos] and clicks OK. It will display an authentication screen as shown below with provision to provide user id and password to login to repository. The subversion administrator will provide a user id and password for your repository access. Check save authentication for saving the user name and password and click on [OK]. Now the following screen will appear displaying the repository contents. Checking Out a Working CopyTo obtain a working copy you need to do a checkout from a repository. For checking out a project, right click on any folder inside the repo browser as shown. Or Select a directory in windows explorer where you want to place your working copy. Right click to pop up the context menu and select the command SVNCheckout... as shown below. Now it will bring another popup shown below. Provide the directory name and press OK. It will checkout (getting the latest version) the selected repository to the checkout directory.If you enter a folder name that does not yet exist, then a directory with that name is created. You should only check out into an empty directory. Icon OverlayOne of the most visible features of TortoiseSVN is the icon overlays which appear on files in your working copy. Icon Explaination
Sending Your Changes to the RepositorySending the changes you made to your working copy is known as committing the changes. But before you commit you have to make sure that your working copy is up to date. You can either use TortoiseSVN → Update directly. Or you can use TortoiseSVN → Check for Modifications first, to see which files have changed locally or on the server. If your working copy is up to date and there are no conflicts, you are ready to commit your changes. Select any file and/or folders you want to commit, then TortoiseSVN → Commit.... Now tortoiseSVN commit dialog will come. Clicking on OK will commit your changes to repository. Update Your Working Copy with Changes from OthersPeriodically, you should ensure that changes done by others get incorporated in your local working copy. The process of getting changes from the server to your local copy is known as updating. Updating may be done on single files, a set of selected files, or recursively on entire directory hierarchies. To update, select the files and/or directories you want, right click and select TortoiseSVN → Update in the explorer context menu. A window will pop up displaying the progress of the update as it runs. Changes done by others will be merged into your files, keeping any changes you may have done to the same files. The repository is not affected by an update. The progress dialog uses colour coding to highlight different update actions
New item added to your WC.
Redundant item deleted from your WC, or missing item replaced in your WC.
Changes from repository successfully merged with your local changes.
Changes from repository merged with local changes, resulting in conflicts which you need to resolve.
Unchanged item in your WC updated with newer version from the repository. Adding New Files and DirectoriesIf you created new files and/or directories during your development process then you need to add them to source control too. Select the file(be) and/or directory from your working directory and use TortoiseSVN → Add. Now it will bring a popup as shown below. Select the required file(be) and folder(be) and click on OK. After you added the files/directories to source control the file appears with an added icon overlay which means you first have to commit your working copy to make those files/directories available to other developers To add files from outside your working copy you can use the drag-and-drop handler: Another way to add the files and folder is by using the repo browser; you can directly drag and drop any item into the required location. But it will not update your working copy. You can use TortoiseSVN→SVN Update option to reflect the newly added items to the working copy. Adding New Files and DirectoriesDelete If you delete a file/directory using TSVN, the file is removed from your working copy and marked for deletion. The file'be parent folder shows a "deleted" icon overlay. You can always get the file back, if you call TortoiseSVN → Revert on the parent folder. Move If you want to move files inside a working copy, use the drag-and-drop handler again: 1) Select the files or directories you want to move 2) Right-drag them to the new location inside the working copy 3) Release the right mouse button 4) In the popup menu select Context Menu → SVN Move versioned files here After moving, renaming or deleting, use SVNCommit option to commit the changes to the repository. If a file is deleted via the explorer instead of using the TortoiseSVN context menu, the commit dialog shows those files and lets you remove them from version control too before the commit. However, if you update your working copy, Subversion will spot the missing file and replace it with the latest version from the repository. If you need to delete a version-controlled file, always use TortoiseSVN → Delete so that Subversion doesn't have to guess what you really want to do. If a folder is deleted via the explorer instead of using the TortoiseSVN context menu, your working copy will be broken and you will be unable to commit. If you update your working copy, Subversion will replace the missing folder with the latest version from the repository and you can then delete it the correct way using TortoiseSVN → Delete. You can directly delete any file or folder by using TortoiseSVN repo browser. Deny Multiple CheckoutBy default, the subversion provides a local copy to all the users and each user can do their modification. Now the problem is, if a user submits their modification after the submission of another user, the subversion will show a message showing out of date, and so we have to merge those changes to the previous version. That means subversion works best without locking, using the "Copy-Modify-Merge" methods. But the main problem is in the case of "unmergeable" files, for example, graphics files, if two people change the same file, merging is not possible, so one of them will lose their changes. For avoiding this problem, a method called "Locking" which allows only a single user can modify the repository item. This can be achieved by doing the following steps. Set the
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
NB: - For setting the svn:need-lock property for a folder, there is a small difference. I.e, the add property dialog will not display this property in the combo box. So we have to type the property into the editable combo box and check the apply property recursively (if required) for recursively apply the property. The property will not be displayed in the property editor of the folder that we applied, but it will list only for the individual subfiles. |
We cannot edit a file with the svn:needs-lock propery (files with grey checked icon).
A user cannot edit a file which has the property svn:needs-lock (The files become readonly). So for editing the document, right click on the readonly file and select TortoiseSVN → Get lock and commit the changes to the repository.
Now the locked user gets the privilege to modify the file and submit his changes to the repository. All other users cannot edit the file and submit it to the repository (like VSS).
For this purpose, rightclick on the directory in the working folder and select the property add editor.
Select the tsvn:logminimize property and set the minimum required length to our required size say 25 and commit the changes to the repository.
Now each user can commit their changes to this particular directory only after entering comments with minimum 25 charectors length, because the [OK] button will be enabled only after entering a comment with the specified length.
In the above section, we set the minimum comment length and make the comment mandatory. But a user cannot know how much lenth the comment required to enter and for this purpose we can mark the width of the comment.
Take the add properties editor and select the property tsvn:logwidthmarker as shown and set the value same as the log width.
Commit your changes to the repository. Now in all the commit operation in the directory, the commit dialog will mark the width as shown below.
It is very common in Software Development for changes to be related to a specific bug or issue ID. Users of bug tracking systems (issue trackers) would like to associate the changes they make in Subversion with a specific ID in their issue tracker. This type of associativity is mainly required in the case of code file, in which for each bug fix, we can commit the URL of the bug system also to the subversion.
TortoiseSVN can help the user in two ways:
For integrating TortoiseSVN with bug tracking system, do the following.
Identify the URL
Normally a URL for a bug tracking system has an id part. For example consider the URL http://tortoisesvn.tigris.org/issues/show_bug.cgi?id=12534
Here we can change the id to a TortoiseSVN internal variable %BUGID%. So the final URL takes the form
http://tortoisesvn.tigris.org/issues/show_bug.cgi?id=%BUGID%.
Apply the URL
For applying the URL to the subversion working folder, rightclick on a particular working folder, select properties and invoke property add dialog.

Select the bugtraq:url property and enter the above preapared URL as value of the property. Click on [OK] and again add another property bugtraq:message and set the same URL as value and click on [OK].
Now the property list dialog should be looking as shown below.

Commit your changes to repository and your integration with bugtracking system is almost completed.
Integartion in action
For each commit operation in subversion, you will get the commit dialog box with a bug-id/Issue-Nr edit box as shown below.

If you have an issue id for the commit, then enter the bug id only in the edit box (else keep it blank) and enter the comments in the message and press [OK].
If you put an issue id say 12324 and comment say This is a bug message., and while taking TortoiseSVN Show Log, the dialog will be displayed as shown below. On clicking the link in the description, it will automatically open the bug tracking system and direct to the mentioned bug. If you did not put any id, then there should not be any URL in the description.

Changing the bug number label
For changing the label of the bug-id/Issue-Nr edit box in the Commit dialog, select the property bugtraq:label and enter the display text and commit your changes to repository.

The resulting dialog should look like shown below.

For displaying a warning message box for the blank bug id input (by default no message), you can set the property bugtraq:warnifnoissue to yes as shown below.

Now it will show a message as shown below on committing your changes.

This article will give a basic idea about the usage of Subversion with the help of a subversion client tool named TortoiseSVN. For getting a detailed idea about TortoiseSVN and all its features and settings, refer the TortoiseSVN user manual. For finding the TortoiseSVN FAQ, visit http://tortoisesvn.net/faq.

| You must Sign In to use this message board. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 27 Jun 2008 Editor: Sean Ewington |
Copyright 2007 by Prathapachandran.v Everything else Copyright © CodeProject, 1999-2008 Web17 | Advertise on the Code Project |