~ubuntu-branches/ubuntu/saucy/golang/saucy

« back to all changes in this revision

Viewing changes to doc/codereview_with_mq.html

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2013-07-08 05:52:37 UTC
  • mfrom: (29.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20130708055237-at01839e0hp8z3ni
Tags: 2:1.1-1ubuntu1
016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!--{
2
 
        "Title": "Using Mercurial Queues with Codereview"
3
 
}-->
4
 
 
5
 
<h2 id="Introduction">Introduction</h2>
6
 
 
7
 
<p>
8
 
The Mercurial Queues extension (<code>mq</code>) provides a mechanism for
9
 
managing patches on top of a Mercurial repository and is described in detail
10
 
in Chapters
11
 
<a href="http://hgbook.red-bean.com/read/managing-change-with-mercurial-queues.html">12</a>
12
 
and <a href="http://hgbook.red-bean.com/read/advanced-uses-of-mercurial-queues.html">13</a>
13
 
of <a href="http://hgbook.red-bean.com/read/">Mercurial: The Definitive Guide</a>.
14
 
This document explains how to use <code>mq</code> in conjunction
15
 
with the <code>codereview</code> Mercurial extension described in the
16
 
instructions for <a href="contribute.html">contributing to the Go project</a>.
17
 
It assumes you have read those instructions.
18
 
</p>
19
 
 
20
 
<h2>Configuration</h2>
21
 
 
22
 
<p>
23
 
To enable <code>mq</code> edit either <code>$HOME/.hgrc</code> (to enable it
24
 
for all of your repositories) or <code>$GOROOT/.hg/hgrc</code> (to enable it for the
25
 
repository at <code>$GOROOT</code>) to add:</p>
26
 
 
27
 
<pre>
28
 
[extensions]
29
 
mq=
30
 
</pre>
31
 
 
32
 
<p>
33
 
Since pulling, pushing, updating and committing while <code>mq</code> patches
34
 
are applied can damage your repository or a remote one, add these lines to
35
 
prevent that case: 
36
 
</p>
37
 
 
38
 
<pre>
39
 
[hooks]
40
 
# Prevent "hg pull" if MQ patches are applied.
41
 
prechangegroup.mq-no-pull = ! hg qtop > /dev/null 2>&amp;1
42
 
# Prevent "hg push" if MQ patches are applied.
43
 
preoutgoing.mq-no-push = ! hg qtop > /dev/null 2>&amp;1
44
 
# Prevent "hg update" if MQ patches are applied.
45
 
preupdate.mq-no-update = ! hg qtop > /dev/null 2>&amp;1
46
 
</pre>
47
 
 
48
 
<h2>Making a change</h2>
49
 
 
50
 
<p>
51
 
The entire checked-out tree is writable and you can use <code>mq</code>,
52
 
as documented in Chapter
53
 
<a href="http://hgbook.red-bean.com/read/managing-change-with-mercurial-queues.html">12</a>
54
 
of "The Guide",
55
 
to implement your change as a single patch or a series of patches.
56
 
 
57
 
</p>
58
 
 
59
 
<p>When you are ready to send a change out for review, run</p>
60
 
 
61
 
<pre>
62
 
$ hg change
63
 
</pre>
64
 
 
65
 
<p>from any directory in your Go repository with all of the <code>mq</code> patches relevant to your
66
 
change applied and then proceed as instructed in <a href="contribute.html">contributing
67
 
to the Go project</a>.
68
 
</p>
69
 
 
70
 
<p>
71
 
The change number reported by <code>hg change</code>, preceded by a <code>+</code>,
72
 
can be used as an <code>mq</code> patch guard to assist in controlling which patches
73
 
are applied as described in Chapter
74
 
<a href="http://hgbook.red-bean.com/read/advanced-uses-of-mercurial-queues.html">13</a>
75
 
of "The Guide".
76
 
For example, the command:
77
 
</p>
78
 
 
79
 
<pre>
80
 
for p in $(hg qapplied); do hg qguard $p +99999; done
81
 
</pre>
82
 
 
83
 
<p>
84
 
will apply the guard <code>+99999</code> guard to all currently applied <code>mq</code>
85
 
patches.
86
 
</p>
87
 
 
88
 
<h2>Synchronizing your client</h2>
89
 
 
90
 
<p>While you were working, others might have submitted changes
91
 
to the repository and, as explained in <a href="contribute.html">contributing
92
 
to the Go project</a>, it is necessary to synchronize your repository using
93
 
<code>hg sync</code>before sending your change list for review.
94
 
Because <code>hg sync</code> runs <code>hg pull -u</code>,
95
 
you should not run <code>hg sync</code> while <code>mq</code> patches are
96
 
applied. Instead
97
 
pop all your patches before running <code>hg sync</code> and reapply them after
98
 
it has completed.
99
 
</p>
100
 
 
101
 
<p>
102
 
When reapplying the patches, you may need to resolve conflicts
103
 
as described in <a href="contribute.html">contributing to the Go project</a>.
104
 
</p>
105
 
 
106
 
<h2>Mailing the change for review</h2>
107
 
 
108
 
<p>
109
 
You should have all of the <code>mq</code> patches relevant to your
110
 
change applied when you run <code>hg mail</code>.
111
 
 
112
 
<h2>Submitting the change after the review</h2>
113
 
 
114
 
If you are a committer, you should have all of the <code>mq</code> patches relevant to your
115
 
change applied when you run <code>hg commit</code>.