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

Re: How to generate text deltas for cvs2svn using the Python bindings?

From: Ben Collins-Sussman <sussman_at_red-bean.com>
Date: 2007-04-01 05:34:45 CEST

On 3/31/07, Michael Haggerty <mhagger@alum.mit.edu> wrote:

> Suppose I have two versions of a file (for example, in Python strings or
> file-like objects) and I want to generate the text delta between them in
> a form that I can stick in an svndump file. Can I do this using the
> Python SVN bindings?
>
> Example code would be very welcome.

Off the top of my head, I think you just need to create an
svn_stream_t for each of the files, and then create a 'txdelta stream'
from them... that is, a stream from which you pull 'txdelta' windows
(of svndiff data) and push them at a window consumer routine
(presumably one you write, which dumps the data to a dumpfile.)

I'm not entirely sure if svn_delta.h has been swigged into python, but
that's probably the API you want. Take a look at how svn_repos_dump()
works in libsvn_repos -- see how it generates svndiff data into the
dumpfile.

Here's a document I wrote in ancient days that might help. Brush off the dust:

    http://svn.collab.net/repos/svn/trunk/notes/txdelta_sanity

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Apr 1 05:35:00 2007

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.