On Jul 6, 2005, at 5:47 AM, Ramprasad Venkata Inala wrote:
>
> Step 1.
>
> txdelta_stream = svn_txdelta (source_stream, target_stream);
>
> My Implementation:
> apr_initialize();
>
> pool = svn_pool_create (NULL);
> src_buf = svn_stringbuf_create( "h", pool );
> tgt_buf = svn_stringbuf_create( "", pool );
> src_stream = svn_stream_from_stringbuf(
> src_buf, pool );
> tgt_stream = svn_stream_from_stringbuf(
> tgt_buf, pool );
>
> svn_txdelta (&txdelta_stream, src_stream, tgt_stream, pool);
>
Are you attempting to transmit just the letter "h" as file contents?
You might be better off trying to transmit an entire sentence, it's
probably a better test that things are working.
Regardless, if source="h" and target="", you're sending a difference
that changes a file containing "h" into an empty file. That's not
what you want, is it? It's backwards. To send new data, the source
should be "" and the target should contain the final text.
> Step 2.
>
> Get window handler to do something with delta. If using an
> "editor" to transmit information:
>
> window_consumer_func = editor->apply_textdelta (file_baton);
>
> If you want raw vcdiff data for embedding in XML or HTTP
> transactions:
>
> window_consumer_func = svn_txdelta_to_vcdiff (txdelta_stream);
>
> My Implementation:
>
> encoder = svn_base64_encode_string(
> svn_string_create_from_buf(src_buf,pool), pool );
>
> svn_txdelta_to_svndiff (encoder, pool, &svndiff_handler,
> &svndiff_baton);
>
Why are you base-64 encoding anything at all?
> Step 3 And 4
>
> Loop until there are no more windows:
> txdelta_window = svn_txdelta_next_window (txdelta_stream);
> window_consumer_func (txdelta_window);
> svn_txdelta_free_window (txdelta_window);
>
> Be sure to call window_consumer_func with a NULL window when there
> are no more windows to consume.
>
> svn_txdelta_free (txdelta_stream);
>
> My Implementation:
>
> err = svn_txdelta_send_txstream (txdelta_stream,
> svndiff_handler,
> svndiff_baton,
> pool);
>
> return (*env)->NewStringUTF(env, encoder->data);
>
> I should return a data that has been encoded in svn format to the java
> program hence the above statement.
I have to admit, I've lost track of what you're trying to do here.
Are you trying to send 'svndiff' data? Or just regular data? Who is
making the request? Who is responding? What is the requester
expecting to see?
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Jul 7 16:01:29 2005