~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bugtracker.py

  • Committer: Andrew Bennetts
  • Date: 2010-10-08 08:15:14 UTC
  • mto: This revision was merged to the branch mainline in revision 5498.
  • Revision ID: andrew.bennetts@canonical.com-20101008081514-dviqzrdfwyzsqbz2
Split NEWS into per-release doc/en/release-notes/bzr-*.txt

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
from __future__ import absolute_import
18
 
 
19
17
from bzrlib import registry
20
18
from bzrlib.lazy_import import lazy_import
21
19
lazy_import(globals(), """
50
48
 
51
49
    bzr commit --fixes <tracker>:<id>
52
50
 
53
 
or::
54
 
 
55
 
    bzr commit --fixes <id>
56
 
 
57
51
where "<tracker>" is an identifier for the bug tracker, and "<id>" is the
58
52
identifier for that bug within the bugtracker, usually the bug number.
59
 
If "<tracker>" is not specified the ``bugtracker`` set in the branch
60
 
or global configuration is used.
61
53
 
62
54
Bazaar knows about a few bug trackers that have many users. If
63
55
you use one of these bug trackers then there is no setup required to
239
231
 
240
232
 
241
233
tracker_registry.register('gnome',
242
 
    UniqueIntegerBugTracker('gnome',
243
 
                            'http://bugzilla.gnome.org/show_bug.cgi?id='))
 
234
    UniqueIntegerBugTracker('gnome', 'http://bugzilla.gnome.org/show_bug.cgi?id='))
244
235
 
245
236
 
246
237
class URLParametrizedBugTracker(BugTracker):
255
246
    def get(self, abbreviation, branch):
256
247
        config = branch.get_config()
257
248
        url = config.get_user_option(
258
 
            "%s_%s_url" % (self.type_name, abbreviation), expand=False)
 
249
            "%s_%s_url" % (self.type_name, abbreviation))
259
250
        if url is None:
260
251
            return None
261
252
        self._base_url = url
270
261
        return urlutils.join(self._base_url, self._bug_area) + str(bug_id)
271
262
 
272
263
 
273
 
class URLParametrizedIntegerBugTracker(IntegerBugTracker,
274
 
                                       URLParametrizedBugTracker):
275
 
    """A type of bug tracker that  only allows integer bug IDs.
276
 
 
277
 
    This can be found on a variety of different sites, and thus needs to have
278
 
    the base URL configured.
 
264
class URLParametrizedIntegerBugTracker(IntegerBugTracker, URLParametrizedBugTracker):
 
265
    """A type of bug tracker that can be found on a variety of different sites,
 
266
    and thus needs to have the base URL configured, but only allows integer bug IDs.
279
267
 
280
268
    Looks for a config setting in the form '<type_name>_<abbreviation>_url'.
281
269
    `type_name` is the name of the type of tracker (e.g. 'bugzilla' or 'trac')