/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: Guillermo Gonzalez
  • Date: 2008-07-05 23:06:12 UTC
  • mto: (3542.1.1 logdisplayers)
  • mto: This revision was merged to the branch mainline in revision 3556.
  • Revision ID: guillo.gonzo@gmail.com-20080705230612-0v78sasowqo8yflr
 * bzrlib.log.show_roperties don't hide handler errors
 * renames custom_properties_handler_registry to properties_handler_registry  
 * tests moved out of blackbox 
 * created TestCaseWithoutPropsHandler to avoid using properties handlers 
   in log tests that assertDiff against the full log output

Show diffs side-by-side

added added

removed removed

Lines of Context:
635
635
            return name
636
636
        return address
637
637
 
638
 
    def show_properties(self, properties):
 
638
    def show_properties(self, revision, indent):
639
639
        """Displays the custom properties returned by each registered handler.
640
640
        
641
 
        If a registered handler raise an error, it's silently logged and the
642
 
        next handler in the registry is executed.
 
641
        If a registered handler raises a error it is propagated.
643
642
        """
644
 
        filtered_props = properties.copy()
645
 
        if 'branch-nick' in filtered_props: 
646
 
            del filtered_props['branch-nick']
647
 
        for key, handler in custom_properties_handler_registry.iteritems():
648
 
            try:
649
 
                for key, value in handler(filtered_props).items():
650
 
                    self.to_file.write(key + ': ' + value + '\n')
651
 
            except:
652
 
                mutter('custom property handler: %s raised an error', 
653
 
                        key)
654
 
                trace.log_exception_quietly()
 
643
        for key, handler in properties_handler_registry.iteritems():
 
644
            for key, value in handler(revision).items():
 
645
                self.to_file.write(indent + key + ': ' + value + '\n')
655
646
 
656
647
 
657
648
class LongLogFormatter(LogFormatter):
674
665
            to_file.write('\n')
675
666
            for parent_id in revision.rev.parent_ids:
676
667
                to_file.write(indent + 'parent: %s\n' % (parent_id,))
677
 
        self.show_properties(revision.rev.properties)
 
668
        self.show_properties(revision.rev.properties, indent)
678
669
 
679
670
        author = revision.rev.properties.get('author', None)
680
671
        if author is not None:
892
883
                 search=None)
893
884
 
894
885
 
895
 
custom_properties_handler_registry = registry.Registry()
 
886
properties_handler_registry = registry.Registry()