From: Fred L. D. <fd...@us...> - 2003-03-18 15:13:42
|
Update of /cvsroot/cvs-syncmail/syncmail In directory sc8-pr-cvs1:/tmp/cvs-serv14017 Modified Files: syncmail Log Message: Fix error when the loginfo contains a replacement of %s instead of %{sVv}: just don't produce a diff. This also allows commas in filenames when %{sVv} is used. Index: syncmail =================================================================== RCS file: /cvsroot/cvs-syncmail/syncmail/syncmail,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- syncmail 14 Mar 2003 21:32:15 -0000 1.28 +++ syncmail 18 Mar 2003 15:13:35 -0000 1.29 @@ -155,7 +155,17 @@ def calculate_diff(filespec, contextlines): - file, oldrev, newrev = string.split(filespec, ',') + spec = string.split(filespec, ',') + if len(spec) < 3: + # Too few parts; command line probable used a replacement + # other than "%{sVv}"; don't fail, but don't produce a diff + # since we can't be sure what diff to generate. + return '' + # This allows filenames that contain commas: + file = string.join(spec[:-2], ",") + oldrev = spec[-2] + newrev = spec[-1] + # Make sure we can find a CVS version number if not REVCRE.match(oldrev): return NOVERSION % filespec |