On Fri, Jan 19, 2001 at 08:38:19PM -0600, Ben Collins-Sussman wrote:
>...
> Specifically:
>
> - remove the editor's apply_txdelta() routine
> - create two new routines:
>
> apply_delta (filebaton, [src_stream], target_stream)
> set_file_contents (filebaton, [src_stream], delta,
> enum delta_type)
Correction:
set_file_contents (filebaton, [src_stream], target_stream)
apply_delta (filebaton, [src_stream], delta,
enum delta_type)
>...
apply_delta() sends svndiff deltas.
Actually, it sends a delta in the format described by DELTA_TYPE. At the
moment, that can only be SVNDIFF. In the future, we might have UNIDIFF,
GNUDIFF, or whatever.
> set_file_contents() can send plain text or other
> types.
Nope. set_file_contents() *only* passes "plain text". (actually, it might
not be "text" ... could be a binary)
> It becomes the obligation of the editor implementation to
> implement at least one of these two routines; if one
> routine is NULL, the driver must use the other.
The editor should implement at least one, preferably both. The driver will
choose its "preferred" form; if the editor doesn't implement it, then the
driver (hopefully) will defer to the other. This is a simple negotiation
between the driver/editor on what can be used, and which is preferred.
> Rationale:
>
> It's too restrictive to force every editor implementation to accept
> and deal with small svndiff windows. For example: Greg Stein wants
> to send plain text while debugging his commit-editor and network
> layer. It's best to allow the RA layer to make it's own choice
> about how to break up the two streams most efficiently.
We also have the situation of ra_xml: the output form is defined by command
line switches. The interpretation of those switches is performed by ra_xml.
The new form allows ra_xml to output SVNDIFF or plain text or whatever it
likes. In the old scheme, the WC would only pass deltas -- the RA layer had
no choice for what it would spit out, and in which form.
> The reason [src_stream] is optional is that it may be NULL; this
> presumably means that the editor already has access to the src
> stream.
This means the driver doesn't have it. Hopefully, the editor *does*. If you
call apply_delta() with a NULL source and the editor doesn't have it, then
you're going to get an error.
Cheers,
-g
--
Greg Stein, http://www.lyra.org/
Received on Sat Oct 21 14:36:19 2006