From eda9590aae3ef617a765bb5d925b8e25ca205f7f Mon Sep 17 00:00:00 2001 From: Dave Cheney Date: Sun, 10 Feb 2013 19:40:33 -0500 Subject: [PATCH] doc: update contribute.html Fixes #4582. * mentioned hg upload. * added section on hg file. * added small mention about being inside $GOROOT. * added hg revert @NNNN * reorganise the hg submit section for the common case of a non committer. * made the Copyright section h2 * added note about leaving copyright years unchanged. R=golang-dev, metanata4, shivakumar.gn, minux.ma, adg, shanemhansen CC=golang-dev, metanata4 https://golang.org/cl/7278047 --- doc/contribute.html | 140 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 111 insertions(+), 29 deletions(-) diff --git a/doc/contribute.html b/doc/contribute.html index 494f05880b..caff6ce20e 100644 --- a/doc/contribute.html +++ b/doc/contribute.html @@ -112,7 +112,9 @@ you are a committer (see below), but Mercurial complains if it is missing.

After adding the extension, hg help codereview -will show documentation for its commands. +will show documentation for its commands. As the codereview extension is only +enabled for your checkout in $GOROOT, the remainder of this +document assumes you are inside $GOROOT when issuing commands.

Log in to the code review site.

@@ -282,22 +284,37 @@ which hg change will print, something like: CL created: http://codereview.appspot.com/99999 +

Adding or removing files from an existing change

+

If you need to re-edit the change description, or change the files included in the CL, -run hg change 99999. Alternatively, you can use hg file 99999 somefile -to add somefile to CL 99999, and use hg file -d 99999 somefile to remove -somefile from the CL. +run hg change 99999.

-Creating the change uploads a copy of the diff to the code review server, but it does not -notify anyone about it. To do that, you need to run hg mail (see below). +Alternatively, you can use +

+ +

+$ hg file 99999 somefile
+
+ +

+to add somefile to CL 99999, and

+
+$ hg file -d 99999 somefile
+
+

-You can see a list of your pending changes by running hg pending (hg p for short). +to remove somefile from the CL.

+

+A file may only belong to a single active CL at a time. hg file +will issue a warning if a file is moved between changes. +

Synchronize your client

@@ -390,6 +407,12 @@ changes, but you may still need to run

Mail the change for review

+

+Creating or uploading the change uploads a copy of the diff to the code review server, +but it does not notify anyone about it. To do that, you need to run hg mail +(see below). +

+

To send out a change for review, run hg mail using the change list number assigned during hg change:

@@ -411,6 +434,10 @@ $ hg mail -r golang-dev@googlegroups.com --cc math-nuts@swtch.com 99999

Note that -r and --cc cannot be spelled --r or -cc.

+

+If your change relates to an open issue, please add a comment to the issue +announcing your proposed fix, including a link to your CL. +

Reviewing code

@@ -424,7 +451,18 @@ to send comments back.

Revise and upload

-

You will probably revise your code in response to the reviewer comments. +

+You will probably revise your code in response to the reviewer comments. When +you have done this, you can upload your change to the code review server +without sending a notification by running hg upload using the change +list number assigned during hg change +

+ +
+$ hg upload 99999
+
+ +

When you have revised the code and are ready for another round of review, run

@@ -445,39 +483,58 @@ The reviewer approves the change by replying with a mail that says LGTM: looks good to me.

-

Submit the change after the review

+

+You can see a list of your pending changes by running hg pending (hg p for short). +

+ +

Reviewing code by others

-After the code has been LGTM'ed, it is time to submit -it to the Mercurial repository. -If you are a committer, you can run: +You can import a CL proposed by someone else into your local Mercurial client +by using the hg clpatch command. Running

-$ hg submit 99999
+$ hg clpatch 99999
 

-This checks the change into the repository. -The change description will include a link to the code review, -and the code review will be updated with a link to the change -in the repository. +will apply the latest diff for CL 99999 to your working copy. If any of the +files referenced in CL 99999 have local modifications, clpatch +will refuse to apply the whole diff. Once applied, CL 99999 will show up in +the output of hg pending and others.

-If your local copy of the repository is out of date, -hg submit -will refuse the change: +To revert a CL you have applied locally, use the hg revert +command. Running

-$ hg submit 99999
-local repository out of date; must sync before submit
+$ hg revert @99999
 
+

+will revert any files mentioned on CL 99999 to their original state. This can +be an effective way of reverting one CL revision and applying another. +

+ +

+Once the CL has been submitted, the next time you run hg sync +it will be removed from your local pending list. Occasionally the pending list +can get out of sync leaving stale references to closed or abandoned CLs. +You can use hg change -D 99999 to remove the reference to CL 99999. + +

Submit the change after the review

+ +

+After the code has been LGTM'ed, it is time to submit +it to the Mercurial repository. +

+

If you are not a committer, you cannot submit the change directly. -Instead, a committer, usually the reviewer who said LGTM, +Instead a committer, usually the reviewer who said LGTM, will run:

@@ -486,19 +543,39 @@ $ hg clpatch 99999 $ hg submit 99999 -

The clpatch command imports your change 99999 into -the committer's local Mercurial client, at which point the committer -can check or test the code more. -(Anyone can run clpatch to try a change that -has been uploaded to the code review server.) The submit command submits the code. You will be listed as the author, but the change message will also indicate who the committer was. Your local client will notice that the change has been submitted when you next run hg sync.

+

+If you are a committer, you can run: +

+ +
+$ hg submit 99999
+
+ +

+This checks the change into the repository. +The change description will include a link to the code review, +and the code review will be updated with a link to the change +in the repository. +

+ +

+If your local copy of the repository is out of date, +hg submit +will refuse the change: +

+ +
+$ hg submit 99999
+local repository out of date; must sync before submit
+
- +

Files in the Go repository don't list author names, both to avoid clutter and to avoid having to keep the lists up to date. @@ -541,3 +618,8 @@ This rigmarole needs to be done only for your first submission. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. + +

+Files in the repository are copyright the year they are added. It is not +necessary to update the copyright year on files that you change. +

-- 2.48.1