The next generation of VCS has a clear target ahead of them: making branching and merging easier. Until recently, Subversion was dominating the world of Version Control Systems, but now, Distributed Version Control Systems are growing in popularity and everywhere you go you hear about Git or Mercurial, and how they make branching and merging a breeze. But the Subversion team isn't going down quietly, they have a new weapon: the 1.5 version. Learn about the next generation of Version Control Systems is planning to solve your problems.
5. Development Cycle Our repository layout should behave like our development cycle: Development Phase Testing Phase Release Final Product Our VCS should accommodate us and not the other way, no matter what’s our development process. 5
10. Three Level Build A classic layout for a three phase development cycle. Release candidates are for the testing phase and support phase. The production branch is sterile. 10
17. Why merges are hard? Requires knowledge of the code Resolving conflicts by hand takes time Large projects require some planning Can cause logical bugs which aren’t easily detected 18
18. Making merges easier Merge daily! Let the VCS do the merge for you Don’t merge at the last minute, allocate merging time in your time table. Keep tabs on your code, keep notes on your changes. 19
31. Merge Tracking Create a branch Work on your branch Update your branch with trunk’s changes svn copy http://yourserver.com/svn/project-x/trunk http://yourserver.com/svn/project-x/branches/feature-z -m "Creating a feature branch of /project-x/trunk." svn checkout http://yourserver.com/svn/project-x/branches/feature-z… work …svn commit - m “committing my work." svn merge http://yourserver.com/svn/project-x/trunk --- Merging r20 through r45 into '.': U GridView.java 24
32. Merge Tracking What has been merged so far? Which changes are available from trunk? svn propget svn:mergeinfo . /trunk:20-45 # or svn mergeinfo http://yourserver.com/svn/project-x/trunk r20r21…r44r45 svn mergeinfo http://yourserver.com/svn/project-x/trunk --show-revs eligible r46r47 25
33. Merge Tracking Merging back your branch: What’s the catch? No support for renames moves Mergeinfo is sometimes generated when no merge was done $ cd /workspace/project-x/trunk$ svn merge --reintegrate http://yourserver.com/svn/project-x/branches/feature-z--- Merging differences between repository URLs into '.': … changes list …# build, test, verify, ... $ svn commit -m “Merging feature-z back into trunk!" 26
34. More New Features Sparse checkouts Interactive conflict resolution Changelist support $ svn checkout URI --depth=[empty,files,immediates,infinity]# command support - checkout, switch, update, status, info $ svn up U project-x/trunk/GridView.javaConflict discovered in 'project-x/trunk/GridView.java'.Select: (p) postpone, (df) diff-full, (e) edit, (s) show all options: $ svn changelist bug-fix-1 GridView.javaPath 'GridView.java' is now a member of changelist 'bug-fix-1'.$ svn status --- Changelist ‘bug-fix-1': M GridView.java 27
35. Upgrading to Subversion 1.5 Server Backup everything Install Subversion 1.5 Server Upgrade existing repositories with: Populate indexes (Optional): Upgrade clients Pray to god 28 $ svnadmin upgrade REPOS_PATH $ svn-populate-node-origins-index REPOS-PATH
36. TortoiseSVN 1.5 29 TortoiseSVN is upgraded to support Subversion 1.5 The Merge process is simplified and merge tracking is supported The repository now more resembles the Windows explorer Changelist support is supported Hook Scripts and Issue Trackers are supported
40. What is DVCS? Distributed VCS does NOT mean the physical distribution of the repository over several machines. Distributed VCS means the repository is located on your machine. 33
41. Terminology In DVCS we… Do not check out from the repository, we clonethe repository. Do not update our working copy, we pullchanges from other repositories. Do not check in our changes,we pushchanges to other repositories. 34
42. Advantages You are the repository Performance, no network overhead. Work offline, work where ever you want. Experiment, no commit rights required. Local Commits, the repository is in your workspace. Flexible repository topology 35
43. Disadvantages But… Sparse checkouts are not fully supported if at all. Most vendors do not support branching, you must clone. Merge Tracking needs to mature a bit. More suited to Open Source projects than commercial. 36