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

Re: Question regarding svn_ra_do_update and delta data

From: Ph. Marek <philipp.marek_at_bmlv.gv.at>
Date: 2005-12-12 08:27:21 CET

On Friday 09 December 2005 20:35, kfogel@collab.net wrote:
> "Ph. Marek" <philipp.marek@bmlv.gv.at> writes:
> > The problem is:
> > - I've local files, which I knew at which version they've been when
> > checking out.
> > - They are changed.
> > - I have no original full-text available.
> > - I'd like to update them.
> >
> > Currently I just do an svn_ra_do_update() and receive the tree diffs as
> > usual - new files, deleted files, and so on.
> > But if a file has changed locally *and* in the repository - what should I
> > do? I tried to give /dev/null or an empty stringbuf as source for
> > svn_txdelta_apply; but that gives me "Delta source ended unexpectedly".
> I don't understand what you mean by "I tried to give /dev/null or an
> empty stringbuf as source for svn_txdelta_apply". You're calling
> svn_ra_do_update(), a function which thinks its updating a working
> copy, and which will try to report that working copy's state to the
> server in order to get an efficient update response back. Where did
> you have an opportunity to even be calling svn_txdelta_apply()? You
> don't drive the editor; the RA layer does.
I call svn_ra_do_update() and report my "working copy"-state. This is
currently everything at the last committed/checked out version.
On finish_report() my update_editor is called, which has a callback for

In this function I currently give an apr_stream of /dev/null or, for special
files (symlinks, devices, etc., with a small text-size) an empty stringbuf to
the function svn_txdelta_apply.

But this is of course not what svn_txdelta_apply expects; AFAIK it wants the
old (reported) version of the file to do an svndelta-update.
This is possible if the file was not modified locally; but if it's changed,
I'm out of luck. I simply have no original version for the delta-update.

Is there a way to specify which blocks of a file I'd like to get? eg. saying
"file /trunk/test.txt in revision 73, give me bytes 1021 to 6321, and 7321 to
Because I'm storing checksums for parts of the file I know which parts I
already (still) have; so I'd only have to ask for the missing/changed blocks.

Or alternatively, I'd be happy with a function which gets a local file and an
URL and constructs me the new file with an rsync-like algorithm :-)

> So, I think I'd need a lot more detail to understand what you did
> above :-).
If the above explanation is still not detailed enough, please tell me what
parts I'm not telling :-)

> > Is there a way to receive text updates in full, ie. not as a diff, for
> > some files in an update-operation?
> Well, can you use the reporter handed back to you by
> svn_ra_do_update() to tell the server that you don't those files?
Is it enough to report a directory at version X, and a file in it as version 0
to get a full-text? Or will I get an error "file/directory does not exist at
this revision"?

Thank you for your patience.



To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Dec 12 08:28:08 2005

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.