/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/user-guide/writing_a_plugin.txt

  • Committer: Jelmer Vernooij
  • Date: 2017-05-21 19:09:26 UTC
  • mfrom: (6622.1.36 breezy)
  • Revision ID: jelmer@jelmer.uk-20170521190926-5vtz8xaf0e9ylrpc
Merge rename to breezy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
Introduction
5
5
------------
6
6
 
7
 
Plugins are very similar to bzr core functionality.  They can import
8
 
anything in bzrlib.  A plugin may simply override standard functionality,
 
7
Plugins are very similar to brz core functionality.  They can import
 
8
anything in breezy.  A plugin may simply override standard functionality,
9
9
but most plugins supply new commands.
10
10
 
11
11
Creating a new command
12
12
----------------------
13
13
 
14
14
To create a command, make a new object that derives from
15
 
``bzrlib.commands.Command``, and name it ``cmd_foo``, where foo is the name of
 
15
``breezy.commands.Command``, and name it ``cmd_foo``, where foo is the name of
16
16
your command.  If you create a command whose name contains an underscore,
17
17
it will appear in the UI with the underscore turned into a hyphen.  For
18
18
example, `cmd_baz_import` will appear as `baz-import`.  For examples of how
19
19
to write commands, please see ``builtins.py``.
20
20
 
21
21
Once you've created a command you must register the command with
22
 
``bzrlib.commands.register_command(cmd_foo)``.  You must register the
23
 
command when your file is imported, otherwise bzr will not see it.
 
22
``breezy.commands.register_command(cmd_foo)``.  You must register the
 
23
command when your file is imported, otherwise brz will not see it.
24
24
 
25
25
Installing a hook
26
26
-----------------
40
40
Plugin searching rules
41
41
----------------------
42
42
 
43
 
Bzr will scan ``~/.bazaar/plugins``  and ``bzrlib/plugins`` for plugins
 
43
Bzr will scan ``~/.bazaar/plugins``  and ``breezy/plugins`` for plugins
44
44
by default.  You can override this with  ``BZR_PLUGIN_PATH``
45
45
(see `User Reference 
46
 
<../user-reference/configuration-help.html#bzr-plugin-path>`_ for details).
 
46
<../user-reference/configuration-help.html#brz-plugin-path>`_ for details).
47
47
 
48
48
Plugins may be either modules or packages.  If your plugin is a single
49
49
file, you can structure it as a module.  If it has multiple files, or if
50
 
you want to distribute it as a bzr branch, you should structure it as a
 
50
you want to distribute it as a brz branch, you should structure it as a
51
51
package, i.e. a directory with an ``__init__.py`` file.
52
52
 
53
53
More information
56
56
Please feel free to contribute your plugin to BzrTools, if you think it
57
57
would be useful to other people.
58
58
 
59
 
See the `Bazaar Developer Guide`_ for details on Bazaar's development
 
59
See the `Breezy Developer Guide`_ for details on Breezy's development
60
60
guidelines and policies.
61
61
 
62
 
.. _Bazaar Developer Guide: ../developer-guide/HACKING.html
 
62
.. _Breezy Developer Guide: ../developer-guide/HACKING.html