You are previewing Subversion Version Control: Using The Subversion Version Control System in Development Projects.
O'Reilly logo
Subversion Version Control: Using The Subversion Version Control System in Development Projects

Book Description

In any software development project, many developers contribute changes over a period of time. Using a version control system to track and manage these changes is vital to the continued success of the project. This book introduces you to Subversion, a free, open-source version control system, which is both more powerful and much less complex than its predecessor CVS.

In this practical, hands-on guide, you will learn how to use Subversion and how to effectively merge a version control system within your development process. As a seasoned Subversion user, William Nagel draws on lessons learned through trial and error, providing useful tips for accomplishing tasks that arise in day-to-day software development. Nagel clearly explains how to expand on the built-in abilities of Subversion, making the system work better for you. He organizes Subversion commands by activity to allow for quick task reference. Using example scripts and configurations, he also includes development approaches that you can customize to fit your own environment.

Inside, you will find

  • A guide to installing Subversion on Linux, Windows, and Mac OS X.

  • A tutorial walkthrough of Subversion, from creating your first repository to basic branching and merging.

  • A detailed look at the most important Subversion client commands, as well as properties, user configuration, and integration with a variety of external tools.

  • A guide to repository administration and organization, including repository security and migration from another version control system.

  • An in-depth look at automation in Subversion, including using hook scripts, metadata, and the Subversion API, plus example scripts.

  • Case studies that examine both archetypal and real-world projects and their use of Subversion.

  • A Subversion command reference for fast access to essential technical information.

  • Details on Subversion's many advanced features, such as its Apache-integrated WebDAV server and database file storage system.

  • Whether you are an administrator, project manager, or software developer, Subversion Version Control will show you how to realize the full potential of Subversion.



    Table of Contents

    1. Copyright
      1. Dedication
    2. Bruce Perens’ Open Source Series
    3. Preface
      1. Writing the Book
      2. The Layout of the Book
        1. Part I: An Introduction to Version Control and Subversion
        2. Part II: Subversion from a Client User’s Perspective
        3. Part III: Subversion from an Administrator’s Perspective
        4. Part IV: The Software Development Process
        5. Part V: Reference
    4. Acknowledgments
    5. I. An Introduction to Version Control and Subversion
      1. 1. An Introduction to Version Control
        1. 1.1. What Is Version Control?
        2. 1.2. Why Use It?
          1. 1.2.1. Data Integrity
          2. 1.2.2. Productivity
          3. 1.2.3. Accountability
          4. 1.2.4. Software Engineering Process Support
          5. 1.2.5. Development Branching
          6. 1.2.6. Record Keeping
          7. 1.2.7. Distribution of Work
          8. 1.2.8. Rapid Development
        3. 1.3. The Elements of Version Control
          1. 1.3.1. The Repository and Working Directory
          2. 1.3.2. Revisions
          3. 1.3.3. Logs
          4. 1.3.4. Tagging
          5. 1.3.5. Branching
          6. 1.3.6. Locking versus Merging
        4. 1.4. Summary
      2. 2. An Introduction to Subversion
        1. 2.1. Why Subversion?
          1. 2.1.1. A Software Engineering Tool
          2. 2.1.2. Open Source Solutions
          3. 2.1.3. Major Features of SVN
            1. Basic Operation
            2. Repository Flexibility
            3. Atomic Commits
            4. Branches and Tags
            5. Binary Files
            6. Symbolic Links
            7. Conflict Resolution
            8. Storage
            9. Network Protocols
            10. Data Transfer
            11. Properties
            12. Hook Scripts
            13. Full-featured API
        2. 2.2. Limitations of Subversion
          1. Locking
          2. Distributed Repository
          3. Visualization Tools
          4. Merging History
        3. 2.3. Summary
      3. 3. Installing Subversion
        1. 3.1. Installing on Linux
          1. 3.1.1. Subversion’s Prerequisites
            1. Apache Portable Runtime Libraries
            2. Apache Web Server
            3. Berkeley DB
            4. Neon
          2. 3.1.2. Downloading the Source
          3. 3.1.3. Compiling and Installing
            1. Configuration Options
        2. 3.2. Installing on Mac OS X
          1. 3.2.1. Installing OS X Binaries
          2. 3.2.2. Compiling Subversion on OS X
          3. 3.2.3. Using Fink
        3. 3.3. Installing on Windows
        4. 3.4. Configuring SVN to Use Apache
          1. 3.4.1. Loading the Modules
          2. 3.4.2. Setting Up Access
            1. Setting a Parent Path for Multiple Repositories
          3. 3.4.3. Using Apache 2 and Apache 1 Together
        5. 3.5. Configuring SVN to Use svnserve
          1. 3.5.1. Running as a Daemon
          2. 3.5.2. Running with inetd
          3. 3.5.3. Tunneling over SSH
        6. 3.6. Summary
      4. 4. Basic Subversion Usage
        1. 4.1. Creating the Repository
        2. 4.2. Getting Files into the Repository
        3. 4.3. Creating a Working Copy
        4. 4.4. Editing Files
        5. 4.5. Committing Changes
        6. 4.6. Viewing the Logs
        7. 4.7. Creating a Tag
        8. 4.8. Creating a Branch
        9. 4.9. Merging a Branch
        10. 4.10. Handling Conflicts
        11. 4.11. Summary
    6. II. Subversion from a Client User’s Perspective
      1. 5. Working with a Working Copy
        1. 5.1. The Subversion Client
          1. 5.1.1. Common Command Options
            1. --message
            2. --no-auth-cache
            3. --recursive/--non-recursive
            4. --revision
          2. 5.1.2. Paths
        2. 5.2. Checking Out and Maintaining a Working Copy
          1. 5.2.1. Keeping Up-to-Date
        3. 5.3. Modifying and Committing Data
          1. 5.3.1. Adding New Files
          2. 5.3.2. Removing Files
          3. 5.3.3. Moving Things Around
            1. Using copy to Undelete Files
        4. 5.4. Getting Information about the Repository
          1. 5.4.1. Getting Information on the Current State
            1. Getting Detailed File Info
            2. Examining File Changes
          2. 5.4.2. Getting the Repository’s History
            1. Checking the Logs
            2. Who’s to Blame?
            3. Examining Files in the Repository
            4. Getting a Single File
        5. 5.5. Changing the Working Copy Target
        6. 5.6. Resolving Conflicts
        7. 5.7. Branching, Tagging, and Merging
          1. 5.7.1. Creating a Branch or Tag
            1. Creating a Branch/Tag in the Repository
            2. Creating a Branch/Tag from the Working Copy
            3. Switching to the Branch/Tag
          2. 5.7.2. Merging a Branch
            1. Keeping Track of Merges
            2. Reverting Changes with Merge
            3. Looking before You Merge
        8. 5.8. Troubleshooting the Working Copy
        9. 5.9. Summary
      2. 6. Using Properties
        1. 6.1. Storing Metadata
          1. 6.1.1. Editing Properties
          2. 6.1.2. Automatically Setting Properties
          3. 6.1.3. Committing Properties
          4. 6.1.4. Storing Revision Properties
        2. 6.2. Retrieving Metadata
          1. 6.2.1. Listing Properties
          2. 6.2.2. Outputting Multiple Binary Properties
          3. 6.2.3. Getting Revision Properties
        3. 6.3. Built-in Properties
          1. 6.3.1. File Properties
            1. svn:eol-style
            2. svn:executable
            3. svn:externals
            4. svn:ignore
            5. svn:keywords
            6. svn:mime-type
            7. svn:special
          2. 6.3.2. Revision Properties
            1. svn:author
            2. svn:date
            3. svn:log
        4. 6.4. Summary
      3. 7. Configuring the Client
        1. 7.1. Finding the Configuration Files
        2. 7.2. Editing the Configuration Files
          1. 7.2.1. The config File
            1. Setting the Authorization Retention
            2. Setting Your Helper Programs
            3. Setting Up Tunnels
            4. Setting Global Ignores
            5. Setting the Log File Encoding
            6. Controlling File Timestamps
            7. Automatically Setting Properties
          2. 7.2.2. The servers File
            1. Setting Up Server Groups
            2. Configuring HTTP Proxies
            3. Configuring Other HTTP Stuff
            4. Dealing with SSL Certificates
        3. 7.3. Summary
      4. 8. Integrating with Other Tools
        1. 8.1. Accessing SVN through a GUI Client
          1. 8.1.1. RapidSVN
            1. Features
            2. When Should I Use It?
          2. 8.1.2. TortoiseSVN
            1. Features
          3. 8.1.3. ViewCVS
            1. Features
            2. When Should I Use It?
          4. 8.1.4. WebSVN
            1. Features
            2. When Should I Use It?
        2. 8.2. Accessing Directly from an IDE
          1. 8.2.1. Visual Studio.Net
            1. Features
          2. 8.2.2. Eclipse
            1. Features
        3. 8.3. Using Autoversioning with WebDAV
          1. Enabling Autoversioning
          2. Autoversioning on OS X
        4. 8.4. Summary
    7. III. Subversion from an Administrator’s Perspective
      1. 9. Organizing Your Repository
        1. 9.1. Laying Out the Repository
          1. 9.1.1. The Two Basic Layouts
            1. Monolithic Layout
            2. Multiproject Layout
          2. 9.1.2. Organizing the Trunk
          3. 9.1.3. Organizing Branches
          4. 9.1.4. Organizing Tags
        2. 9.2. Planning for Growth
          1. 9.2.1. Merging and Splitting a Repository
            1. Merging Two Repositories
            2. Splitting a Single Repository
        3. 9.3. Migrating an Existing Repository
          1. 9.3.1. The Basic Migration Process
          2. 9.3.2. Migrating from CVS
            1. Full Repository Migration
            2. Partial Repository Migration
            3. Handling Data Differences
          3. 9.3.3. Migrating from SourceSafe
          4. 9.3.4. Migrating from Other VCSs
          5. 9.3.5. What If There’s No Migration Tool?
        4. 9.4. Summary
      2. 10. Administrating the Repository
        1. 10.1. Controlling Access to the Repository
          1. 10.1.1. Direct Access Control
          2. 10.1.2. svnserve Access Control
            1. The svnserve.conf file
            2. The Passwords Database File
            3. Secure Communication over SSH
          3. 10.1.3. HTTP/HTTPS Access Control
            1. Setting Up Password Protection
            2. Further Securing with SSL
            3. Creating an SSL Certificate
            4. Configuring Your SSL Certificate in Apache
            5. Per-directory Access Control
          4. 10.1.4. Authenticating against a Windows Domain Controller
            1. Configuring Apache
            2. Configuring Samba
        2. 10.2. Backing Up the Repository
          1. 10.2.1. Hotcopying the Repository
          2. 10.2.2. Dumping the Repository
          3. 10.2.3. Automating Your Backups
            1. An Incremental Dumping Script
            2. Setting Up Cron
          4. 10.2.4. Recovering
        3. 10.3. Unwedging Your Repository
        4. 10.4. Upgrading Subversion
        5. 10.5. Summary
      3. 11. The Joy of Automation
        1. 11.1. An Introduction to Hooks
          1. 11.1.1. Available Hook Scripts
            1. start-commit
            2. pre-commit
            3. post-commit
            4. pre-revprop-change
            5. post-revprop-change
          2. 11.1.2. What a Hook Script Can Do
            1. Examining the Repository
            2. Examining Transactions
            3. Running External Programs
          3. 11.1.3. What a Hook Script Can’t Do
            1. Don’t Modify the Repository
            2. Communication with Client Is Limited
          4. 11.1.4. Tips for a Good Hook Script
            1. Keep It Short
            2. Do You Really Want It Every Time?
            3. Early On: Log What You Do
            4. Remember the Edge Cases
            5. Reuse What You Can
          5. 11.1.5. The Pre-made Subversion Scripts
        2. 11.2. Making the Most of Hook Scripts
          1. 11.2.1. Automatically Send E-mails
            1. Redundant Archival E-mails
            2. Communicating with an Issue Tracker
            3. Subversion Supplied Scripts
            4. commit-email.pl
            5. propchange-email.pl
            6. mailer.py
          2. 11.2.2. Send Notifications via RSS
            1. Generating the RSS
            2. Setting Up Variables
            3. Locking the Script
            4. Computing Revision Range
            5. Deleting Old Files
            6. Creating the Feed
            7. Tying It All Together
            8. Taking Action on the Post-commit
          3. 11.2.3. Implement Fine-grain Access Controls
            1. commit-access-control.pl
            2. svnperms.py
          4. 11.2.4. Enforce Policy
          5. 11.2.5. Log Revision Property Changes
          6. 11.2.6. Make Tags Immutable
        3. 11.3. Taking Advantage of Metadata
          1. 11.3.1. The Subversion Commands
            1. svn
            2. svnlook
        4. 11.4. The Subversion API
          1. 11.4.1. svntag
            1. Initial Includes and Defines
            2. Memory Pools
            3. Initializing the Client Context
            4. Setting the Commit Log
            5. The Main Program
            6. Compiling the Program
        5. 11.5. Summary
    8. IV. The Software Development Process
      1. 12. Development Process Policies
        1. 12.1. Effective Branching and Tagging
          1. 12.1.1. Branch and Tag Creation and Organization
            1. Software Version Branches
            2. Quality Assurance Branches and Betas
            3. Task Branches
            4. Sliding Tags
            5. Merge Tracking with Tags
            6. Tagging Project Builds
            7. Milestone and Release Point Tags
            8. Saved Working Copies Snapshots
          2. 12.1.2. Merging Policies
            1. When to Merge
            2. Who Should Merge
            3. Documenting Merges
        2. 12.2. Checking In Code
        3. 12.3. Log Data
          1. 12.3.1. Policies for Informative Logs
          2. 12.3.2. Parseable Log Messages
          3. 12.3.3. What Not to Include
        4. 12.4. Project Builds
          1. 12.4.1. Configuration
          2. 12.4.2. Daily Builds
            1. CruiseControl
          3. 12.4.3. Integration
            1. Continuous Integration
            2. Task Integration
        5. 12.5. Testing and Quality Assurance
          1. 12.5.1. The Parts of Testing
            1. Individual Developer Testing
            2. Automated Unit and Regression Testing
            3. The QA Team
            4. Beta Testing
            5. Shipping the Final Product
        6. 12.6. Communication
          1. 12.6.1. Communicating through Subversion
            1. Log Messages
            2. Properties
            3. Branches and Tags
          2. 12.6.2. Communicating about Subversion
        7. 12.7. Enforcing Policies
        8. 12.8. Summary
      2. 13. Integrating SVN with the Development Process
        1. 13.1. SVN in Different Developers’ Workflows
          1. 13.1.1. The Methodical Programmer
          2. 13.1.2. The Collaborator
          3. 13.1.3. The Lone Hacker
          4. 13.1.4. The Guru
          5. 13.1.5. The Rookie
          6. 13.1.6. The Hobbyist Programmer
        2. 13.2. Using SVN in Peer Reviews
          1. 13.2.1. Tracking Peer Review Status
            1. Finding Unreviewed Revisions
          2. 13.2.2. Distributing Material for Peer Reviews
            1. An svn blame Postprocessor
          3. 13.2.3. Performing Peer Reviews
            1. Group Reviews
            2. Individual Review
            3. Forum Review
        3. 13.3. Tying Revisions to Issue Tracking
          1. 13.3.1. Issue-tracking Properties
            1. bugtraq:label
            2. bugtraq:message
            3. bugtraq:number
            4. bugtraq:url
            5. bugtraq:warnifnoissue
            6. bugtraq:append
          2. 13.3.2. Automating Interaction with Issue Tracking
            1. Trac
        4. 13.4. Summary
      3. 14. Case Studies in Development Processes
        1. 14.1. Archetypal Studies
          1. 14.1.1. Managed Chaos
            1. Repository Layout
            2. Branches and Tags
            3. Properties
            4. Scripts
          2. 14.1.2. Rapid Development
            1. Repository Layout
            2. Branches and Tags
            3. Properties
            4. Scripts
          3. 14.1.3. Central Planning
            1. Repository Layout
            2. Branches and Tags
            3. Properties
            4. Scripts
          4. 14.1.4. Small Teams
            1. Repository Layout
            2. Branches and Tags
            3. Properties
            4. Scripts
        2. 14.2. Real-world Studies
          1. 14.2.1. KeyGhost Ltd
            1. Repository
            2. Migrating to Subversion
            3. Storing Binary Files
            4. Repository Migration
          2. 14.2.2. Error Free Software
            1. Repository
          3. 14.2.3. Teledata Communications
            1. Repository
            2. Branches and Tags
            3. Hook Scripts
          4. 14.2.4. GladeSoft
            1. Repository
            2. Hook Scripts
          5. 14.2.5. ExCo
            1. Repository
            2. Branches and Tags
            3. The People Problem
          6. 14.2.6. Wye Corp
            1. Repository
            2. Branches and Tags
            3. Hook Scripts
          7. 14.2.7. ZedCom
            1. Repository
    9. V. Reference
      1. 15. Command Reference
        1. 15.1. svn
          1. Options
          2. Subcommands
          3. 15.1.1. svn add
            1. Basic Usage
            2. Options
          4. 15.1.2. svn blame (praise, annotate, ann)
            1. Basic Usage
            2. Options
          5. 15.1.3. svn cat
            1. Basic Usage
            2. Options
          6. 15.1.4. svn checkout (co)
            1. Basic Usage
            2. Options
          7. 15.1.5. svn cleanup
            1. Basic Usage
            2. Options
          8. 15.1.6. svn commit (ci)
            1. Basic Usage
            2. Options
          9. 15.1.7. svn copy (cp)
            1. Basic Usage
            2. Options
          10. 15.1.8. svn delete (del, remove, rm)
            1. Basic Usage
            2. Options
          11. 15.1.9. svn diff (di)
            1. Basic Usage
            2. Options
          12. 15.1.10. svn export
            1. Basic Usage
            2. Options
          13. 15.1.11. svn help (?, h)
            1. Basic Usage
            2. Options
          14. 15.1.12. svn import
            1. Basic Usage
            2. Options
          15. 15.1.13. svn info
            1. Basic Usage
            2. Options
          16. 15.1.14. svn list (ls)
            1. Basic Usage
            2. Options
          17. 15.1.15. svn log
            1. Basic Usage
            2. Options
          18. 15.1.16. svn merge
            1. Basic Usage
            2. Options
          19. 15.1.17. svn mkdir
            1. Basic Usage
            2. Options
          20. 15.1.18. svn move (mv, rename, ren)
            1. Basic Usage
            2. Options
          21. 15.1.19. svn propdel (pdel, pd)
            1. Basic Usage
            2. Options
          22. 15.1.20. svn propedit (pedit, pe)
            1. Basic Usage
            2. Options
          23. 15.1.21. svn propget (pget, pg)
            1. Basic Usage
            2. Options
          24. 15.1.22. svn proplist (plist, pl)
            1. Basic Usage
            2. Options
          25. 15.1.23. svn propset (pset, ps)
            1. Basic Usage
            2. Options
          26. 15.1.24. svn resolved
            1. Basic Usage
            2. Options
          27. 15.1.25. svn revert
            1. Basic Usage
            2. Options
          28. 15.1.26. svn status (stat, st)
            1. Basic Usage
            2. Options
          29. 15.1.27. svn switch (sw)
            1. Basic Usage
            2. Options
          30. 15.1.28. svn update (up)
            1. Basic Usage
            2. Options
        2. 15.2. svnadmin
          1. Options
          2. Subcommands
          3. 15.2.1. svnadmin create
            1. Basic Usage
            2. Options
          4. 15.2.2. svnadmin dump
            1. Basic Usage
            2. Options
          5. 15.2.3. svnadmin help (?, h)
            1. Basic Usage
            2. Options
          6. 15.2.4. svnadmin hotcopy
            1. Basic Usage
            2. Options
          7. 15.2.5. svnadmin list-dblogs
            1. Basic Usage
            2. Options
          8. 15.2.6. svnadmin list-unused-dblogs
            1. Basic Usage
            2. Options
          9. 15.2.7. svnadmin load
            1. Basic Usage
            2. Options
          10. 15.2.8. svnadmin lstxns
            1. Basic Usage
            2. Options
          11. 15.2.9. svnadmin recover
            1. Basic Usage
            2. Options
          12. 15.2.10. svnadmin rmtxns
            1. Basic Usage
            2. Options
          13. 15.2.11. svnadmin setlog
            1. Basic Usage
            2. Options
          14. 15.2.12. svnadmin verify
            1. Basic Usage
            2. Options
        3. 15.3. svnlook
          1. Options
          2. Subcommands
          3. 15.3.1. svnlook author
            1. Basic Usage
            2. Options
          4. 15.3.2. svnlook cat
            1. Basic Usage
            2. Options
          5. 15.3.3. svnlook changed
            1. Basic Usage
            2. Options
          6. 15.3.4. svnlook date
            1. Basic Usage
            2. Options
          7. 15.3.5. svnlook diff
            1. Basic Usage
            2. Options
          8. 15.3.6. svnlook dirs-changed
            1. Basic Usage
            2. Options
          9. 15.3.7. svnlook help (?, h)
            1. Basic Usage
            2. Options
          10. 15.3.8. svnlook history
            1. Basic Usage
            2. Options
          11. 15.3.9. svnlook info
            1. Basic Usage
            2. Options
          12. 15.3.10. svnlook log
            1. Basic Usage
            2. Options
          13. 15.3.11. svnlook propget (pget, pg)
            1. Basic Usage
            2. Options
          14. 15.3.12. svnlook proplist (plist, pl)
            1. Basic Usage
            2. Options
          15. 15.3.13. svnlook tree
            1. Basic Usage
            2. Options
          16. 15.3.14. svnlook uuid
            1. Basic Usage
            2. Options
          17. 15.3.15. svnlook youngest
            1. Basic Usage
            2. Options
        4. 15.4. svnversion
          1. Basic Usage
          2. Options
        5. 15.5. svndumpfilter
          1. Options
          2. Subcommands
          3. 15.5.1. svndumpfilter exclude
            1. Basic Usage
            2. Options
          4. 15.5.2. svndumpfilter include
            1. Basic Usage
            2. Options
          5. 15.5.3. svndumpfilter help (?, h)
            1. Basic Usage
            2. Options