/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to doc/en/developer-guide/HACKING.txt

  • Committer: Robert Collins
  • Date: 2009-05-23 20:57:12 UTC
  • mfrom: (4371 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4441.
  • Revision ID: robertc@robertcollins.net-20090523205712-lcwbfqk6vwavinuv
MergeĀ .dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
document, send a merge request or new text to the mailing list.
13
13
 
14
14
The current version of this document is available in the file 
15
 
``doc/developers/HACKING.txt`` in the source tree, or at
 
15
``doc/en/developer-guide/HACKING.txt`` in the source tree, or at
16
16
http://doc.bazaar-vcs.org/bzr.dev/en/developer-guide/HACKING.html
17
17
 
18
18
See also:
209
209
 
210
210
 
211
211
 
212
 
Sending patches for review
213
 
==========================
214
 
 
215
 
If you'd like to propose a change, please post to the
216
 
bazaar@lists.canonical.com list with a bundle, patch, or link to a
217
 
branch. Put ``[PATCH]`` or ``[MERGE]`` in the subject so Bundle Buggy
218
 
can pick it out, and explain the change in the email message text.
219
 
Remember to update the NEWS file as part of your change if it makes any
220
 
changes visible to users or plugin developers. Please include a diff
221
 
against mainline if you're giving a link to a branch.
222
 
 
223
 
You can generate a merge request like this::
224
 
 
225
 
  bzr send -o bug-1234.patch
226
 
  
227
 
A ``.patch`` extension is recommended instead of .bundle as many mail clients
228
 
will send the latter as a binary file.
229
 
 
230
 
``bzr send`` can also send mail directly if you prefer; see the help.
231
 
 
232
 
Please do **NOT** put [PATCH] or [MERGE] in the subject line if you don't
233
 
want it to be merged. If you want comments from developers rather than
234
 
to be merged, you can put ``[RFC]`` in the subject line.
235
 
 
236
 
If this change addresses a bug, please put the bug number in the subject
237
 
line too, in the form ``[#1]`` so that Bundle Buggy can recognize it.
238
 
 
239
 
If the change is intended for a particular release mark that in the
240
 
subject too, e.g. ``[1.6]``.
241
212
 
242
213
 
243
214
Review cover letters
332
303
* (your ideas here...)
333
304
 
334
305
 
335
 
Bundle Buggy and review outcomes
336
 
================================
337
 
 
 
306
Reviews on Launchpad
 
307
====================
 
308
 
 
309
From May 2009 on, we prefer people to propose code reviews through
 
310
Launchpad.  
 
311
 
 
312
 * <https://launchpad.net/+tour/code-review>
 
313
 
 
314
 * <https://help.launchpad.net/Code/Review>
 
315
 
 
316
Anyone can propose or comment on a merge propsal just by creating a
 
317
Launchpad account.
 
318
 
 
319
There are two ways to create a new merge proposal: through the web
 
320
interface or by email.
 
321
 
 
322
 
 
323
Proposing a merge through the web
 
324
---------------------------------
 
325
 
 
326
To create the propsal through the web: push your branch to Launchpad, eg::
 
327
 
 
328
  bzr push lp:~mbp/bzr/doc
 
329
 
 
330
then go to the branch's web page, which in this case would be
 
331
<https://code.launchpad.net/~mbp/bzr/doc>.  You can automate that by just
 
332
running ::
 
333
 
 
334
  bzr lp-open
 
335
 
 
336
You can then click "Propose for merging into another branch", and enter a
 
337
cover letter into the web form.  Typically you'll want to merge into
 
338
``~bzr/bzr/trunk`` which will be the default; you might also want to
 
339
nominate merging into a release branch for a bug fix.  There is the option
 
340
to specify a specific reviewer or type of review, and you shouldn't
 
341
normally change those.
 
342
 
 
343
Submitting the form takes you to the new page about the merge proposal
 
344
containing the diff of the changes, comments by interested people, and
 
345
controls to comment or vote on the change.
 
346
 
 
347
Proposing a merge by mail
 
348
-------------------------
 
349
 
 
350
To propose a merge by mail, send a bundle to ``merge@code.launchpad.net``.
 
351
 
 
352
You can generate a merge request like this::
 
353
 
 
354
  bzr send -o bug-1234.diff
 
355
  
 
356
``bzr send`` can also send mail directly if you prefer; see the help.
 
357
 
 
358
Reviewing changes
 
359
-----------------
 
360
 
 
361
From <https://code.launchpad.net/bzr/+activereviews> you can see all
 
362
currently active reviews, and choose one to comment on.  This page also
 
363
shows proposals that are now approved and should be merged by someone with
 
364
PQM access.
 
365
 
 
366
 
 
367
Reviews through Bundle Buggy
 
368
============================
 
369
 
 
370
The Bundle Buggy tool used up to May 2009 is still available as a review
 
371
mechanism.
 
372
 
 
373
Sending patches for review
 
374
--------------------------
 
375
 
 
376
If you'd like to propose a change, please post to the
 
377
bazaar@lists.canonical.com list with a bundle, patch, or link to a
 
378
branch. Put ``[PATCH]`` or ``[MERGE]`` in the subject so Bundle Buggy
 
379
can pick it out, and explain the change in the email message text.
 
380
Remember to update the NEWS file as part of your change if it makes any
 
381
changes visible to users or plugin developers. Please include a diff
 
382
against mainline if you're giving a link to a branch.
 
383
 
 
384
You can generate a merge request like this::
 
385
 
 
386
  bzr send -o bug-1234.patch
 
387
  
 
388
A ``.patch`` extension is recommended instead of .bundle as many mail clients
 
389
will send the latter as a binary file.
 
390
 
 
391
``bzr send`` can also send mail directly if you prefer; see the help.
 
392
 
 
393
Please do **NOT** put [PATCH] or [MERGE] in the subject line if you don't
 
394
want it to be merged. If you want comments from developers rather than
 
395
to be merged, you can put ``[RFC]`` in the subject line.
 
396
 
 
397
If this change addresses a bug, please put the bug number in the subject
 
398
line too, in the form ``[#1]`` so that Bundle Buggy can recognize it.
 
399
 
 
400
If the change is intended for a particular release mark that in the
 
401
subject too, e.g. ``[1.6]``.
338
402
Anyone can "vote" on the mailing list by expressing an opinion. Core
339
403
developers can also vote using Bundle Buggy. Here are the voting codes and
340
404
their explanations.
385
449
We use 4 space indents for blocks, and never use tab characters.  (In vim,
386
450
``set expandtab``.)
387
451
 
388
 
No trailing white space is allowed.
 
452
Trailing white space should be avoided, but is allowed.
 
453
You should however not make lots of unrelated white space changes.
389
454
 
390
455
Unix style newlines (LF) are used.
391
456
 
699
764
=============
700
765
 
701
766
All code should be exercised by the test suite.  See `Guide to Testing
702
 
Bazaar <testing.html>`_ for detailed information about writing tests.
 
767
Bazaar <../../developers/testing.html>`_ for detailed information about writing tests.
703
768
 
704
769
 
705
770
Core Topics
824
889
should be only in the command-line tool.
825
890
 
826
891
 
 
892
Progress and Activity Indications
 
893
---------------------------------
 
894
 
 
895
bzrlib has a way for code to display to the user that stuff is happening
 
896
during a long operation.  There are two particular types: *activity* which
 
897
means that IO is happening on a Transport, and *progress* which means that
 
898
higher-level application work is occurring.  Both are drawn together by
 
899
the `ui_factory`.
 
900
 
 
901
Transport objects are responsible for calling `report_transport_activity`
 
902
when they do IO.
 
903
 
 
904
Progress uses a model/view pattern: application code acts on a
 
905
`ProgressTask` object, which notifies the UI when it needs to be
 
906
displayed.  Progress tasks form a stack.  To create a new progress task on
 
907
top of the stack, call `bzrlib.ui.ui_factory.nested_progress_bar()`, then
 
908
call `update()` on the returned ProgressTask.  It can be updated with just
 
909
a text description, with a numeric count, or with a numeric count and
 
910
expected total count.  If an expected total count is provided the view
 
911
can show the progress moving along towards the expected total.
 
912
 
 
913
The user should call `finish` on the `ProgressTask` when the logical
 
914
operation has finished, so it can be removed from the stack.
 
915
 
 
916
Progress tasks have a complex relatioship with generators: it's a very
 
917
good place to use them, but because python2.4 does not allow ``finally``
 
918
blocks in generators it's hard to clean them up properly.  In this case
 
919
it's probably better to have the code calling the generator allocate a
 
920
progress task for its use and then call `finalize` when it's done, which
 
921
will close it if it was not already closed.  The generator should also
 
922
finish the progress task when it exits, because it may otherwise be a long
 
923
time until the finally block runs.
 
924
 
827
925
 
828
926
Displaying help
829
927
===============