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

RE: How to get a delta stream?

From: William Ferguson <william.ferguson_at_hubbub.com.au>
Date: 2005-06-30 01:36:17 CEST

Thanks Ben,

yes I could use svn_ra_get_file to retrieve streams to both Revisions,
create an svn_txdelta_stream_t from the two, svn_txdelta_to_svndiff to get
the appropriate diff handler and then svn_txdelta_send_txstream to produce a
stream of the delta. Thats my current fallback position.

I was just wondering whether there was a way to get the delta without having
to retrieve a full content stream for the start and end Revision. Ie I'd
rather just work from the interesting Revisions if possible, since some of
the files could be quite large. For instance I thought it might be possible
to generate the delta during the call to svn_ra_get_file_revs, but I can't
work out what svn_delta calls I should make inside the
svn_ra_file_rev_handler_t in order to push that Revision's delta into the
stream. Any ideas?

William

-----Original Message-----
From: Ben Collins-Sussman [mailto:sussman@collab.net]
Sent: Wednesday, 29 June 2005 11:06 PM
To: William Ferguson
Cc: 'users@subversion.tigris.org'
Subject: Re: How to get a delta stream?

On Jun 29, 2005, at 1:42 AM, William Ferguson wrote:

> I'm putting together a component that uses the API of the RA layer
> of SVN
> 1.2.0 and I was wondering what mechnism I should use to retrieve a
> stream
> containing the SVN diff delta between 2 Revisions of a target
> Resource?
>
> By looking at the code of repos.c (lines 2453-2477) in mod_dav_svn
> I can see
> how to do it once I have an svn_txdelta_stream_t and I can see that
> mod_dav_svn gets one of those using svn_fs_get_file_delta_stream.
> Is there a
> way to do this using the RA layer?

libsvn_delta (svn_delta.h) is the low-level API for generating binary-
difference streams between two files. (And also for decoding binary
differences.) It's used by higher-level APIs on both client and
server sides. That's what svn_fs_get_file_delta_stream() is using
under the hood.

But the RA API is too high-level here for what you're asking. It has
svn_ra_get_file() to get a single version of a file (which will still
be delivered as a compressed binary-diff stream), so one option is to
fetch the two files to tmpfiles, then use svn_delta.h to binary-diff
them. That's what 'svn merge' does.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Jun 30 01:41:34 2005

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

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