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

Re: mailer.py on Windows (and general svn-on-Windows commentary...)

From: Erik Huelsmann <ehuels_at_gmail.com>
Date: Mon, 8 Sep 2008 21:32:27 +0200

On Mon, Sep 8, 2008 at 9:29 PM, Trent Nelson
<svn-dev-list_at_trentnelson.com> wrote:
> On Mon, Sep 08, 2008 at 09:06:53PM +0200, Erik Huelsmann wrote:
>> On Mon, Sep 8, 2008 at 8:36 PM, Trent Nelson
>> <svn-dev-list_at_trentnelson.com> wrote:
>> > mailer.py suffers a similar issue on Windows as svnperms.py, both
>> > due to its use of popen() to run '/usr/bin/diff', as well as the
>> > lack of said program on Windows.
>> >
>> > I used mailer.py as a reference when I started the svn2cq module,
>> > which will eventually sync svn changes into a relational database,
>> > although currently it's no more than a more object-oriented version
>> > of mailer.py, without, er, the ability to send e-mail. As it's for
>> > a client that's a Windows shop, I just packaged diff.exe and the
>> > dependent .dlls in the module directory and replaced mailer.py's
>> > popen with subprocess:
>> >
>> > http://code.google.com/p/svn2cq/source/browse/trunk/src/svn2cq/
>> >
>> > You know what would be nice? If the out-of-the-box Subversion 1.5
>> > installer on Windows shipped not only mailer.py, but diff.exe and
>> > the .dlls as well. Oh, and used subprocess, if available.
>> How about -instead of using diff.exe- using the built-in diff engine
>> (libsvn_diff)? It's available to use from the python bindings and - if
>> you think that won't do it for you - you could instead use 'svnlook
>> diff' which extracts the diffs right out of the repository, whenever
>> possible.
> I believe that's what the rest of the code uses when generating
> diffs. The reliance on /usr/bin/diff is, or was, required for
> generating diffs against propchanges, I think. Does that sound
> right? If all the relevant diff facilities are available via
> libsvn_diff, why does mailer.py bother calling /usr/bin/diff?
> (Assuming libsvn_diff doesn't work, I agree that 'svnlook diff'
> would be a much better option (via subprocess, of course) than
> shipping diff.exe et al.)

If this is for properties, I can only highly recommend to use the
built-in difflib module in python. libsvn_diff has new APIs allowing
it to diff in-memory data, but getting that to work will be *much*
harder than sending the strings into difflib.



To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-09-08 21:32:39 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.