[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] size and force text files to be considered binary in mailer.py

From: Jon Bendtsen <jon.bendtsen_at_laerdal.dk>
Date: 2005-08-19 12:00:22 CEST

Hi

Here follows a patch that allows one to specify a max mailsize in the
mailer.py script.
Further more the script allows you to specifiy which text files are
to be considered binary
and thus no diff included in the mail.

my mailer.py is taken from debian unstable and the head of the
mailer.py script looks like this.

# $HeadURL: http://svn.collab.net/repos/svn/branches/1.2.x/tools/hook-
scripts/mailer/mailer.py $
# $LastChangedDate: 2005-04-21 14:12:41 -0400 (Thu, 21 Apr 2005) $
# $LastChangedBy: breser $
# $LastChangedRevision: 14358 $

I think it is version 1.2.0

The mailsize is calculated by having a hardcoded max size limit in
the mailer.py script.
For every diff
     for every line
         i take the length of the line and subtract it from the max
size.
         If the max size reaches 0 or below, one more line is added
         saying that the limit has been reached and no more text is
         included in the email.

Currently the limit is hardcoded to 2MB

Further more the number of diffs are counted and if there is more
than 128 diffs/files, it aborts
futher generation as well, but does send the mail that was genereated
so far.

To force files to be considered binary, the name of the file is
checked against a list of regular
expressions. The regular expressions is taken from the file
filediff.conf that usually resides in
the conf directory right next to the mailer.conf.
Every line except those beginning with # are used in a regular
expression match.
If any match is found we stop checking for other regular expressions,
and stops generating
diffs for this file. A message is included that it is forced binary
because of $patern

I'm looking for input, suggestions, ... and eventually maybe someone
will include it into the
mailer.py which exists now.

JonB

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

  • application/octet-stream attachment: patch-120
Received on Tue Aug 23 15:20:02 2005

This is an archived mail posted to the Subversion Dev mailing list.