|
SubmittingCode
Submitting code to the wave-protocol repository
The process for submitting a patch to the wave-protocol repository is:
Clone the wave-protocol repository$ hg clone https://wave-protocol.googlecode.com/hg/ wave-protocol Or $ hg pull $ hg update StyleTake care to conform to the style of the file you're patching. If in doubt follow Sun's Java style guide. The following should also be observed when submitting code:
In addition, reading Effective Java it is strongly suggested. Make changesIf you add files then remember to hg add them. You can check the status of important files using hg -arm and hg diff. Use request_codereview scriptWe use the Rietveld code review tool to submit a code review. This looks at the difference between the tip of the repository (or a specific version with --rev) and its current state, and uploads it to http://codereview.waveprotocol.org for other people to comment on. We use this both as a mechanism for distributing patches, and as a way to ensure they are a suitably high quality. $ ./request_codereview --send_mail -e me@gmail.com -m "Short description of patch"
You can view your patch at http://codereview.waveprotocol.org. Log in for a more detailed overview. Wait for reviewersReviewers (probably the wave-protocol maintainers, though anybody is welcome) will comment on your patch, either inline or with an overall comment. Look out for the phrase LGTM ("Looks Good To Me"). You should revise the code if requested, and reply to the comments either with "Done." or a more detailed response if necessary. Submitting your patchAfter an LGTM or two, a maintainer will download your patch from Rietveld and submit it to the mainline repository. ExampleFor an example, we change the client's scrolling keys to be [ and ] instead of { and }. $ hg clone https://wave-protocol.googlecode.com/hg/ wave-protocol $ cd wave-protocol $ vim `find . -name ConsoleClient.java` ... $ hg stat -arm M src/org/waveprotocol/wave/examples/fedone/waveclient/console/ConsoleClient.java $ hg diff
diff -r 9fb7aab3e2a9 src/org/waveprotocol/wave/examples/fedone/waveclient/console/ConsoleClient.java
--- a/src/org/waveprotocol/wave/examples/fedone/waveclient/console/ConsoleClient.java Thu Aug 20 14:18:49 2009 +1000
+++ b/src/org/waveprotocol/wave/examples/fedone/waveclient/console/ConsoleClient.java Sun Aug 23 12:29:51 2009 +1000
@@ -114,7 +114,7 @@
// Set up scrolling -- these are the opposite to how you would expect because of the way that
// the waves are scrolled (where the bottom is treated as the top)
- reader.addTriggeredAction('}', new ActionListener() {
+ reader.addTriggeredAction(']', new ActionListener() {
@Override public void actionPerformed(ActionEvent e) {
if (isWaveOpen()) {
openWave.scrollUp(scrollLines.get());
@@ -123,7 +123,7 @@
}
});
- reader.addTriggeredAction('{', new ActionListener() {
+ reader.addTriggeredAction('[', new ActionListener() {
@Override public void actionPerformed(ActionEvent e) {
if (isWaveOpen()) {
openWave.scrollDown(scrollLines.get());$ ./request_codereview --send_mail -e example@gmail.com -m "Console client: use [ and ] rather than { and } to scroll"
Upload server: codereview.waveprotocol.org (change with -s/--server)
Loaded authentication cookies from /Users/example/.codereview_upload_cookies
Issue created. URL: http://codereview.waveprotocol.org/8002
Uploading base file for src/org/waveprotocol/wave/examples/fedone/waveclient/console/ConsoleClient.java
|