Merge lp:~mbp/bzr/doc into lp:bzr

Proposed by Martin Pool
Status: Merged
Approved by: Vincent Ladeuil
Approved revision: no longer in the source branch.
Merged at revision: 5420
Proposed branch: lp:~mbp/bzr/doc
Merge into: lp:bzr
Diff against target: 107 lines (+53/-4)
3 files modified
bzrlib/builtins.py (+3/-0)
doc/developers/code-style.txt (+32/-0)
doc/developers/ppa.txt (+18/-4)
To merge this branch: bzr merge lp:~mbp/bzr/doc
Reviewer Review Type Date Requested Status
Vincent Ladeuil Needs Fixing
Review via email: mp+35243@code.launchpad.net

Commit message

various developer document improvements

Description of the change

Add a few more developer guidelines.

To post a comment you must log in.
Revision history for this message
Vincent Ladeuil (vila) wrote :

BB:tweak

s/I think//

otherwise, fine.

review: Needs Fixing
Revision history for this message
Martin Pool (mbp) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bzrlib/builtins.py'
--- bzrlib/builtins.py 2010-08-31 08:57:28 +0000
+++ bzrlib/builtins.py 2010-09-13 08:23:41 +0000
@@ -3481,6 +3481,9 @@
3481 If you set BZR_TEST_PDB=1 when running selftest, failing tests will drop3481 If you set BZR_TEST_PDB=1 when running selftest, failing tests will drop
3482 into a pdb postmortem session.3482 into a pdb postmortem session.
34833483
3484 The --coverage=DIRNAME global option produces a report with covered code
3485 indicated.
3486
3484 :Examples:3487 :Examples:
3485 Run only tests relating to 'ignore'::3488 Run only tests relating to 'ignore'::
34863489
34873490
=== modified file 'doc/developers/code-style.txt'
--- doc/developers/code-style.txt 2010-06-02 04:39:08 +0000
+++ doc/developers/code-style.txt 2010-09-13 08:23:41 +0000
@@ -101,6 +101,38 @@
101 if getattr(thing, 'name', None) is None101 if getattr(thing, 'name', None) is None
102102
103103
104kwargs
105======
106
107``**kwargs`` in the prototype of a function should be used sparingly.
108It can be good on higher-order functions that decorate other functions,
109such as ``addCleanup`` or ``assertRaises``, or on functions that take only
110(or almost only) kwargs, where any kwargs can be passed.
111
112Otherwise, be careful: if the parameters to a function are a bit complex
113and might vary over time (e.g. the ``commit`` API) then we prefer to pass an
114object rather than a bag of positional and/or keyword args. If you have
115an arbitrary set of keys and values that are different with each use (e.g.
116string interpolation inputs) then again that should not be mixed in with
117the regular positional/keyword args, it seems like a different category of
118thing.
119
120
121Imitating standard objects
122==========================
123
124Don't provide methods that imitate built-in classes (eg ``__in__``,
125``__call__``, ``__int__``, ``__getitem__``) unless the class you're
126implementing really does act like the builtin class, in semantics and
127performance.
128
129For example, old code lets you say ``file_id in inv`` but we no longer
130consider this good style. Instead, say more explicitly
131``inv.has_id(file_id)``.
132
133``__repr__``, ``__cmp__``, ``__str__`` are usually fine.
134
135
104Module Imports136Module Imports
105==============137==============
106138
107139
=== modified file 'doc/developers/ppa.txt'
--- doc/developers/ppa.txt 2010-08-27 00:33:07 +0000
+++ doc/developers/ppa.txt 2010-09-13 08:23:41 +0000
@@ -15,8 +15,9 @@
1515
16As of June 2010, there are three PPAs:16As of June 2010, there are three PPAs:
1717
18<https://launchpad.net/~bzr/+archive>18<https://launchpad.net/~bzr/+archive/ppa>
19 Final released versions and updates.19 Final released versions and updates.
20 Most users who want updates to bzr should add this.
2021
21<https://launchpad.net/~bzr/+archive/proposed>22<https://launchpad.net/~bzr/+archive/proposed>
22 Proposed uploads to move into ~bzr, awaiting testing.23 Proposed uploads to move into ~bzr, awaiting testing.
@@ -130,12 +131,12 @@
130* Now merge across that change into each supported branch with a 131* Now merge across that change into each supported branch with a
131 simple ``bzr merge``.132 simple ``bzr merge``.
132 133
133Locally testing builds134Locally testing using pbuilder
134~~~~~~~~~~~~~~~~~~~~~~135~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
135136
136It may be useful to locally test builds inside pbuilder. You may want to 137It may be useful to locally test builds inside pbuilder. You may want to
137use the script from <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=255165> 138use the script from <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=255165>
138to wrap it.139to wrap it, and to give it sensible defaults for your local machine.
139140
140Update all packages in proposed before copping the main ppa141Update all packages in proposed before copping the main ppa
141~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~142~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -328,7 +329,20 @@
328 apt-cache madison bzr329 apt-cache madison bzr
329 330
330 331
332Testing the contents of the PPA
333-------------------------------
334
335A somewhat crude but useful way to test the contents of the PPA is to
336install the relevant packages into an schroot::
337
338 schroot -c hardy-test -u root -- \
339 apt-get install -o 'APT::Install-Suggests="true"' \
340 -o 'APT::Install-Recommends="true"' \
341 bzr
342
343This should make sure everything can be installed; it won't guarantee that
331 344
345
332Packaging dependencies346Packaging dependencies
333----------------------347----------------------
334348