/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/bug_trackers.txt

  • Committer: Aaron Bentley
  • Date: 2007-12-15 16:35:40 UTC
  • mfrom: (3113 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3115.
  • Revision ID: aaron.bentley@utoronto.ca-20071215163540-g04zcop5aj5h1nwh
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
====================================
3
3
 
4
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.
 
5
in the project's bug tracker. Other tools (or hooks) can then use this
 
6
information to link between the commit and the bug, or to automatically
 
7
mark the bug closed in the branches that contain the commit.
8
8
 
9
9
Associating commits and bugs
10
10
----------------------------
11
11
 
12
 
When you make a commit you can assiociate it with a bug by using the
 
12
When you make a commit, you can associate it with a bug by using the
13
13
``--fixes`` option of ``commit``. For example::
14
14
 
15
 
    $ bzr commit --fixes project:12345 -m "Properly close the connection"
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
 
 
22
 
Configuration of the bug tracker
23
 
--------------------------------
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
43
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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
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
56
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57
 
 
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
 
bugtracker_<tracker_abbrevation>_url
69
 
------------------------------------
70
 
If present, the location of a generic bug tracker instance referred to by
71
 
<tracker_abbreviation>. The location must contain an ``{id}`` placeholder,
72
 
which will be replaced by a specific bug ID. This option can then be used
73
 
together with ``bzr commit --fixes`` to mark bugs in that tracker as being
74
 
fixed by that commit. For example::
75
 
 
76
 
    bugtracker_python_url = http://bugs.python.org/issue{id}
77
 
 
78
 
would allow ``bzr commit --fixes python:1234`` to mark bug 1234 in Python's
79
 
Roundup bug tracker as fixed, or::
80
 
 
81
 
    bugtracker_cpan_url = http://rt.cpan.org/Public/Bug/Display.html?id={id}
82
 
 
83
 
for CPAN's RT bug tracker.
84
 
 
85
 
Limitations of the system
86
 
-------------------------
 
15
    $ bzr commit --fixes lp:12345 -m "Properly close the connection"
 
16
 
 
17
This records metadata in Bazaar linking the commit with bug 12345 in
 
18
Launchpad. If you use a different bug tracker, it can be given its own
 
19
tracker code (instead of ``lp``) and used instead. For details on how
 
20
to configure this, refer to `Bug Tracker Settings`_ in the Bazaar
 
21
User Reference.
 
22
 
 
23
.. _Bug Tracker Settings: ../user-reference/bzr_man.html#bug-tracker-settings
 
24
 
 
25
Metadata recording vs bug tracker updating
 
26
------------------------------------------
 
27
 
 
28
Recording metadata about bugs fixed at commit time is only
 
29
one of the features needed for complete bug tracker integration.
 
30
As Bazaar is a distributed VCS, users may be offline while committing
 
31
so accessing the bug tracker itself at that time may not be possible.
 
32
Instead, it is recommended that a hook be installed to update
 
33
the bug tracker when changes are pushed to a central location
 
34
appropriate for your project's workflow.
 
35
 
 
36
Note: This second processing stage is part of the integration provided
 
37
by Lauchpad when it scans external or hosted branches.
 
38
 
 
39
Making corrections
 
40
------------------
87
41
 
88
42
This method of associating revisions and bugs does have some limitations. The
89
43
first is that the association can only be made at commit time. This means that
90
44
if you forget to make the association when you commit, or the bug is reported
91
 
after you fix it you cannot go back and add the link later.
 
45
after you fix it, you generally cannot go back and add the link later.
92
46
 
93
47
Related to this is the fact that the association is immutable. If a bug is
94
 
marked as fixed by one commit, but that revision does not fully solve the
95
 
bug, or there is a later regression you cannot go back and remove the link.
 
48
marked as fixed by one commit but that revision does not fully solve the
 
49
bug, or there is a later regression, you cannot go back and remove the link.
96
50
 
 
51
Of course, ``bzr uncommit`` can always be used to undo the last commit in
 
52
order to make it again with the correct options. This is commonly done
 
53
to correct a bad commit message and it equally applies to correcting
 
54
metadata recorded (via ``--fixes`` for example) on the last commit.