From: Gary L P. <gar...@us...> - 2000-11-07 02:09:21
|
Update of /cvsroot/jtidy/CVSROOT In directory slayer.i.sourceforge.net:/tmp/cvs-serv17581 Modified Files: syncmail Log Message: Diffs in unified format. Use full path for cvs operations. Index: syncmail =================================================================== RCS file: /cvsroot/jtidy/CVSROOT/syncmail,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** syncmail 2000/11/07 01:50:15 1.4 --- syncmail 2000/11/07 02:09:15 1.5 *************** *** 78,82 **** ! def calculate_diff(filespec): try: file, oldrev, newrev = string.split(filespec, ',') --- 78,82 ---- ! def calculate_diff(basespec, filespec): try: file, oldrev, newrev = string.split(filespec, ',') *************** *** 84,93 **** # No diff to report 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() --- 84,94 ---- # No diff to report return '***** Bogus filespec: %s' % filespec + fullpath = basespec + "/" + file if oldrev == 'NONE': try: ! if os.path.exists(fullpath): ! fp = open(fullpath) else: ! update_cmd = 'cvs -fn update -r %s -p %s' % (newrev, fullpath) fp = os.popen(update_cmd) lines = fp.readlines() *************** *** 98,107 **** str(e), '\n***** file: ', file, ' cwd: ', os.getcwd()] elif newrev == 'NONE': ! lines = ['--- %s DELETED ---\n' % file] else: # This /has/ to happen in the background, otherwise we'll run into CVS # lock contention. What a crock. ! diffcmd = '/usr/bin/cvs -f diff -kk -C 2 -r %s -r %s %s' % ( ! oldrev, newrev, file) fp = os.popen(diffcmd) lines = fp.readlines() --- 99,108 ---- str(e), '\n***** file: ', file, ' cwd: ', os.getcwd()] elif newrev == 'NONE': ! lines = ['--- %s DELETED ---\n' % fullpath] else: # This /has/ to happen in the background, otherwise we'll run into CVS # lock contention. What a crock. ! diffcmd = '/usr/bin/cvs -f diff -kk -u -r %s -r %s %s' % ( ! oldrev, newrev, fullpath) fp = os.popen(diffcmd) lines = fp.readlines() *************** *** 119,123 **** ! def blast_mail(mailcmd, filestodiff): # cannot wait for child process or that will cause parent to retain cvs # lock for too long. Urg! --- 120,124 ---- ! def blast_mail(mailcmd, basedir, filestodiff): # cannot wait for child process or that will cause parent to retain cvs # lock for too long. Urg! *************** *** 131,135 **** # append the diffs if available for file in filestodiff: ! fp.write(calculate_diff(file)) fp.write('\n') fp.close() --- 132,136 ---- # append the diffs if available for file in filestodiff: ! fp.write(calculate_diff(basedir, file)) fp.write('\n') fp.close() *************** *** 177,181 **** del specs[-3:] print 'Generating notification message...' ! blast_mail(mailcmd, specs[1:]) print 'Generating notification message... done.' --- 178,182 ---- del specs[-3:] print 'Generating notification message...' ! blast_mail(mailcmd, specs[0], specs[1:]) print 'Generating notification message... done.' |