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

RE: SVN Protocol

From: Ramprasad Venkata Inala <rinala_at_cordys.com>
Date: 2005-07-08 06:45:31 CEST

-----Original Message-----

**********************************************************************
The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this message
by anyone else is unauthorized. If you are not the intended recipient, any
disclosure, copying, or distribution of the message, or any action or
omission taken by you in reliance on it, is prohibited and may be unlawful.
Please immediately contact the sender if you have received this message in
error.
**********************************************************************

From: Ben Collins-Sussman [mailto:sussman@collab.net]
Sent: Thursday, July 07, 2005 7:29 PM
To: Ramprasad Venkata Inala
Cc: Max Bowsher; dev@subversion.tigris.org
Subject: Re: SVN Protocol

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.

Reply:

I am trying to do the checkout first time on my working directory where
there are no files at all.
Ok I shall send a sentence to the requester( a JNI call ).

> 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?

Reply:
I am using this because, in the svndiff-test.c the out-stream has been
encoded. I am not sure why?

> 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?

Reply:
I need send the svndiff back to the client( ( actual )client would be
the svnclient like eclipse plugin, tortoise etc.), I assume that I need
to send the diff back to the client in the protocol for which it makes
me to do a jni call ( this assumption is on the basis of the data
captured on Ehtereal, if it is not correct please let me know what
should be sent there.).

( textdelta-chunk ( 2:c1 4:SVN ) ) ( textdelta-chunk ( 2:c1 5:????? ) )
( textdelta-chunk ( 2:c1 1:? ) ) ( textdelta-chunk ( 2:c1 1:h ) )

I am trying to send the above as a byte array from java to the client.
Where the the sequence of 5 question marks are bytes as mentioned below
( I have just hard coded them ). This also was capture from Ethereal
tool.

0x0, // Source view offset 0
0x0, // Source view length 0
0x2, // Target view length 2
0x1, // Instruction length 7 ( I am not sure how
and what instruction should be given )
0x1, // New data length 1 for 'h'

The next single question mark is the character I do not know. I was
trying to send the 0x82 character which was captured by the ethereal.
That was my initial query how and what to send in the protocol.

Thanks an Regards
Ramprasad

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jul 8 06:46:26 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.