/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 bzrlib/bugtracker.py

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
171
171
tracker_registry.register(
172
172
    'bugzilla',
173
173
    URLParametrizedIntegerBugTracker('bugzilla', 'show_bug.cgi?id='))
 
174
 
 
175
 
 
176
class GenericBugTracker(URLParametrizedIntegerBugTracker):
 
177
    """Generic bug tracker specified by an URL template."""
 
178
 
 
179
    def __init__(self):
 
180
        super(GenericBugTracker, self).__init__('bugtracker', None)
 
181
 
 
182
    def get(self, abbreviation, branch):
 
183
        self._abbreviation = abbreviation
 
184
        return super(GenericBugTracker, self).get(abbreviation, branch)
 
185
 
 
186
    def _get_bug_url(self, bug_id):
 
187
        """Given a validated bug_id, return the bug's web page's URL."""
 
188
        if '{id}' not in self._base_url:
 
189
            raise errors.InvalidBugTrackerURL(self._abbreviation,
 
190
                                              self._base_url)
 
191
        return self._base_url.replace('{id}', str(bug_id))
 
192
 
 
193
 
 
194
tracker_registry.register('generic', GenericBugTracker())