190 likes | 355 Views
IS2739: Subversion. Team B. Outline. 1. Version Control 2. Subversion vs. CVS 3. Demo. What is version control?. Version control is the management of changes to documents, programs, and other information stored as computer files.
E N D
IS2739: Subversion Team B
Outline 1. Version Control 2. Subversion vs. CVS 3. Demo
What is version control? • Version control is the management of changes to documents, programs, and other information stored as computer files. • Put it another way, track every change to every document and identify the change with number, letter, and time. • Versions can be compared, restored, and with some types of files, merged.
Why version control is needed • Manage files and directories, and its changes over time • Collaboration and keep track of who made which change. • What you cannot do without version control? • No need to notify other members before change the project file. • No need to manually duplicate the original version before change the project file. • No need to tell other members or remember what changes you have made.
The Problem of File Sharing All version control systems have to solve the same fundamental problem : How will the system allow users to share information, but prevent them from accidentally stepping on each other's feet?
Lock-Modify-Unlock solution • Repository allows only one person to change a file at a time. • Managed using Locks. • Problems: • One by One • No concurrency • False sense of Security • Administrative problems: lock a file and forget to unlock it after finish. • When lock-modify-unlock is necessary? • Files with binary format like picture, sound and video
Copy – Modify – Merge Solution • Each client gets a working copy. Users work simultaneously and independently on private copies. Finally, copies are merged into a final version. • Overlaps are flag as being in state of conflict • Problems • Manually fix it. • Communication • When copy-modify-merge is necessary? • Line-based text files can be contextually mergeable
Track the change 1.Graphic demonstration 2.Color,number-highlight demonstration 3.Comparison demonstration 4.User-defined demonstration
Subversion Categories • You always see tags,trunk,branches in Subversion.These are three different 'categories' for versions of the project. • Trunk is traditionally the cutting-edge version that is being actively developed, a lot like CVS HEAD. • Branches are for alternative copies of your project. Allow you to create as many bugs as you want. After you finish, merge it into the trunk. • Tags are used for milestone releases.
Branch Cont. • Create branches by copying your data • Maintain parallel branches of your file and directory • Duplicate changes from one branch to another branch • Reflect differences among branches
Why Subversion over CVS • Can move or rename files or directories cleanly • Atomic commits • Good remote options http/https/svn vs pserver • File formats
Basic operations in subversion svn --help svn addfilename/directory svn deletefilename/directory svn checkout http://nodename/repos/svn/trunk/parentPath/path svn commit --message "Message goes here." filename svn difffilename svn mkdirdirectory svn importlocal-directory http://node/repos/svn/trunk/directory svn logfilename svn merge file1@revJfile2@revK svn status svn update filename
Planning Your Repository • Where and How? Local Server or Online Server, backups. • VisualSVN • SVN Server • Kenai • Assembla • File and Directory Organization : • 1 Repository per Project or all Projects in one Repository? • Trunk , branches, tags • Choosing Data Storage (Reliability, Accesibility, Scalability, Performance) • Berkely DB – database environment • FSFS – flat files, custom format
Project Kenai • What is Project Kenai? • Project Kenai is Sun's connected developer destination, where developers can host OPEN SOURCE projects, as well as connect, communicate, and collaborate with developers of like mind. • Cool features: • Forums • Wiki • IM Chat • Code Repository • Netbeans integration
Demo for SVN Server&Client 1. Download CollabNet Subversion Server Package and Install it 2. Create the repository folder(like D:/svnrepository) and select it as the repository during install Subversion Server (For binary file package. create subversion server manually Command: sc create svnserve binpath= " \"C:\Program Files\Subversion\bin\svnserve.exe\" --service --root c:\repos" displayname= "Subversion" depend= tcpip start= auto) 3. Restart computer and server will start automaticlly 4. svnadmin create d:\svnrepository
Demo cont. 5. edit conf,passwd file in svnrepository : • delete comment symbol and following space in • anon-access, auth-access,passw-db in conf • [users] in passwd 6. svn mkdir svn://localhost/myproject (server setup finish) 7. Install TortoiseSVN client 8. Create a project folder somewhere on your hard drive. Right click in that folder and select "SVN Checkout..." 9. type svn://localhost/myproject/ for the repository URL and click OK. 10.Create a new file in that directory. Right click the file and select "TortoiseSVN, Add"
Demo cont. 11. The file hasn't actually been checked in yet. Subversion batches any changes and commits them as one atomic operation. To send all your changes to the server, right click and select "SVN Commit" 12.You now have a networked Subversion server and client set up on your machine. References: 1. Setting up a Subversion Server under Windows 2.Practical guide to subversion on Windows with TortoiseSVN