Ticket #61: bonsaipoller.patch

File bonsaipoller.patch, 1.3 KB (added by Pike, 5 years ago)

support empty check-in comments, fix files array for multiple check-ins

  • bonsaipoller.py

    RCS file: /cvsroot/mozilla/tools/buildbot/buildbot/changes/bonsaipoller.py,v
    retrieving revision 1.4
    diff -u -r1.4 bonsaipoller.py
     
    148148        elif len(logs) > 1: 
    149149            raise InvalidResultError("Multiple logs present") 
    150150 
    151         return logs[0].firstChild.data 
     151        # catch empty check-in comments 
     152        if logs[0].firstChild: 
     153            return logs[0].firstChild.data 
     154        return '' 
    152155 
    153156    def _getWho(self): 
    154157        """Returns the e-mail address of the commiter""" 
     
    290293        return defer.maybeDeferred(urlopen, url) 
    291294 
    292295    def _process_changes(self, query): 
    293         files = [] 
    294296        try: 
    295297            bp = BonsaiParser(query) 
    296298            result = bp.getData() 
     
    301303            return 
    302304 
    303305        for cinode in result.nodes: 
    304             for file in cinode.files: 
    305                 files.append(file.filename+' (revision '+file.revision+')') 
     306            files = [file.filename + ' (revision '+file.revision+')' 
     307                     for file in cinode.files] 
    306308            c = changes.Change(who = cinode.who, 
    307309                               files = files, 
    308310                               comments = cinode.log,