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

  • Committer: Neil Martinsen-Burrell
  • Date: 2010-01-05 02:13:02 UTC
  • mto: This revision was merged to the branch mainline in revision 4938.
  • Revision ID: nmb@wartburg.edu-20100105021302-lqr16qpar3f38hpf
from review comments: improve splitting, add test that handler is present, use build_tree in tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
1983
1983
# Use the properties handlers to print out bug information if available
1984
1984
def _bugs_properties_handler(revision):
1985
1985
    if revision.properties.has_key('bugs'):
1986
 
        bug_list =  [val.split()[0] for val in
1987
 
                     revision.properties['bugs'].split('\n') if
1988
 
                     val.split()[1] == 'fixed'
1989
 
                    ]
1990
 
        if bug_list:
1991
 
            return {'fixes bug(s)': ' '.join(bug_list)}
 
1986
        bug_lines = revision.properties['bugs'].split('\n')
 
1987
        bug_rows = [line.split(' ', 1) for line in bug_lines]
 
1988
        fixed_bug_urls = [row[0] for row in bug_rows if
 
1989
                          len(row) > 1 and row[1] == 'fixed']
 
1990
        
 
1991
        if fixed_bug_urls:
 
1992
            return {'fixes bug(s)': ' '.join(fixed_bug_urls)}
1992
1993
    return {}
1993
1994
 
1994
1995
properties_handler_registry.register('bugs_properties_handler',