Sussman - Version Control with Subversion v1.4 (2007).pdf

(1428 KB) Pobierz
435910227 UNPDF
Version Control with Subversion
For Subversion 1.4
(Compiled from r2866)
Ben Collins-Sussman
Brian W. Fitzpatrick
C. Michael Pilato
Version Control with Subversion: For Subversion 1.4:
(Compiled from r2866)
by Ben Collins-Sussman, Brian W. Fitzpatrick, and C. Michael Pilato
Published (TBA)
Copyright © 2002, 2003, 2004, 2005, 2006, 2007 Ben Collins-SussmanBrian W. FitzpatrickC.
Michael Pilato
This work is licensed under the Creative Commons Attribution License. To view a copy of this license, visit ht-
tp://creativecommons.org/licenses/by/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford,
California 94305, USA.
435910227.001.png
435910227.002.png
Table of Contents
Foreword ................................................................................................................ xi
Preface ..................................................................................................................xiii
Audience ........................................................................................................xiii
How to Read this Book ....................................................................................xiv
Conventions Used in This Book ....................................................................... xv
Typographic Conventions ........................................................................ xv
Icons ...................................................................................................... xv
Organization of This Book ............................................................................... xv
This Book is Free ............................................................................................xvi
Acknowledgments .......................................................................................... xvii
From Ben Collins-Sussman .................................................................... xvii
From Brian W. Fitzpatrick ....................................................................... xvii
From C. Michael Pilato .......................................................................... xviii
What is Subversion? ..................................................................................... xviii
Subversion's History ...............................................................................xix
Subversion's Features .............................................................................xix
Subversion's Architecture ........................................................................xxi
Subversion's Components ...................................................................... xxii
1. Fundamental Concepts .........................................................................................1
The Repository .................................................................................................1
Versioning Models ............................................................................................2
The Problem of File-Sharing ......................................................................2
The Lock-Modify-Unlock Solution ...............................................................3
The Copy-Modify-Merge Solution ...............................................................5
Subversion in Action .........................................................................................7
Subversion Repository URLs .....................................................................7
Working Copies ........................................................................................8
Revisions ............................................................................................... 11
How Working Copies Track the Repository ............................................... 13
Mixed Revision Working Copies ............................................................... 14
Summary ....................................................................................................... 15
2. Basic Usage ....................................................................................................... 16
Help! .............................................................................................................. 16
Getting Data into your Repository .................................................................... 16
svn import .............................................................................................. 16
Recommended repository layout .............................................................. 17
Initial Checkout ............................................................................................... 17
Disabling Password Caching ................................................................... 19
Authenticating as a Different User ............................................................ 19
Basic Work Cycle ........................................................................................... 20
Update Your Working Copy ..................................................................... 20
Make Changes to Your Working Copy ...................................................... 21
Examine Your Changes .......................................................................... 22
Undoing Working Changes ...................................................................... 26
Resolve Conflicts (Merging Others' Changes) ........................................... 26
Commit Your Changes ............................................................................ 30
Examining History ........................................................................................... 31
Generating a list of historical changes ...................................................... 32
Examining the details of historical changes ............................................... 33
Browsing the repository ........................................................................... 35
Fetching older repository snapshots ......................................................... 36
iv
435910227.003.png
Version Control with Subversion
Sometimes You Just Need to Clean Up ............................................................ 37
Summary ....................................................................................................... 37
3. Advanced Topics ................................................................................................ 38
Revision Specifiers ......................................................................................... 38
Revision Keywords ................................................................................. 38
Revision Dates ....................................................................................... 39
Properties ...................................................................................................... 40
Why Properties? ..................................................................................... 41
Manipulating Properties ........................................................................... 42
Properties and the Subversion Workflow .................................................. 45
Automatic Property Setting ...................................................................... 46
File Portability ................................................................................................. 47
File Content Type ................................................................................... 47
File Executability ..................................................................................... 48
End-of-Line Character Sequences ........................................................... 49
Ignoring Unversioned Items ............................................................................. 50
Keyword Substitution ...................................................................................... 53
Locking .......................................................................................................... 56
Creating locks ........................................................................................ 58
Discovering locks .................................................................................... 60
Breaking and stealing locks ..................................................................... 61
Lock Communication .............................................................................. 63
Externals Definitions ....................................................................................... 64
Peg and Operative Revisions .......................................................................... 67
Network Model ............................................................................................... 71
Requests and Responses ....................................................................... 71
Client Credentials Caching ...................................................................... 71
4. Branching and Merging ....................................................................................... 75
What's a Branch? ........................................................................................... 75
Using Branches .............................................................................................. 76
Creating a Branch ................................................................................... 77
Working with Your Branch ....................................................................... 80
The Key Concepts Behind Branches ........................................................ 82
Copying Changes Between Branches .............................................................. 82
Copying Specific Changes ...................................................................... 82
The Key Concept Behind Merging ............................................................ 85
Best Practices for Merging ...................................................................... 86
Common Use-Cases ....................................................................................... 89
Merging a Whole Branch to Another ......................................................... 89
Undoing Changes ................................................................................... 91
Resurrecting Deleted Items ..................................................................... 93
Common Branching Patterns ................................................................... 94
Traversing Branches ....................................................................................... 96
Tags .............................................................................................................. 98
Creating a Simple Tag ............................................................................ 98
Creating a Complex Tag ......................................................................... 98
Branch Maintenance ....................................................................................... 99
Repository Layout ................................................................................. 100
Data Lifetimes ...................................................................................... 100
Vendor branches .......................................................................................... 101
General Vendor Branch Management Procedure .................................... 102
svn_load_dirs.pl ................................................................................. 104
Summary ..................................................................................................... 105
5. Repository Administration .................................................................................. 107
The Subversion Repository, Defined .............................................................. 107
Strategies for Repository Deployment ............................................................ 108
Planning Your Repository Organization .................................................. 108
v
435910227.004.png
Zgłoś jeśli naruszono regulamin