~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bugtracker.py

Merge pt1 hooks branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
 
49
49
    bzr commit --fixes <tracker>:<id>
50
50
 
51
 
or::
52
 
 
53
 
    bzr commit --fixes <id>
54
 
 
55
51
where "<tracker>" is an identifier for the bug tracker, and "<id>" is the
56
52
identifier for that bug within the bugtracker, usually the bug number.
57
 
If "<tracker>" is not specified the ``bugtracker`` set in the branch
58
 
or global configuration is used.
59
53
 
60
54
Bazaar knows about a few bug trackers that have many users. If
61
55
you use one of these bug trackers then there is no setup required to
237
231
 
238
232
 
239
233
tracker_registry.register('gnome',
240
 
    UniqueIntegerBugTracker('gnome',
241
 
                            'http://bugzilla.gnome.org/show_bug.cgi?id='))
 
234
    UniqueIntegerBugTracker('gnome', 'http://bugzilla.gnome.org/show_bug.cgi?id='))
242
235
 
243
236
 
244
237
class URLParametrizedBugTracker(BugTracker):
253
246
    def get(self, abbreviation, branch):
254
247
        config = branch.get_config()
255
248
        url = config.get_user_option(
256
 
            "%s_%s_url" % (self.type_name, abbreviation), expand=False)
 
249
            "%s_%s_url" % (self.type_name, abbreviation))
257
250
        if url is None:
258
251
            return None
259
252
        self._base_url = url
268
261
        return urlutils.join(self._base_url, self._bug_area) + str(bug_id)
269
262
 
270
263
 
271
 
class URLParametrizedIntegerBugTracker(IntegerBugTracker,
272
 
                                       URLParametrizedBugTracker):
273
 
    """A type of bug tracker that  only allows integer bug IDs.
274
 
 
275
 
    This can be found on a variety of different sites, and thus needs to have
276
 
    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.
277
267
 
278
268
    Looks for a config setting in the form '<type_name>_<abbreviation>_url'.
279
269
    `type_name` is the name of the type of tracker (e.g. 'bugzilla' or 'trac')