~bzr-pqm/bzr/bzr.dev

2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
1
Using plugins
2
=============
3
4
.. Information on how to use plugins in Bazaar.
5
6
What is a plugin?
7
-----------------
8
1861.2.6 by Alexander Belchenko
branding: change Bazaar-NG to Bazaar
9
A plugin is an external component for Bazaar that is typically made by
2293.1.3 by Brad Crittenden
Updated version_info.txt for grammar changes
10
third parties. A plugin is capable of augmenting Bazaar by adding new
11
functionality.  A plugin can also change current Bazaar behavior by
2977.1.18 by Ian Clatworthy
chapter 2 tweaks
12
replacing current functionality. Sample applications of plugins are:
13
14
* overriding commands
15
* adding new commands
16
* providing additional network transports
17
* customizing log output.
18
  
19
The sky is the limit for the customization that can be done through plugins.
20
In fact, plugins often work as a way for developers to test new features for
21
Bazaar prior to inclusion in the official codebase. Plugins are helpful
22
at feature retirement time as well, e.g. deprecated file formats may one
23
day be removed from the Bazaar core and be made available as a plugin instead.
24
25
Plugins are good for users, good for external developers and good for
26
Bazaar itself.
1610.2.1 by James Blackwell
Copied in docs for wiki & First round cleanup
27
2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
28
Where to find plugins 
29
---------------------
30
2293.1.3 by Brad Crittenden
Updated version_info.txt for grammar changes
31
We keep our list of plugins on the http://bazaar-vcs.org/BzrPlugins page.
1610.2.1 by James Blackwell
Copied in docs for wiki & First round cleanup
32
2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
33
How to install a plugin 
34
-----------------------
35
2977.1.18 by Ian Clatworthy
chapter 2 tweaks
36
Installing a plugin is very easy! If not already created, create a
3104.2.5 by Ian Clatworthy
fix some broken links and make doc more Windows user friendly
37
``plugins`` directory under your Bazaar configuration directory,
38
``~/.bazaar/`` on Linux and
2977.1.18 by Ian Clatworthy
chapter 2 tweaks
39
``C:\Documents and Settings\<username>\Application Data\Bazaar\2.0\``
3104.2.5 by Ian Clatworthy
fix some broken links and make doc more Windows user friendly
40
on Windows. Within this directory (referred to as $BZR_HOME below),
41
each plugin is placed in its own subdirectory.
2601.1.3 by James Westby
Put plugin installation instructions before how to write them.
42
43
Plugins work particularly well with Bazaar branches. For example, to
2977.1.18 by Ian Clatworthy
chapter 2 tweaks
44
install the bzrtools plugins for your main user account on Linux,
45
one can perform the following:: 
2601.1.3 by James Westby
Put plugin installation instructions before how to write them.
46
47
    bzr branch http://panoramicfeedback.com/opensource/bzr/bzrtools
48
    ~/.bazaar/plugins/bzrtools
49
3104.2.5 by Ian Clatworthy
fix some broken links and make doc more Windows user friendly
50
When installing plugins, the directories that you install them in must
2601.1.3 by James Westby
Put plugin installation instructions before how to write them.
51
be valid python identifiers. This means that they can only contain
52
certain characters, notably they cannot contain hyphens (``-``). Rather
3104.2.5 by Ian Clatworthy
fix some broken links and make doc more Windows user friendly
53
than installing ``bzr-gtk`` to ``$BZR_HOME/plugins/bzr-gtk``, install it
54
to ``$BZR_HOME/plugins/gtk``.
2601.1.3 by James Westby
Put plugin installation instructions before how to write them.
55
2977.1.18 by Ian Clatworthy
chapter 2 tweaks
56
Alternative plugin locations
57
----------------------------
58
59
If you have the necessary permissions, plugins can also be installed on
60
a system-wide basis. Two locations are currently checked for plugins:
61
62
 1. the system location - bzrlib/plugins
63
 2. the personal location - $BZR_HOME/plugins.
64
65
On a Linux installation, these locations are typically
66
``/usr/lib/python2.4/site-packages/bzrlib/plugins/`` and
67
``$HOME/.bazaar/plugins/``.
68
On a Windows installation, the system location might be
69
``C:\\Program Files\\Bazaar\\plugins``
70
while the personal location might be
71
``C:\Documents and Settings\<username>\Application Data\Bazaar\2.0\plugins``.
72
73
One can additionally override the personal plugins location
74
by setting the environment variable ``BZR_PLUGIN_PATH``
75
to a directory that contains plugins.
76
2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
77
Listing the installed plugins
78
-----------------------------
79
80
To do this, use the plugins command like this::
81
82
    bzr plugins
83
84
The name, location and version of each plugin installed will be displayed.
85
2977.1.18 by Ian Clatworthy
chapter 2 tweaks
86
New commands added by plugins can be seen by running ``bzr help commands``.
87
The commands provided by a plugin are shown followed by the name of the
88
plugin in brackets.
89
2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
90
Popular plugins
91
---------------
92
2977.1.9 by Ian Clatworthy
first cut at Distributed collaboration chapter
93
Here is a sample of some of the more popular plugins.
2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
94
2977.1.9 by Ian Clatworthy
first cut at Distributed collaboration chapter
95
  ================ ================= ==================================
96
  Category         Name              Description
97
  ================ ================= ==================================
98
  GUI              QBzr              Qt-based GUI tools
99
  GUI              bzr-gtk           GTK-based GUI tools
100
  GUI              bzr-eclipse       Eclipse integration
2977.1.18 by Ian Clatworthy
chapter 2 tweaks
101
  General          bzrtools          misc. enhancements including shelf
2977.1.9 by Ian Clatworthy
first cut at Distributed collaboration chapter
102
  General          difftools         external diff tool helper
103
  General          extmerge          external merge tool helper
104
  Integration      bzr-svn           use Subversion as a repository
105
  Migration        cvsps             migrate CVS patch-sets
106
  ================ ================= ==================================
2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
107
108
If you wish to write your own plugins, it is not difficult to do.
109
See `Writing a plugin`_ in the appendices to get started.