You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Norbert Unterberg <ne...@gmx.net> on 2005/01/23 00:04:59 UTC
Re: mailer.py now should work on Windows
Max Bowsher schrieb:
> Fixed in r12672.
I am also trying to run the mailer.py on windows. After some trying and
finding the "1.1.x-mailer.py" branch (it is not in the 1.1.3 release,
isn't it?) I now managed to send commit e-mails. Thanks a lot!
There remains an issue with the DIFFs. I have setup a diff.exe from the
GnuWin32 tools which works with the command line from
mailer.conf.example. The diffs are added to the commit mails.
BUT: Each line from the diff contains an extra CRLF pair. So the diff
looks like this:
Modified: testproj/trunk/file2.txt
==============================================================================
--- testproj/trunk/file2.txt (original)
+++ testproj/trunk/file2.txt Sun Jan 23 00:39:13 2005
@@ -3,5 +3,14 @@
Test Line 1
Test Line 2
Test Line 3
+c:/svn/repo1 @ 23
+c:/svn/repo1 @ 24
+c:/svn/repo1 @ 25
...
My guess is that the diff on windows outputs the lines with CR/LF line
endings, which are somewhere in the script converted into LF/LF, which
in turn is converted into CR/LF/CR/LF... But that is just a guess (I
don't speak Python).
Any ideas?
Norbert
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: mailer.py now should work on Windows
Posted by Norbert Unterberg <ne...@gmx.net>.
Mark Therieau schrieb:
> I saw the same extra lines in the emailed diffs. I don't know if this is
> the correct fix or not, but changing the popen2/popen4 modes to text
> instead of binary worked for me...
Thank you, that patch fixes it for me, too!
Norbert
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: mailer.py now should work on Windows
Posted by Norbert Unterberg <ne...@gmx.net>.
Max Bowsher schrieb:
> The strange thing is that the Python smtplib normalizes newlines. So, I
> don't see how the weirdness you describe could occur, unless the
> GnuWin32 diff.exe was emitting bizarre newline combinations.
I have some new info on this:
The additinal new lines happen when you check in text files on Windows
that do not have the svn:eol-style property set. These files are checked
in with CRLF (windows) line endings. As soon as I set the svn:eol-style
property to native, the diff in the commit e-mail looks nice.
There seems to be some problems with converting/interpreting line
endings on the server side in the hook script?
Norbert
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: mailer.py now should work on Windows
Posted by Norbert Unterberg <ne...@gmx.net>.
Max Bowsher schrieb:
> Are you using sendmail or SMTP output mode?
Yes, I think so. At least the mail_command config option is not set.
> Could either of you add "print repr(self.buffer.getvalue())" to the
> end of SMTPOutput.finish, to see what the newlines look like at this
> stage?
Very strange, it mixes all kind of line endings.
The beginning of the diff part of the mail looks like this (I added line
breaks for readability, but the \r\n marks are from the print output):
==============================================================================\n
--- testproj/trunk/file2.txt\t(original)\r\n
+++ testproj/trunk/file2.txt\tSat Jan 29 00:53:50 2005\r\n
@@ -1,16 +1,9 @@\r\n
file2.txt \r\r\n
-\r\r\n
-c:/svn/repo1 @ 23 \r\r\n
-c:/svn/repo1 @ 24 \r\r\n
-c:/svn/repo1 @ 25 \r\r\n
-c:/svn/repo1 @ 26 \r\r\n
+line2\r\r\n
+line3\r\r\n
+line4\r\r\n
+line5\r\r\n
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: mailer.py now should work on Windows
Posted by Max Bowsher <ma...@ukf.net>.
Mark Therieau wrote:
> Norbert Unterberg <nepo <at> gmx.net> writes:
>> There remains an issue with the DIFFs. I have setup a diff.exe from the
>> GnuWin32 tools which works with the command line from
>> mailer.conf.example. The diffs are added to the commit mails.
>> BUT: Each line from the diff contains an extra CRLF pair.
>
> I saw the same extra lines in the emailed diffs. I don't know if this is
> the correct fix or not, but changing the popen2/popen4 modes to text
> instead of binary worked for me...
I'm rather confused.
Are you using sendmail or SMTP output mode?
I assume SMTP, since that would be far easier on Windows.
The strange thing is that the Python smtplib normalizes newlines. So, I
don't see how the weirdness you describe could occur, unless the GnuWin32
diff.exe was emitting bizarre newline combinations.
Could either of you add "print repr(self.buffer.getvalue())" to the end of
SMTPOutput.finish, to see what the newlines look like at this stage?
Max.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: mailer.py now should work on Windows
Posted by Mark Therieau <ma...@covergence.com>.
Norbert Unterberg <nepo <at> gmx.net> writes:
> There remains an issue with the DIFFs. I have setup a diff.exe from the
> GnuWin32 tools which works with the command line from
> mailer.conf.example. The diffs are added to the commit mails.
> BUT: Each line from the diff contains an extra CRLF pair.
I saw the same extra lines in the emailed diffs. I don't know if this is
the correct fix or not, but changing the popen2/popen4 modes to text
instead of binary worked for me...
regards,
markt
Index: mailer.py
===================================================================
--- mailer.py (revision 12828)
+++ mailer.py (working copy)
@@ -107,9 +107,9 @@
cmd = argv_to_command_string(cmd)
if capturestderr:
self.fromchild, self.tochild, self.childerr \
- = popen2.popen3(cmd, mode='b')
+ = popen2.popen3(cmd, mode='t')
else:
- self.fromchild, self.tochild = popen2.popen2(cmd, mode='b')
+ self.fromchild, self.tochild = popen2.popen2(cmd, mode='t')
self.childerr = None
def wait(self):
@@ -123,7 +123,7 @@
def __init__(self, cmd):
if type(cmd) != types.StringType:
cmd = argv_to_command_string(cmd)
- self.fromchild, self.tochild = popen2.popen4(cmd, mode='b')
+ self.fromchild, self.tochild = popen2.popen4(cmd, mode='t')
def wait(self):
rv = self.fromchild.close()
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org