##// END OF EJS Templates
- Commit local changelog info, remove duplicate entry.
- Commit local changelog info, remove duplicate entry.

File last commit:

r13:c89dbe05
r502:d3ea7cd7
Show More
ipsvnc
78 lines | 2.1 KiB | text/plain | TextLexer
fperez
Added new little utility for wrapping svn commits with email notifications,...
r7 #!/usr/bin/env python
"""Simple svn commit wrapper which emails a given list of people.
Usage:
ipsvnc [args]
This is equivalent to doing
svn commit [args]
If the commit operation is successful (the script asks for confirmation), a
hardwired list of maintainers is informed of the commit.
This is a poor-man's substitute for a proper svn post-commit hook with an
ipython-svn email list, which we're waiting to get soon. It should be removed
once that facility is in place.
This only works on a unix box which can send mail by itself."""
import os
import commands
import sys
import time
# Package maintainers to be alerted
maintainers = ['fperez@colorado.edu', 'rkern@ucsd.edu', 'antont@an.org',
'tsanko@gmail.com']
#maintainers = ['fperez@colorado.edu'] # dbg
# Assemble command line back, before passing it to svn
svnargs = []
for arg in sys.argv[1:]:
if ' ' in arg:
svnargs.append('"%s"' % arg)
else:
svnargs.append(arg)
svnargs = ' '.join(svnargs)
#print 'SVN args: <%s>' % svnargs; sys.exit() # dbg
# perform commit
fperez
Minor improvements, to add changeset info.
r9 print 'Performing SVN commit, this may take some time...'
fperez
Added new little utility for wrapping svn commits with email notifications,...
r7 os.system('svn commit %s' % svnargs)
svntime = time.asctime()
fperez
Minor improvements, to add changeset info.
r9 print 'Getting SVN log and version info...'
fperez
Fixed log hook to check against HEAD so the email is more informative.
r8 svnstatus = commands.getoutput('svn log -r HEAD')
fperez
Update version strings to use only dots as separators, since either - or _...
r13 svnversion = commands.getoutput('svnversion .').split(':')[-1]
fperez
Added new little utility for wrapping svn commits with email notifications,...
r7
# Confirm with user (trying to get the status from the svn commit blocks
# silently, I don't care to debug it)
fperez
Minor improvements, to add changeset info.
r9 ans = raw_input('If commit was succesful, proceed '
'with email notification? [Y/n] ')
fperez
Added new little utility for wrapping svn commits with email notifications,...
r7 if ans.lower().startswith('n'):
print "Exiting now..."
sys.exit(1)
else:
print "OK. Emailing maintainers..."
# Send emails
subject = "[IPython SVN] New commit performed by %s" % os.getlogin()
body = """\
Commit performed at: %s
SVN arguments used: %s
fperez
Minor improvements, to add changeset info.
r9 SVN Version: %s
This version probably points to this changeset:
http://projects.scipy.org/ipython/ipython/changeset/%s
fperez
Added new little utility for wrapping svn commits with email notifications,...
r7 Current SVN status after last commit:
fperez
Minor improvements, to add changeset info.
r9 %s""" % (svntime,svnargs,svnversion,svnversion,svnstatus)
fperez
Added new little utility for wrapping svn commits with email notifications,...
r7
for maint in maintainers:
print "Emailing",maint
os.system('echo "%s" | mail -s "%s" %s' % (body, subject,maint))