From 47895826360e9f38de6a0d8c4c02d433daddf321 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Wed, 2 Jun 2010 17:11:52 -0700 Subject: doc: codereview + Mercurial Queues R=rsc, r CC=golang-dev http://codereview.appspot.com/1238044 Committer: Russ Cox --- doc/codereview_with_mq.html | 113 ++++++++++++++++++++++++++++++++++++++++++++ doc/contribute.html | 6 +-- 2 files changed, 115 insertions(+), 4 deletions(-) create mode 100644 doc/codereview_with_mq.html (limited to 'doc') diff --git a/doc/codereview_with_mq.html b/doc/codereview_with_mq.html new file mode 100644 index 000000000..7b2e0f3bf --- /dev/null +++ b/doc/codereview_with_mq.html @@ -0,0 +1,113 @@ + + +

Introduction

+ +

+The Mercurial Queues extension (mq) provides a mechanism for +managing patches on top of a Mercurial repository and is described in detail +in Chapters +12 +and 13 +of Mercurial: The Definitive Guide. +This document explains how to use mq in conjunction +with the codereview Mercurial extension described in the +instructions for contributing to the Go project. +It assumes you have read those instructions. +

+ +

Configuration

+ +

+To enable mq edit either $HOME/.hgrc (to enable it +for all of your repositories) or $GOROOT/.hg/hgrc (to enable it for the +repository at $GOROOT) to add:

+ +
+[extensions]
+mq=
+
+ +

+Since pulling, pushing, updating and committing while mq patches +are applied can damage your repository or a remote one, add these lines to +prevent that case: +

+ +
+[hooks]
+# Prevent "hg pull" if MQ patches are applied.
+prechangegroup.mq-no-pull = ! hg qtop > /dev/null 2>&1
+# Prevent "hg push" if MQ patches are applied.
+preoutgoing.mq-no-push = ! hg qtop > /dev/null 2>&1
+# Prevent "hg update" if MQ patches are applied.
+preupdate.mq-no-update = ! hg qtop > /dev/null 2>&1
+
+ +

Making a change

+ +

+The entire checked-out tree is writable and you can use mq, +as documented in Chapter +12 +of "The Guide", +to implement your change as a single patch or a series of patches. + +

+ +

When you are ready to send a change out for review, run

+ +
+$ hg change
+
+ +

from any directory in your Go repository with all of the mq patches relevant to your +change applied and then proceed as instructed in contributing +to the Go project. +

+ +

+The change number reported by hg change, preceded by a +, +can be used as an mq patch guard to assist in controlling which patches +are applied as described in Chapter +13 +of "The Guide". +For example, the command: +

+ +
+for p in $(hg qapplied); do hg qguard $p +99999; done
+
+ +

+will apply the guard +99999 guard to all currently applied mq +patches. +

+ +

Synchronizing your client

+ +

While you were working, others might have submitted changes +to the repository and, as explained in contributing +to the Go project, it is necessary to synchronize your repository using +hg syncbefore sending your change list for review. +Because hg sync runs hg pull -u, +you should not run hg sync while mq patches are +applied. Instead +pop all your patches before running hg sync and reapply them after +it has completed. +

+ +

+When reapplying the patches, you may need to resolve conflicts +as described in contributing to the Go project. +

+ +

Mailing the change for review

+ +

+You should have all of the mq patches relevant to your +change applied when you run hg mail. + +

Submitting the change after the review

+ +If you are a committer, you should have all of the mq patches relevant to your +change applied when you run hg commit. diff --git a/doc/contribute.html b/doc/contribute.html index f7fa4490b..6814274ba 100644 --- a/doc/contribute.html +++ b/doc/contribute.html @@ -103,10 +103,8 @@ command.

-Mercurial power users: To allow Go contributors to take advantage of -Mercurial's functionality for local revision control, it might be interesting -to explore how the code review extension can be made to work alongside -the Mercurial Queues extension. +Mercurial power users: if you prefer to use the Mercurial Queues extension, see +Using Mercurial Queues with Codereview.

Configure the extension

-- cgit v1.2.3