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

Re: Bug with SVN::Client::diff() and in-memory files

From: Malcolm Rowe <malcolm-svn-dev_at_farside.org.uk>
Date: 2006-11-08 17:23:32 CET

On Wed, Nov 08, 2006 at 04:23:58PM +0100, Erik Huelsmann wrote:
> >> >SVN::Client::diff() is supposed to take (as part of its interface) two
> >file
> >> >handles, where the output and errors will be sent, respectively.
> >> >
> >> >If these are two file handles that correspond to files on disk then
> >> >everything works as expected.
> >> >
> >>
> >> This is not all that surprising. The diff functions don't take
> >> streams, they work in terms of apr_file_t, so they really do expect
> >> there to be an actual file on disk. The fix is to rewrite them to
> >> work in terms of streams (not trivial, IIRC), or work around it in
> >> either the bindings or in your application by writing that in-memory
> >> data to disk and passing in handles to those files to diff.
> >>
> >
> >I doubt that the diff code really needs the file to exist on disk,
> >though it probably does need it to be a seekable filehandle.
> As the diff code shares a lot of code with merge, that code *does*
> require a disk file, since it tries to mmap the files. I have never
> actually looked through the code thoroughly enough to determine
> necessity for merge, but in the presence of mmap, this requirement
> can't be lifted now.

Just to clarify: we're talking solely about the filehandles passed as
the output and error 'streams' for diff, not anything related to the
input files (which yes, need to be mmapable).

I doubt we need to mmap those filehandles :-)


  • application/pgp-signature attachment: stored
Received on Wed Nov 8 17:24:38 2006

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