/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/builtins.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-03-12 13:03:16 UTC
  • mfrom: (4119.4.5 bug-parsing)
  • Revision ID: pqm@pqm.ubuntu.com-20090312130316-vmqowmbcu2tzynem
(robertc) Add Revision.iter_bugs() method for getting bugs fixed by a
        revision. (Jonathan Lange)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2699
2699
             ]
2700
2700
    aliases = ['ci', 'checkin']
2701
2701
 
2702
 
    def _get_bug_fix_properties(self, fixes, branch):
2703
 
        properties = []
 
2702
    def _iter_bug_fix_urls(self, fixes, branch):
2704
2703
        # Configure the properties for bug fixing attributes.
2705
2704
        for fixed_bug in fixes:
2706
2705
            tokens = fixed_bug.split(':')
2711
2710
                    "feature.\nCommit refused." % fixed_bug)
2712
2711
            tag, bug_id = tokens
2713
2712
            try:
2714
 
                bug_url = bugtracker.get_bug_url(tag, branch, bug_id)
 
2713
                yield bugtracker.get_bug_url(tag, branch, bug_id)
2715
2714
            except errors.UnknownBugTrackerAbbreviation:
2716
2715
                raise errors.BzrCommandError(
2717
2716
                    'Unrecognized bug %s. Commit refused.' % fixed_bug)
2718
2717
            except errors.MalformedBugIdentifier, e:
2719
2718
                raise errors.BzrCommandError(
2720
2719
                    "%s\nCommit refused." % (str(e),))
2721
 
            properties.append('%s fixed' % bug_url)
2722
 
        return '\n'.join(properties)
2723
2720
 
2724
2721
    def run(self, message=None, file=None, verbose=False, selected_list=None,
2725
2722
            unchanged=False, strict=False, local=False, fixes=None,
2752
2749
 
2753
2750
        if fixes is None:
2754
2751
            fixes = []
2755
 
        bug_property = self._get_bug_fix_properties(fixes, tree.branch)
 
2752
        bug_property = bugtracker.encode_fixes_bug_urls(
 
2753
            self._iter_bug_fix_urls(fixes, tree.branch))
2756
2754
        if bug_property:
2757
2755
            properties['bugs'] = bug_property
2758
2756