[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: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2005-06-29 15:06:04 CEST

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 Wed Jun 29 15:09: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.