self.revno = self.branch.revision_id_to_revno(self._revision_id)
def _format(self):
+ """Munge the commit info into an irc message"""
delta = self.branch.repository.get_revision_delta(self._revision_id)
files = []
- [files.append(f) for (f,_,_) in delta.added]
- [files.append(f) for (f,_,_) in delta.removed]
- [files.append(f) for (_,f,_,_,_,_) in delta.renamed]
- [files.append(f) for (f,_,_,_,_) in delta.modified]
+ [files.append(f) for (f, _, _) in delta.added]
+ [files.append(f) for (f, _, _) in delta.removed]
+ [files.append(f) for (_, f, _, _, _, _) in delta.renamed]
+ [files.append(f) for (f, _, _, _, _) in delta.modified]
fields = {
'project': self.project(),
'files': ' '.join(files),
'logmsg': self.revision.get_summary(),
}
- for name, value in self.colours():
- fields[name] = value
+ fields.update(self.colours())
text = ('%(bold)s%(project)s:%(reset)s '
'%(green)s%(committer)s%(reset)s '
'%(repo)s * %(bold)s%(rev)s%(reset)s / '
' %(bold)s%(files)s%(reset)s: %(logmsg)s ' % fields)
return text
- def url(self):
- """What URL to display in the subject of the mail"""
- url = self.config.get('irker_url')
- if url is None:
- url = self.config.get('public_branch')
- if url is None:
- url = self.branch.base
- return url
-
def colours(self):
+ """Utility function to handle the colours"""
colour_style = self.config.get('irker_colours')
colours = {
'bold': '',
'cyan': '\x0310',
'reset': '\x0F',
}
- return colours.iteritems()
+ return colours
def project(self):
project = self.config.get('irker_project')
self.repository.unlock()
self.branch.unlock()
-opt_irker_url = Option('irker_url',
- help='URL to mention for branch in messages.')
opt_irker_channels = Option('irker_channels',
help='Channel(s) to post commit messages to.')
opt_irker_colours = Option('irker_colours',