Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Buy Now $35.99
Standard view
Full view
of .
Save to My Library
Look up keyword or section
Like this
2Activity

Table Of Contents

Preface
A Brief History of Revision Control
Why Revision Control? Why Mercurial?
Why Use Revision Control?
The Many Names of Revision Control
This Book Is a Work in Progress
About the Examples in This Book
Trends in the Field
A Few Advantages of Distributed Revision Control
Advantages for Open Source Projects
Advantages for Commercial Projects
Why Choose Mercurial?
Mercurial Compared with Other Tools
Subversion
Commercial Tools
Choosing a Revision Control Tool
Switching from Another Tool to Mercurial
A Short History of Revision Control
A Tour of Mercurial: The Basics
Installing Mercurial on Your System
Windows
Mac OS X
Linux
Solaris
Getting Started
Built-In Help
Working with a Repository
Making a Local Copy of a Repository
What’s in a Repository?
A Tour Through History
Changesets, Revisions, and Talking to Other People
Viewing Specific Revisions
More Detailed Information
All About Command Options
Making and Reviewing Changes
Recording Changes in a New Changeset
Setting Up a Username
Creating a Mercurial configuration file
Writing a Commit Message
Writing a Good Commit Message
Aborting a Commit
Admiring Our New Handiwork
Sharing Changes
Pulling Changes from Another Repository
Updating the Working Directory
Pushing Changes to Another Repository
Default Locations
Sharing Changes over a Network
Starting a New Project
A Tour of Mercurial: Merging Work
Merging Streams of Work
Head Changesets
Performing the Merge
Committing the Results of the Merge
Merging Conflicting Changes
Using a Graphical Merge Tool
A Worked Example
Simplifying the Pull-Merge-Commit Sequence
Renaming, Copying, and Merging
Behind the Scenes
Mercurial’s Historical Record
Tracking the History of a Single File
Managing Tracked Files
Recording Changeset Information
Relationships Between Revisions
Safe, Efficient Storage
Efficient Storage
Safe Operation
Fast Retrieval
Identification and Strong Integrity
Revision History, Branching, and Merging
The Working Directory
What Happens When You Commit
Creating a New Head
Merging Changes
Merging and Renames
Other Interesting Design Features
Clever Compression
Read/Write Ordering and Atomicity
Concurrent Access
Avoiding Seeks
Other Contents of the Dirstate
Mercurial in Daily Use
Telling Mercurial Which Files to Track
Explicit Versus Implicit File Naming
Mercurial Tracks Files, Not Directories
How to Stop Tracking a File
Removing a File Does Not Affect Its History
Missing Files
Useful Shorthand: Adding and Removing Files in One Step
Copying Files
The Results of Copying During a Merge
Why Should Changes Follow Copies?
How to Make Changes Not Follow a Copy
Behavior of the hg copy Command
Renaming Files
Renaming Files and Merging Changes
Divergent Renames and Merging
Convergent Renames and Merging
Other Name-Related Corner Cases
Recovering from Mistakes
Dealing with Tricky Merges
File Resolution States
Resolving a File Merge
More Useful Diffs
Which Files to Manage, and Which to Avoid
Backups and Mirroring
Collaborating with Other People
Mercurial’s Web Interface
Collaboration Models
Factors to Keep in Mind
Informal Anarchy
A Single Central Repository
A Hosted Central Repository
Working with Multiple Branches
Feature Branches
The Release Train
The Linux Kernel Model
Pull-Only Versus Shared-Push Collaboration
Where Collaboration Meets Branch Management
The Technical Side of Sharing
Informal Sharing with hg serve
A Few Things to Keep in Mind
Using the Secure Shell Protocol
How to Read and Write ssh URLs
Finding an ssh Client for Your System
Generating a Key Pair
Using an Authentication Agent
Configuring the Server Side Properly
Using Compression with ssh
Serving Over HTTP Using CGI
Web Server Configuration Checklist
Basic CGI Configuration
What could possibly go wrong?
Sharing Multiple Repositories with One CGI Script
Downloading Source Archives
Web Configuration Options
System-Wide Configuration
Making Mercurial More Trusting
Filenames and Pattern Matching
Simple File Naming
Running Commands Without Any Filenames
Telling You What’s Going On
Using Patterns to Identify Files
Shell-Style Glob Patterns
Regular Expression Matching with Re Patterns
Filtering Files
Permanently Ignoring Unwanted Files and Directories
Case Sensitivity
Safe, Portable Repository Storage
Detecting Case Conflicts
Fixing a Case Conflict
CHAPTER 8
Managing Releases and Branchy Development
Giving a Persistent Name to a Revision
Handling Tag Conflicts During a Merge
Tags and Cloning
When Permanent Tags Are Too Much
The Flow of Changes: Big Picture Versus Little Picture
Managing Big-Picture Branches in Repositories
Don’t Repeat Yourself: Merging Across Branches
Naming Branches Within One Repository
Dealing with Multiple Named Branches in a Repository
Branch Names and Merging
Branch Naming Is Generally Useful
CHAPTER 9
Finding and Fixing Mistakes
Erasing Local History
The Accidental Commit
Rolling Back a Transaction
The Erroneous Pull
Rolling Back Is Useless Once You’ve Pushed
You Can Only Roll Back Once
Reverting the Mistaken Change
What to Do About Sensitive Changes That Escape
Finding the Source of a Bug
Using the hg bisect Command
Cleaning Up After Your Search
Tips for Finding Bugs Effectively
Give Consistent Input
Automate As Much As Possible
Check Your Results
Beware Interference Between Bugs
Bracket Your Search Lazily
CHAPTER 10
Handling Repository Events with Hooks
An Overview of Hooks in Mercurial
Hooks and Security
Hooks Are Run with Your Privileges
Hooks Do Not Propagate
Hooks Can Be Overridden
Ensuring That Critical Hooks Are Run
A Short Tutorial on Using Hooks
Performing Multiple Actions Per Event
Controlling Whether an Activity Can Proceed
Writing Your Own Hooks
Choosing How Your Hook Should Run
Hook Parameters
Hook Return Values and Activity Control
Writing an External Hook
Telling Mercurial to Use an In-Process Hook
Writing an In-Process Hook
Some Hook Examples
Writing Meaningful Commit Messages
Checking for Trailing Whitespace
Bundled Hooks
acl—Access Control for Parts of a Repository
bugzilla—Integration with Bugzilla
Configuring the bugzilla hook
notify—Send Email Notifications
Information for Writers of Hooks
In-Process Hook Execution
External Hook Execution
Finding Out Where Changesets Come From
Sources of changesets
Hook Reference
changegroup—After Remote Changesets Added
commit—After a New Changeset Is Created
incoming—After One Remote Changeset Is Added
outgoing—After Changesets Are Propagated
prechangegroup—Before Starting to Add Remote Changesets
precommit—Before Starting to Commit a Changeset
preoutgoing—Before Starting to Propagate Changesets
pretag—Before Tagging a Changeset
pretxnchangegroup—Before Completing Addition of Remote Changesets
pretxncommit—Before Completing Commit of New Changeset
preupdate—Before Updating or Merging Working Directory
tag—After Tagging a Changeset
update—After Updating or Merging Working Directory
The Patch Management Problem
The Prehistory of Mercurial Queues
A Patchwork Quilt
From Patchwork Quilt to Mercurial Queues
The Huge Advantage of MQ
Understanding Patches
Getting Started with Mercurial Queues
Creating a New Patch
Refreshing a Patch
Stacking and Tracking Patches
Manipulating the Patch Stack
Pushing and Popping Many Patches
Safety Checks, and Overriding Them
Working on Several Patches at Once
More About Patches
The Strip Count
Strategies for Applying a Patch
Some Quirks of Patch Representation
Beware the Fuzz
Handling Rejection
More on Patch Management
Deleting Unwanted Patches
Converting to and from Permanent Revisions
Getting the Best Performance Out of MQ
Updating Your Patches When the Underlying Code Changes
Identifying Patches
Useful Things to Know About
Managing Patches in a Repository
MQ Support for Patch Repositories
A Few Things to Watch Out For
Third-Party Tools for Working with Patches
Good Ways to Work with Patches
MQ Cookbook
Managing “Trivial” Patches
Combining Entire Patches
Merging Part of One Patch into Another
Differences Between Quilt and MQ
Advanced Uses of Mercurial Queues
The Problem of Many Targets
Tempting Approaches That Don’t Work Well
Conditionally Applying Patches with Guards
Controlling the Guards on a Patch
Selecting the Guards to Use
MQ’s Rules for Applying Patches
Trimming the Work Environment
Dividing Up the Series File
Maintaining the Patch Series
The Art of Writing Backport Patches
Useful Tips for Developing with MQ
Organizing Patches in Directories
Viewing the History of a Patch
Adding Functionality with Extensions
Improve Performance with the inotify Extension
Flexible Diff Support with the extdiff Extension
Defining Command Aliases
Cherry-Picking Changes with the transplant Extension
Sending Changes via Email with the patchbomb Extension
Mercurial Queues Reference
qpush—Push Patches onto the Stack
Installing Mercurial from Source
Open Publication License
License Options
Index
P. 1
Mercurial: The Definitive Guide: The Definitive Guide

Mercurial: The Definitive Guide: The Definitive Guide

Ratings:

3.0

(3)
|Views: 202 |Likes:

This instructive book takes you step by step through ways to track, merge, and manage both open source and commercial software projects with Mercurial, using Windows, Mac OS X, Linux, Solaris, and other systems. Mercurial is the easiest system to learn when it comes to distributed revision control. And it's a very flexible tool that's ideal whether you're a lone programmer working on a small project, or part of a huge team dealing with thousands of files.

Mercurial permits a countless variety of development and collaboration methods, and this book offers several concrete suggestions to get you started. This guide will help you:

Learn the basics of working with a repository, changesets, and revisions Merge changes from separate repositories Set up Mercurial to work with files on a daily basis, including which ones to track Get examples and tools for setting up various workflow models Manage a project that's making progress on multiple fronts at once Find and fix mistakes by isolating problem sources Use hooks to perform actions automatically in response to repository events Customize the output of Mercurial

Mercurial: The Definitive Guide maintains a strong focus on simplicity to help you learn Mercurial quickly and thoroughly.

This instructive book takes you step by step through ways to track, merge, and manage both open source and commercial software projects with Mercurial, using Windows, Mac OS X, Linux, Solaris, and other systems. Mercurial is the easiest system to learn when it comes to distributed revision control. And it's a very flexible tool that's ideal whether you're a lone programmer working on a small project, or part of a huge team dealing with thousands of files.

Mercurial permits a countless variety of development and collaboration methods, and this book offers several concrete suggestions to get you started. This guide will help you:

Learn the basics of working with a repository, changesets, and revisions Merge changes from separate repositories Set up Mercurial to work with files on a daily basis, including which ones to track Get examples and tools for setting up various workflow models Manage a project that's making progress on multiple fronts at once Find and fix mistakes by isolating problem sources Use hooks to perform actions automatically in response to repository events Customize the output of Mercurial

Mercurial: The Definitive Guide maintains a strong focus on simplicity to help you learn Mercurial quickly and thoroughly.

More info:

Publish date: Jun 16, 2009
Added to Scribd: Sep 05, 2011
Copyright:Traditional Copyright: All rights reservedISBN:9780596551292
List Price: $35.99 Buy Now

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
See more
See less

07/22/2014

282

9780596551292

$35.99

USD

pdf

You're Reading a Free Preview
Pages 12 to 144 are not shown in this preview.
You're Reading a Free Preview
Pages 156 to 189 are not shown in this preview.
You're Reading a Free Preview
Pages 204 to 243 are not shown in this preview.
You're Reading a Free Preview
Pages 255 to 282 are not shown in this preview.

Activity (2)

You've already reviewed this. Edit your review.
1 thousand reads
1 hundred reads

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->