(Compiled From R6050) For Subversion 1

Transcription

Version Control with SubversionFor Subversion 1.7(Compiled from r6055)Ben Collins-SussmanBrian W. FitzpatrickC. Michael Pilato

Version Control with Subversion: For Subversion 1.7: (Compiled from r6055)by Ben Collins-Sussman, Brian W. Fitzpatrick, and C. Michael PilatoCopyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ben Collins-Sussman, Brian W. Fitzpatrick, C. MichaelPilatoThis work is licensed under the Creative Commons Attribution License. To view a copy of this license, visit http://creativecommons.org/licenses/by/2.0/ or send aletter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Table of ContentsForeword . xiPreface . xiiiWhat Is Subversion? . xiiiIs Subversion the Right Tool? . xiiiSubversion's History . xivSubversion's Architecture . xvSubversion's Components . xviiWhat's New in Subversion . xviiAudience . xviiiHow to Read This Book . xixOrganization of This Book . xxThis Book Is Free . xxiAcknowledgments . xxi1. Fundamental Concepts . 1Version Control Basics . 1The Repository . 1The Working Copy . 2Versioning Models . 2Version Control the Subversion Way . 7Subversion Repositories . 7Revisions . 7Addressing the Repository . 8Subversion Working Copies . 9Summary . 142. Basic Usage . 15Help! . 15Getting Data into Your Repository . 16Importing Files and Directories . 16Recommended Repository Layout . 17What's In a Name? . 17Creating a Working Copy . 18Basic Work Cycle . 19Update Your Working Copy . 20Make Your Changes . 20Review Your Changes . 21Fix Your Mistakes . 25Resolve Any Conflicts . 26Commit Your Changes . 32Examining History . 33Examining the Details of Historical Changes . 34Generating a List of Historical Changes . 35Browsing the Repository . 37Fetching Older Repository Snapshots . 39Sometimes You Just Need to Clean Up . 40Disposing of a Working Copy . 40Recovering from an Interruption . 40Dealing with Structural Conflicts . 41An Example Tree Conflict . 42Summary . 463. Advanced Topics . 47Revision Specifiers . 47iii

Version Control with SubversionRevision Keywords . 47Revision Dates . 48Peg and Operative Revisions . 49Properties . 53Why Properties? . 54Manipulating Properties . 55Properties and the Subversion Workflow . 58Automatic Property Setting . 60File Portability . 60File Content Type . 61File Executability . 62End-of-Line Character Sequences . 62Ignoring Unversioned Items . 63Keyword Substitution . 66Sparse Directories . 70Locking . 74Creating Locks . 75Discovering Locks . 77Breaking and Stealing Locks . 78Lock Communication . 80Externals Definitions . 81Changelists . 86Creating and Modifying Changelists . 87Changelists As Operation Filters . 89Changelist Limitations . 90Network Model . 90Requests and Responses . 91Client Credentials . 91Summary . 944. Branching and Merging . 95What's a Branch? . 95Using Branches . 95Creating a Branch . 97Working with Your Branch . 98The Key Concepts Behind Branching . 101Basic Merging . 101Changesets . 101Keeping a Branch in Sync . 102Subtree Merges and Subtree Mergeinfo . 105Reintegrating a Branch . 107Mergeinfo and Previews . 109Undoing Changes . 113Resurrecting Deleted Items . 114Advanced Merging . 115Cherrypicking . 115Merge Syntax: Full Disclosure . 117Merges Without Mergeinfo . 118More on Merge Conflicts . 119Blocking Changes . 121Keeping a Reintegrated Branch Alive . 122Merge-Sensitive Logs and Annotations . 123Noticing or Ignoring Ancestry . 125Merges and Moves . 126Preventing Naïve Clients from Committing Merges . 126iv

Version Control with SubversionThe Final Word on Merge Tracking .Traversing Branches .Tags .Creating a Simple Tag .Creating a Complex Tag .Branch Maintenance .Repository Layout .Data Lifetimes .Common Branching Patterns .Release Branches .Feature Branches .Vendor Branches .General Vendor Branch Management Procedure .svn load dirs.pl .To Branch or Not to Branch? .Summary .5. Repository Administration .The Subversion Repository, Defined .Strategies for Repository Deployment .Planning Your Repository Organization .Deciding Where and How to Host Your Repository .Choosing a Data Store .Creating and Configuring Your Repository .Creating the Repository .Implementing Repository Hooks .Berkeley DB Configuration .FSFS Configuration .Repository Maintenance .An Administrator's Toolkit .Commit Log Message Correction .Managing Disk Space .Berkeley DB Recovery .Migrating Repository Data Elsewhere .Filtering Repository History .Repository Replication .Repository Backup .Managing Repository UUIDs .Moving and Removing Repositories .Summary .6. Server Configuration .Overview .Choosing a Server Configuration .The svnserve Server .svnserve over SSH .The Apache HTTP Server .Recommendations .svnserve, a Custom Server .Invoking the Server .Built-in Authentication and Authorization .Using svnserve with SASL .Tunneling over SSH .SSH Configuration Tricks .httpd, the Apache HTTP Server .Prerequisites 84186187188189

Version Control with SubversionBasic Apache Configuration .Authentication Options .Authorization Options .Protecting network traffic with SSL .Extra Goodies .Path-Based Authorization .High-level Logging .Server Optimization .Data Caching .Network Compression of Data .Supporting Multiple Repository Access Methods .7. Customizing Your Subversion Experience .Runtime Configuration Area .Configuration Area Layout .Configuration and the Windows Registry .Configuration Options .Localization .Understanding Locales .Subversion's Use of Locales .Using External Editors .Using External Differencing and Merge Tools .External diff .External diff3 .External merge .Summary .8. Embedding Subversion .Layered Library Design .Repository Layer .Repository Access Layer .Client Layer .Using the APIs .The Apache Portable Runtime Library .Functions and Batons .URL and Path Requirements .Using Languages Other Than C and C .Code Samples .Summary .9. Subversion Complete Ref

Version Control with Subversion For Subversion 1.7 (Compiled from r6050) B