[alsa-cvslog] alsa: New ChangeSet 22:454164ff2488
Brought to you by:
perex
From: Jaroslav K. <pe...@su...> - 2006-05-19 13:16:12
|
changeset: 22:454164ff2488b307d00c62a6264d56ec32291d88 tag: tip user: perex date: Fri May 19 15:15:57 2006 +0200 files: hghooks/alogger.py merge-list description: alogger.py - show first line from description rather than changeset number merge-list - updated diff -r c36493d9efbb00288ebd16552e1a9176f93896ad -r 454164ff2488b307d00c62a6264d56ec32291d88 hghooks/alogger.py --- a/hghooks/alogger.py Thu Apr 27 21:15:00 2006 +0200 +++ b/hghooks/alogger.py Fri May 19 15:15:57 2006 +0200 @@ -2,6 +2,7 @@ # -*- Python -*- import os +import sys import time import smtplib from posix import getuid @@ -13,13 +14,13 @@ EMAIL_TO = ["als...@li...urcefor EMAIL_TO = ["als...@li..."] #EMAIL_TO = ["pe...@pe..."] -def my_popen(cmd): - fp = os.popen(cmd) - lines = fp.readlines() - fp.close() - return lines +if __name__ == '__main__': -if __name__ == '__main__': + debug = False + if len(sys.argv) > 1 and sys.argv[1] == "debug": + debug = True + print 'Debug mode enabled.' + pw = getpwuid(getuid()) user = pw[0] email = pw[4] @@ -37,13 +38,27 @@ if __name__ == '__main__': fp.close() del fp - msg['Subject'] = "%s: New ChangeSet %s" % (module, a[13:a.find('\n')-28]) + descr = "ChangeSet %s" % a[13:a.find('\n')-28] + descr1 == '' + dpos = a.find("description") + if dpos > 0 and dpos < 1024: + dpos1 = a[dpos:].find('\n') + if dpos1 > 0: + dpos2 = a[dpos+dpos1+1:].find('\n') + if dpos2 > 0: + descr1 = a[dpos+dpos1+1:dpos+dpos1+dpos2+1].strip() + if descr1 != '': + descr = descr1 + msg['Subject'] = "%s: %s" % (module, descr) msg['Message-Id'] = '<ALOGGER%s...@al...>' % time.time() msg['From'] = email msg['Reply-To'] = EMAIL_REPLYTO msg['To'] = EMAIL_TO[0] - s = smtplib.SMTP() - s.connect() - s.sendmail(EMAIL_FROM, EMAIL_TO, msg.as_string()) - s.close() + if not debug: + s = smtplib.SMTP() + s.connect() + s.sendmail(EMAIL_FROM, EMAIL_TO, msg.as_string()) + s.close() + else: + print msg.as_string() diff -r c36493d9efbb00288ebd16552e1a9176f93896ad -r 454164ff2488b307d00c62a6264d56ec32291d88 merge-list --- a/merge-list Thu Apr 27 21:15:00 2006 +0200 +++ b/merge-list Fri May 19 15:15:57 2006 +0200 @@ -28,30 +28,8 @@ +4167 +4168 +4169 -++4172 -++4173 -++4174 +4175 -++4176 -+4177..4178 # ??? to stable?, merge together -++4179 -++4180 -++4181 -++4182 -++4183 -++4184 -++4189 -++4190 -++4191 ++4177..4178 +4192 -++4194 -++4196 -++4197 -++4198 -++4199 -#-+patches/verbose_procfs_fix.patch # modified 4199 -++4200 -++4201 -++4202 +4203 -++4204 ++4206..4253 |