Bug with SVN::Client::diff() and in-memory files
From: Nik Clayton <nik_at_ngo.org.uk>
Date: 2006-11-08 12:57:53 CET
All,
SVN::Client::diff() is supposed to take (as part of its interface) two file
If these are two file handles that correspond to files on disk then
Perl has the facility to open what are called "in memory" files, where the
I've attached diff.pl which shows the problem:
Run
./diff.pl 0 http://svn.collab.net/repos/svn 2 1
(or use another repo). You should see the diff printed to STDOUT.
Change that to
./diff.pl 1 http://svn.collab.net/repos/svn 2 1
to use in-memory files. I get (error message wrapped):
Bad file descriptor: Can't write to stream: Bad file descriptor at
This seems to be coming from libsvn_subr/io.c:svn_io_file_write(), which in
As far as Perl is concerned there shouldn't be any difference between the
Can anyone else reproduce this?
Some other client functions work correctly. For example, SVN::Client::cat()
subversion/bindings/swig/perl/native/svn_client.c
it looks as though this might be because ::cat()'s first argument is an
Is there a reason for this discrepency?
N
#!/usr/bin/perl
use strict;
use SVN::Client;
# Arguments (all optional):
my $uri = shift || 'file:///home/nik/.svk/jc/local/CPAN/SVN-Web/trunk';
my($out_fh, $err_fh, # File handles
if($in_memory) {
$ctx->diff([], $uri, $rev1, $uri, $rev2, 0, 1, 0, $out_fh, $err_fh);
local $/ = undef;
close($out_fh);
if(! $in_memory) { # Delete temp files if necessary
---------------------------------------------------------------------
|
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.