From: Gary L P. <gar...@us...> - 2000-11-07 01:50:20
|
Update of /cvsroot/jtidy/CVSROOT In directory slayer.i.sourceforge.net:/tmp/cvs-serv16376 Modified Files: syncmail Log Message: Latest version of syncmail v3.15 Index: syncmail =================================================================== RCS file: /cvsroot/jtidy/CVSROOT/syncmail,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** syncmail 2000/11/06 22:53:19 1.3 --- syncmail 2000/11/07 01:50:15 1.4 *************** *** 11,19 **** set this up, create a loginfo entry that looks something like this: ! mymodule /path/to/syncmail %%s som...@yo...main ! In this example, whenever a checkin that matches `mymodule' is made, the ! syncmail script is invoked, which will generate the diff containing email, and ! send it to som...@yo...main. Note: This module used to also do repository synchronizations via --- 11,19 ---- set this up, create a loginfo entry that looks something like this: ! mymodule /path/to/this/script %%s som...@yo...main ! In this example, whenever a checkin that matches `mymodule' is made, this ! script is invoked, which will generate the diff containing email, and send it ! to som...@yo...main. Note: This module used to also do repository synchronizations via *************** *** 21,26 **** this is no longer necessary. The syncing functionality has been ripped out in the 3.0, which simplifies it considerably. Access the 2.x versions ! to refer to this functionality. Because of this, the script's name is ! misleading. It no longer makes sense to run this script from the command line. Doing so --- 21,25 ---- this is no longer necessary. The syncing functionality has been ripped out in the 3.0, which simplifies it considerably. Access the 2.x versions ! to refer to this functionality. Because of this, the script is misnamed. It no longer makes sense to run this script from the command line. Doing so *************** *** 29,33 **** Usage: ! syncmail [options] <%%S> email-addr [email-addr ...] Where options is: --- 28,32 ---- Usage: ! %(PROGRAM)s [options] <%%S> email-addr [email-addr ...] Where options is: *************** *** 67,75 **** DIFF_TRUNCATE_IF_LARGER = 1000 ! def usage(errcode, msg=''): print __doc__ % globals() ! if msg: print msg ! sys.exit(errorcode) --- 66,78 ---- DIFF_TRUNCATE_IF_LARGER = 1000 + PROGRAM = sys.argv[0] + + ! def usage(code, msg=''): print __doc__ % globals() ! if msg: ! print msg ! sys.exit(code) *************** *** 82,99 **** return '***** Bogus filespec: %s' % filespec if oldrev == 'NONE': ! ##try: ! ## fp = open(file) ! ## lines = fp.readlines() ! ## fp.close() ! ## lines.insert(0, '--- NEW FILE ---\n') ! ##except IOError, e: ! ## lines = ['***** Error reading new file: ', ! ## str(e)] ! ## Code below added by GLP to produce proper email ! diffcmd = '/usr/bin/cvs -f checkout -kk -r %s -p %s' % ( ! newrev, file) ! fp = os.popen(diffcmd) ! lines = fp.readlines() ! sts = fp.close() elif newrev == 'NONE': lines = ['--- %s DELETED ---\n' % file] --- 85,100 ---- return '***** Bogus filespec: %s' % filespec if oldrev == 'NONE': ! try: ! if os.path.exists(file): ! fp = open(file) ! else: ! update_cmd = 'cvs -fn update -r %s -p %s' % (newrev, file) ! fp = os.popen(update_cmd) ! lines = fp.readlines() ! fp.close() ! lines.insert(0, '--- NEW FILE ---\n') ! except IOError, e: ! lines = ['***** Error reading new file: ', ! str(e), '\n***** file: ', file, ' cwd: ', os.getcwd()] elif newrev == 'NONE': lines = ['--- %s DELETED ---\n' % file] *************** *** 175,185 **** if specs[-3:] == ['-', 'New', 'directory']: del specs[-3:] blast_mail(mailcmd, specs[1:]) if __name__ == '__main__': - print 'Running syncmail...' main() - print '...syncmail done.' sys.exit(0) --- 176,186 ---- if specs[-3:] == ['-', 'New', 'directory']: del specs[-3:] + print 'Generating notification message...' blast_mail(mailcmd, specs[1:]) + print 'Generating notification message... done.' if __name__ == '__main__': main() sys.exit(0) |