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

  • Committer: Jelmer Vernooij
  • Date: 2018-11-16 23:15:15 UTC
  • mfrom: (7180 work)
  • mto: This revision was merged to the branch mainline in revision 7183.
  • Revision ID: jelmer@jelmer.uk-20181116231515-zqd2yn6kj8lfydyp
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
"""
43
43
 
44
44
 
45
 
_bugs_help = \
46
 
"""When making a commit, metadata about bugs fixed by that change can be
 
45
_bugs_help = """\
 
46
When making a commit, metadata about bugs fixed by that change can be
47
47
recorded by using the ``--fixes`` option. For each bug marked as fixed, an
48
48
entry is included in the 'bugs' revision property stating '<url> <status>'.
49
49
(The only ``status`` value currently supported is ``fixed.``)
216
216
            tracker = tracker_type.get(abbreviated_bugtracker_name, branch)
217
217
            if tracker is not None:
218
218
                return tracker
219
 
        raise UnknownBugTrackerAbbreviation(abbreviated_bugtracker_name,
220
 
                branch)
 
219
        raise UnknownBugTrackerAbbreviation(
 
220
            abbreviated_bugtracker_name, branch)
221
221
 
222
222
    def help_topic(self, topic):
223
223
        return _bugs_help
316
316
        if '{project}' not in self._base_url:
317
317
            raise InvalidBugTrackerURL(self._abbreviation, self._base_url)
318
318
        return self._base_url.replace(
319
 
                '{project}', project).replace('{id}', str(bug_id))
 
319
            '{project}', project).replace('{id}', str(bug_id))
320
320
 
321
321
 
322
322
tracker_registry.register(
327
327
    'debian', UniqueIntegerBugTracker('deb', 'http://bugs.debian.org/'))
328
328
 
329
329
 
330
 
tracker_registry.register('gnome',
331
 
    UniqueIntegerBugTracker('gnome',
332
 
                            'http://bugzilla.gnome.org/show_bug.cgi?id='))
 
330
tracker_registry.register(
 
331
    'gnome', UniqueIntegerBugTracker(
 
332
        'gnome', 'http://bugzilla.gnome.org/show_bug.cgi?id='))
333
333
 
334
334
 
335
335
tracker_registry.register(
377
377
    'squid' or 'apache').
378
378
    """
379
379
 
 
380
 
380
381
tracker_registry.register(
381
382
    'trac', URLParametrizedIntegerBugTracker('trac', 'ticket/'))
382
383
 
406
407
 
407
408
 
408
409
FIXED = 'fixed'
 
410
RELATED = 'related'
409
411
 
410
 
ALLOWED_BUG_STATUSES = {FIXED}
 
412
ALLOWED_BUG_STATUSES = {FIXED, RELATED}
411
413
 
412
414
 
413
415
def encode_fixes_bug_urls(bug_urls):
414
416
    """Get the revision property value for a commit that fixes bugs.
415
417
 
416
 
    :param bug_urls: An iterable of escaped URLs to bugs. These normally
 
418
    :param bug_urls: An iterable of (escaped URL, tag) tuples. These normally
417
419
        come from `get_bug_url`.
418
420
    :return: A string that will be set as the 'bugs' property of a revision
419
421
        as part of a commit.
420
422
    """
421
 
    return '\n'.join(('%s %s' % (url, FIXED)) for url in bug_urls)
 
423
    return '\n'.join(('%s %s' % (url, tag)) for (url, tag) in bug_urls)