~bzr-pqm/bzr/bzr.dev

2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
1
Integrating Bazaar with bug trackers
2
====================================
2601.1.1 by James Westby
Split out bug tracker configuration in to its own file.
3
4
Bazaar has a facility that allows you to associate a commit with a bug
5
in the project's bug tracker. Other tools can then use this information
6
to link between the commit and the bug, or to automatically mark the bug
7
closed in the branches that contain the commit.
8
2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
9
Associating commits and bugs
10
----------------------------
2601.1.1 by James Westby
Split out bug tracker configuration in to its own file.
11
12
When you make a commit you can assiociate it with a bug by using the
13
``--fixes`` option of ``commit``. For example::
14
2977.1.11 by Ian Clatworthy
make fixes suggested by proof-readers
15
    $ bzr commit --fixes 12345 -m "Properly close the connection on errors"
2601.1.1 by James Westby
Split out bug tracker configuration in to its own file.
16
17
This will set a revision property on the revision that is committed
18
which contains the URI at which more information on the bug can be found.
19
Bazaar itself does no more than this, but once the information is recorded
20
other tools can make use of it.
21
2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
22
Configuration of the bug tracker
23
--------------------------------
2601.1.1 by James Westby
Split out bug tracker configuration in to its own file.
24
25
As each project has it's own bug tracker, and there are many different
26
bug tracking systems you must first do some configuration before you
27
can use this system.
28
29
Bazaar currently implements support for projects that use Bugzilla or
30
Trac to manage their bugs. If your project uses a different system it
31
is easy to add support for the system, perhaps through a plugin.
32
33
If you do use Bugzilla or Trac then you only need to set a configuration
34
variable which contains the base URL of the bug tracker. These options
35
can go into ``bazaar.conf``, ``branch.conf`` or into a branch-specific
36
configuration section in ``locations.conf``.
37
38
You can set up these values for each of the projects you work on in
39
``bazaar.conf``, as you specify a short name for each so that you
40
can specify which you mean at commit time.
41
42
bugzilla_<tracker_abbreviation>_url
2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
43
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44
2601.1.1 by James Westby
Split out bug tracker configuration in to its own file.
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
48
example::
49
50
    bugzilla_squid_url = http://www.squid-cache.org/bugs
51
52
would allow ``bzr commit --fixes squid:1234`` to mark Squid's bug 1234 as
53
fixed.
54
55
trac_<tracker_abbrevation>_url
2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
56
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57
2601.1.1 by James Westby
Split out bug tracker configuration in to its own file.
58
If present, the location of the Trac instance referred to by
59
<tracker_abbreviation>. This option can then be used together with ``bzr commit
60
--fixes`` to mark bugs in that tracker as being fixed by that commit. For
61
example::
62
63
    trac_twisted_url = http://www.twistedmatrix.com/trac
64
65
would allow ``bzr commit --fixes twisted:1234`` to mark Twisted's bug 1234 as
66
fixed.
67
68
Limitations of the system
2977.1.1 by Ian Clatworthy
First cut at new look User Guide including chapters 1 and 2
69
-------------------------
2601.1.1 by James Westby
Split out bug tracker configuration in to its own file.
70
71
This method of associating revisions and bugs does have some limitations. The
72
first is that the association can only be made at commit time. This means that
73
if you forget to make the association when you commit, or the bug is reported
74
after you fix it you cannot go back and add the link later.
75
76
Related to this is the fact that the association is immutable. If a bug is
77
marked as fixed by one commit, but that revision does not fully solve the
78
bug, or there is a later regression you cannot go back and remove the link.
79