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

Re: svn commit: r1241097 - in /subversion/trunk/subversion: libsvn_client/repos_diff.c libsvn_delta/compat.c libsvn_fs_base/tree.c libsvn_fs_fs/tree.c libsvn_wc/externals.c libsvn_wc/update_editor.c

From: Hyrum K Wright <hyrum.wright_at_wandisco.com>
Date: Mon, 6 Feb 2012 14:18:52 -0600

On Mon, Feb 6, 2012 at 2:03 PM, Greg Stein <gstein_at_gmail.com> wrote:
> On Mon, Feb 6, 2012 at 14:32, Hyrum K Wright <hyrum.wright_at_wandisco.com> wrote:
>> On Mon, Feb 6, 2012 at 1:28 PM, Greg Stein <gstein_at_gmail.com> wrote:
>>> On Mon, Feb 6, 2012 at 12:48,  <hwright_at_apache.org> wrote:
>>>> Author: hwright
>>>> Date: Mon Feb  6 17:48:36 2012
>>>> New Revision: 1241097
>>>>
>>>> URL: http://svn.apache.org/viewvc?rev=1241097&view=rev
>>>> Log:
>>>> Ev2 shims: Truthfully report our base checksum as being that of the empty
>>>> stream.
>>>>
>>>> Note: This breaks several assumptions in various delta-editor receivers about
>>>> the validity of this checksum.  These have been patched to ignore the checksum
>>>> if it is that of the empty stream.  This will not affect correctness, as the
>>>> final checksum, as supplied by close_file() is still used to detect corruption,
>>>> and it hasn't changed.
>>>
>>> How does this even work? Sure, the checksum isn't checked, but the
>>> delta-editor receiver is going to choose the wrong base contents to
>>> apply the delta against.
>>
>> Huh?  The delta-editor receiver isn't using this to choose any base
>> contents, it's simply using it as some kind of intermediate
>> verification step.
>>
>> Before this change, we just passed a NULL checksum, which was *always*
>> ignored, and everything Just Worked.  With this change, we started
>> being honest, and various pieces of the system didn't appreciate that
>> honesty.
>
> If the shim sends a delta against the empty-stream, then how can the
> Ev1 receiver properly apply that? Won't the receiver use some selected
> base contents? ie. NOT the empty stream?
>
> I'm thinking of the delta application to a base. How can that possibly
> work, if the shim creates a delta against the empty stream?

The shim uses svn_txdelta_send_stream() to send the contents stream to
the receiver's apply_textdelta() handler. svn_txdelta_send_stream()
doesn't use a source stream: "This is effectively a 'copy' operation,
resulting in delta windows that make the target equivalent to the
stream."

I haven't looked at the implementation of svn_txdelta_send_stream(),
but my guess is that it just feeds delta-window-size chunks of data to
the window handler from the source, for which it obviously doesn't
need a base.

-Hyrum

-- 
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/
Received on 2012-02-06 21:19:25 CET

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.