Differences between revisions 5 and 6
Revision 5 as of 2007-06-13 15:13:22
Size: 709
Editor: 198
Comment: Typical of corporate processes
Revision 6 as of 2008-02-10 20:29:02
Size: 1860
Editor: abuehl
Comment: Merge from page FAQ/GeneralUsage
Deletions are marked like this. Additions are marked like this.
Line 14: Line 14:

=== What are some best practices for distributed development with Mercurial? ===

First, merge often! This makes merging easier for everyone and you
find out about conflicts (which are often rooted in incompatible
design decisions) earlier.

Second, don't hesitate to use multiple trees locally. Mercurial makes
this fast and light-weight. Typical usage is to have an incoming tree,
an outgoing tree, and a separate tree for each area being worked on.

The incoming tree is best maintained as a pristine copy of the
upstream [:Repository:repository]. This works as a cache so that you don't have to
[:Pull:pull] multiple copies over the network. No need to check files out here
as you won't be changing them.

The outgoing tree contains all the changes you intend for merge into
upstream. Publish this tree with {{{hg serve}}} or hgweb.cgi or use
{{{hg push}}}
to [:Push:push] it to another publicly availabe repository.

Then, for each feature you work on, create a new tree. Commit early
and commit often, merge with incoming regularly, and once you're
satisfied with your feature, pull the changes into your outgoing tree.

Mercurial working practices

This page documents some ways to use Mercurial. Because the software is flexible, there's no "right way", but some methods are more scalable than others.

Ways to collaborate

Name

Scalability

Overhead

Description

CvsLikePractice

poor

low

keep things simple, use a few central repositories

KernelPractice

good

medium

distributed, semi-hierarchical development

ControlledPractice

good

medium

hierarchical development

What are some best practices for distributed development with Mercurial?

First, merge often! This makes merging easier for everyone and you find out about conflicts (which are often rooted in incompatible design decisions) earlier.

Second, don't hesitate to use multiple trees locally. Mercurial makes this fast and light-weight. Typical usage is to have an incoming tree, an outgoing tree, and a separate tree for each area being worked on.

The incoming tree is best maintained as a pristine copy of the upstream [:Repository:repository]. This works as a cache so that you don't have to [:Pull:pull] multiple copies over the network. No need to check files out here as you won't be changing them.

The outgoing tree contains all the changes you intend for merge into upstream. Publish this tree with hg serve or hgweb.cgi or use hg push to [:Push:push] it to another publicly availabe repository.

Then, for each feature you work on, create a new tree. Commit early and commit often, merge with incoming regularly, and once you're satisfied with your feature, pull the changes into your outgoing tree.

WorkingPractices (last edited 2013-08-31 09:38:15 by rcl)