Created
March 21, 2010 18:24
-
-
Save xyos/339474 to your computer and use it in GitHub Desktop.
post-commit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import smtplib | |
| import sys | |
| import commands | |
| fromaddr = '[email protected]' | |
| toaddrs = '[email protected], [email protected]' | |
| def svnlog(repo,rev): | |
| info = 'svnlook info %s -r %s' % (repo, rev) | |
| diff = 'svnlook diff %s -r %s' % (repo, rev) | |
| return commands.getoutput(info)+"\n"+commands.getoutput(diff) | |
| log= svnlog(sys.argv[1],sys.argv[2]) | |
| msg ="From: %s\r\nTo: %s\r\nSubject:svn\r\n\n%s%s%s\n%s" % (fromaddr, toaddrs,'el repositorio: REPO_NAME se actualizo a la revision ', sys.argv[2] , ' por favor revise REPO_URL', log ) | |
| # login | |
| username = '[email protected]' | |
| password = 'PASSWORD' | |
| server = smtplib.SMTP('smtp.gmail.com:587') | |
| server.starttls() | |
| server.login(username,password) | |
| for i in toaddrs.split(', '): | |
| server.sendmail(fromaddr, i, msg) | |
| server.quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment