/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 HACKING

Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
209
209
> factory, then yes, foo_factory is what I would use.
210
210
 
211
211
 
 
212
Registries
 
213
----------
 
214
 
 
215
Several places in Bazaar use (or will use) a registry, which is a 
 
216
mapping from names to objects or classes.  The registry allows for 
 
217
loading in registered code only when it's needed, and keeping
 
218
associated information such as a help string or description.
 
219
 
 
220
 
212
221
Lazy Imports
213
222
------------
214
223
 
227
236
  from bzrlib import (
228
237
     errors,
229
238
     transport,
230
 
     foo as bar,
 
239
     revision as _mod_revision,
231
240
     )
232
241
  import bzrlib.transport
233
242
  import bzrlib.xml5
234
243
  """)
235
244
 
236
245
At this point, all of these exist as a ``ImportReplacer`` object, ready to
237
 
be imported once a member is accessed.
 
246
be imported once a member is accessed. Also, when importing a module into
 
247
the local namespace, which is likely to clash with variable names, it is
 
248
recommended to prefix it as ``_mod_<module>``. This makes it clean that
 
249
the variable is a module, and these object should be hidden anyway, since
 
250
they shouldn't be imported into other namespaces.
238
251
 
239
252
 
240
253
Modules versus Members
307
320
 
308
321
Writing tests
309
322
=============
 
323
 
310
324
In general tests should be placed in a file named test_FOO.py where 
311
325
FOO is the logical thing under test. That file should be placed in the
312
326
tests subdirectory under the package being tested.
341
355
    command changes its name or signature. Ideally only the tests for a
342
356
    given command are affected when a given command is changed.
343
357
 
 
358
 4. If you have a test which does actually require running bzr in a
 
359
    subprocess you can use ``run_bzr_subprocess``. By default the spawned
 
360
    process will not load plugins unless ``--allow-plugins`` is supplied.
 
361
 
 
362
 
344
363
Doctests
345
364
--------
346
365