1. Subversion (SVN) Tutorial Version control with Subversion & its Administration how to set it up, use it, and save your sanity how to set it up, use it, and save your sanity By Gopinath Karangula E-mail : gopinathkarangula@gmail.com
30. SVN Administration : Trunk : Updated and major code of the project Tag : Showcase of Release versions and ready to pack Branches : Contain Total source code, which was divided and distributed to the workforce, where a source code commits happens on the branches for development and merged to test branch to bug fix, and add patches to stabilize the code ( Quality analysis), merged to release branch and deployed to production safely.
31. Project Repository Creation using Visual Svn server : Using Visual SVN Server : we can perform: 1. Fresh creation of Repository with default structure of the Project 2. Creation of the Project Folder with out default Project structure. 3.User management and manging the privileges on branches, trees and tags. 4. Hook scripts management – post-commit scripts for E-mail notification to the testing team Precommit hook – To block the developers with empty log message commits, using command line also we can manage the repository by installing the subversion package, but for easy administration we use this visual svn server.
32. SVN Repository Backup: Backs up are available of three types in svn : 1. svndump : Dumping ( taking backup of the entire repository). 2. Hotbackup : It is a kind of backup where the entire project repository can be imported in very less time compared to the restroing the repository from svn dump. 3. Incremental Backup : Taking a range of versions backup
33. Commands to take the Project Repository Backup: Commands : 1. Svn dump : Entire repository : 1. c:/ProgramFiles/Visualsvn/bin/svnadmin dump C:/Repository/Repo_name > [Target Folder].dump 2. Svn Hot-copy : c:/ProgramFiles/Visualsvn/bin/svnadmin hot copy C:/Repository/Repo_name [Target Folder].dump
34. SVN Repository Backup: 3. Incremental Backup : c:/ProgramFiles/Visualsvn/bin/svnadmin dump -r:15:30 C:/Repository/Repo_name > [Target Folder].dump Here 15 indicated the starting version and 30 indicates the end version.
35. SVN Repository Backup: Backs up are available of two types in svn : 1. svndump : Dumping ( taking backup of the entire repository). 2. Hot backup : It is a kind of backup where the entire project repository can be imported in very less time compared to the restoring the repository from svn dump.
36. SVN Repository Restore: Commands : 1. Svn load : Entire repository : 1. c:/ProgramFiles/Visualsvn/bin/svnadmin load C:/Repositories/repositoryname < repobackup.dump This command leads to restore of the entire repository. 2. The second way of restoring the hot copy backup dump file : Open the visual svn server and create a repository folder and select the import tab and browse to the location where the dump file located and press ok, the hot copy backup repository wil be restored.
37. Hook Scripts to manage the Project repositories : What is Hook: Hook is a group of policies for a effective management of the project repository. There are serveral Hooks scripts available in the subversion ( SVN) 1. Pre-Commit Hook ( Check the policy before the commit happen to the repository) Eg: Empty log messages can be blocked using this pre commit hook 2. Post Commit Hook ( Check the policy after the happen to the repository) Eg: Email notifications to each commit to testing team for quality analysis.
38. Hook Scripts : Pre Commit Hook to block the Empty Log Messages : "C:rogram FilesisualSVN Serverinvnlook.exe" log -t %2 %1 | FindStr [a-zA-Z0-9] IF %ERRORLEVEL% EQU 0 GOTO OK echo "Commit Comments are Required, Dear developer please give the task details in detail for this commit" >&2 exit 1 :OK exit 0
39. Post Commit Hook for Email Notifications to testing team : "C:rogram FilesisualSVN ServerinisualSVNServerHooks.exe" ^ commit-notification "%1" -r %2 ^ --from gopinath.karangula@ghoom.com --to xxxx@mic.co.in,xxxxxi@domain.in,xxxxx@domain.com ^ --smtp-server smtpout.secureserver.net ^ --smtp-user XXXXXXX@domain.com ^ --smtp-password XXXXXXXX