5
Bazaar has a facility that allows you to associate a commit with a bug
6
in the project's bug tracker. Other tools can then use this information
7
to link between the commit and the bug, or to automatically mark the bug
8
closed in the branches that contain the commit.
10
Associating Commits and Bugs
11
============================
13
When you make a commit you can assiociate it with a bug by using the
14
``--fixes`` option of ``commit``. For example::
16
$ bzr commit --fixes 12345 -m 'Properly close the connection on errors'
18
This will set a revision property on the revision that is committed
19
which contains the URI at which more information on the bug can be found.
20
Bazaar itself does no more than this, but once the information is recorded
21
other tools can make use of it.
23
Configuration of the Bug Tracker
24
================================
26
As each project has it's own bug tracker, and there are many different
27
bug tracking systems you must first do some configuration before you
30
Bazaar currently implements support for projects that use Bugzilla or
31
Trac to manage their bugs. If your project uses a different system it
32
is easy to add support for the system, perhaps through a plugin.
34
If you do use Bugzilla or Trac then you only need to set a configuration
35
variable which contains the base URL of the bug tracker. These options
36
can go into ``bazaar.conf``, ``branch.conf`` or into a branch-specific
37
configuration section in ``locations.conf``.
39
You can set up these values for each of the projects you work on in
40
``bazaar.conf``, as you specify a short name for each so that you
41
can specify which you mean at commit time.
43
bugzilla_<tracker_abbreviation>_url
44
-----------------------------------
45
If present, the location of the Bugzilla bug tracker referred to by
46
<tracker_abbreviation>. This option can then be used together with ``bzr commit
47
--fixes`` to mark bugs in that tracker as being fixed by that commit. For
50
bugzilla_squid_url = http://www.squid-cache.org/bugs
52
would allow ``bzr commit --fixes squid:1234`` to mark Squid's bug 1234 as
55
trac_<tracker_abbrevation>_url
56
------------------------------
57
If present, the location of the Trac instance referred to by
58
<tracker_abbreviation>. This option can then be used together with ``bzr commit
59
--fixes`` to mark bugs in that tracker as being fixed by that commit. For
62
trac_twisted_url = http://www.twistedmatrix.com/trac
64
would allow ``bzr commit --fixes twisted:1234`` to mark Twisted's bug 1234 as
67
Limitations of the system
68
=========================
70
This method of associating revisions and bugs does have some limitations. The
71
first is that the association can only be made at commit time. This means that
72
if you forget to make the association when you commit, or the bug is reported
73
after you fix it you cannot go back and add the link later.
75
Related to this is the fact that the association is immutable. If a bug is
76
marked as fixed by one commit, but that revision does not fully solve the
77
bug, or there is a later regression you cannot go back and remove the link.