[wiki:WikiStart] > [wiki:Documentation Documentation] > [wiki:SVNRepository Using an SVN Repository] = Using An SVN Repository in Beaversource = [[PageOutline]] == Introduction == Subversion or "SVN" is a tool used to manage changes to text-based files like source code or documents. In terms of programming, SVN provides the means to store not only the current version of a piece of source code, but a record of all changes (and who made those changes) that have occurred to that source code. For this reason, SVN is particularly common on projects with multiple developers since SVN ensures that changes made by one developer are not accidentally removed when another developer makes a change to the Beaversource-hosted source. In order to access a Subversion repository, you must install a special piece of software called a Subversion client. Subversion clients are available for most any operating system, but we recommend '''TortoiseSVN''' for windows users. Tortoise SVN can be downloaded at [http://tortoisesvn.net/downloads]. TortoiseSVN is implemented as a Windows shell extension, which makes it integrate seamlessly into the Windows Explorer, since it's not integrated into a specific IDE, you can use it with whatever development tools you like. '''This SVN Repository map shows the relationship between the source file, which is hosted on Beaversource (HOST), and local copies checked out from the host to be edited, tested and then committed back to the host.''' [[BR]] [[BR]] [[Image(SVNRepositoryMap1.jpg, width=600px)]] [[BR]] == Downloading and Installing TortoiseSVN == '''TortoiseSVN runs on Windows 2000 (Service Pack 2) and Windows XP or higher.''' [[BR]] 1. Go to [http://tortoisesvn.net/downloads] [[BR]] 2. '''Click''' .msi file link under '''Download Application''' [[BR]] 3. Save the file to a directory on your computer. [[BR]] 4. Double click the downloaded .msi file and install it to a drive on your computer (C: drive is a good choice). '''If an error occurs in the intallation, this link may help''' [http://tortoisesvn.tigris.org/faq.html#installerror] == Using And Accessing An SVN Repository == This tutorial will show the use of an SVN repository during the writing of a short paragraph with sentence-level editing in a plain .txt document. '''Preconditions:''' * TortoiseSVN has been installed. * The source file is accessible (.txt). * You are a member of a project on Beaversource. === Checking A File Into The SVN Repository === '''Left-click on the image if the resolution is poor.''' ||1. Create a folder that will contain the source file. Name the folder. ||[[Image(S1.jpg)]]|| [[BR]] ||2. Right-click on the folder and select '''SVNCheckout'''. ||[[Image(S2.jpg)]]|| [[BR]] ||3. Enter your project's URL into your browser and then copy and paste the SVN repository URL listed on the page into the requested ''URL of repository'' field into the TortoiseSVN checkout menu. Click on the image to the right to enlarge it for a better view. The ''Checkout Depth'' refers to four operations: '''Fully recursive''': Checkout the entire tree, including all child folders and sub-folders. '''Immediate children, including folders''': Checkout the specified directory, including all files and child folders, but do not populate the child folders. '''Only file children''': Checkout the specified directory, including all files but do not checkout any child folders. '''Only this item''': Checkout the directory only. Do not populate it with files or child folders. ||[[Image(S3.jpg, width=600px)]]|| [[BR]] ||4. Drag/Paste the source file into the folder. ||[[Image(SVN1.jpg, width=500px)]]|| [[BR]] ||5. Right-click on the file and select '''TortoiseSVN''' > '''Add'''. ||[[Image(S4.jpg)]]|| [[BR]] ||6. Right-click within your folder '''SVN Commit'''. ||[[Image(S5.jpg)]]|| [[BR]] ||7. Write a brief note explaining the commit, make sure the file is ''checked'' and click '''OK'''. ||[[Image(S6.jpg)]]|| [[BR]] ||8. Authenticate the commit with your onid username and password. Check ''Save authentication'' and click '''OK'''. Beaversource provides secure SVN hosting. ||[[Image(S7.jpg)]]|| [[BR]] ||9. TortoiseSVN will display the actions of the commit and give you the revision # to reference back to the update. ||[[Image(S8.jpg)]]|| [[BR]] === Understanding Recorded SVN Changes === Beaversource tracks and records changes in an SVN Repository. They can be managed from your project's homepage. [[BR]] ||From your project's homepage, you can click '''History''' to access a timeline of committed changes to your project's SVN repository. ||[[Image(SVNA.jpg)]]|| [[BR]] ||From here you can see the commits for the last 30 days. Clicking '''Changeset [10] by kuechlej''' will provide detailed information about the commit made above. ||[[Image(SVNB.jpg)]]|| [[BR]] ||'''Changeset [10] by Kuechlej''' shows the changes made from the SVN commit from the previous tutorial. The color-coded file ''Jobless.txt'' was added. This page also shows the comments written when the commit was sent as well as a timestamp and author link. ||[[Image(SVNC.jpg)]]|| [[BR]] === Analyzing Changes To A Source File Through The SVN Repository === When a change is made to a local copy of a source file, the SVN repository needs to be updated. Commits should be made on a regualar basis to keep the repository file up-to-date. Since these changes are tracked, Beaversource can easily access that information and compare the differences based on changes per commit. ''SVN cannot show the differences between binary file types: jpeg, .doc, .png, etc.'' [[BR]] ||From your project homepage, click '''Browse Source'''. ||[[Image(SVN1A.jpg)]]|| [[BR]] ||As you can see from the image, Jobless.txt (checked in to the repository earlier in the tutorial) is listed with size, reference #, age and comments.||[[Image(SVN1B.jpg)]]|| [[BR]] ||After clicking the file, Beaversource presents the information in the text file listed by line. ||[[Image(SVN1C.jpg)]]|| [[BR]] [[BR]] Follow the the steps in the previous tutorial '''Checking A File Into The SVN Repository''' to edit your text file and commit a change to the SVN repository. [[BR]] [[BR]] ||Following the project homepage link '''History''', the new modified change can be seen. ||[[Image(SVN1D.jpg)]]|| [[BR]] ||When the local copy of the source file is edited and committed to the SVN repository, Beaversource will track the change and give a visual representation of the difference between the old and new version. Changeset [11] shows the modified local copy now committed to the source file in the SVN repository. ||[[Image(SVN1E.jpg, width=750px)]]||