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

Re: Checkin without working copy

From: Dirk Hoffmann <dh.discuss_at_web.de>
Date: 2004-09-29 12:37:34 CEST

Dirk Hoffmann wrote:

> Ben Collins-Sussman wrote:
>
>>
>> On Sep 27, 2004, at 7:45 AM, Dirk Hoffmann wrote:
>>
>>> Hi Ben,
>>>
>>> I'm extending the libsvn_client API by a svn_client_put()-function
>>> and find it quite difficult to deal with all those batons, pools
>>> etc.. I wrote 50 lines of code before coming to
>>> `editor->open_root(...)', just by copying&pasting from already
>>> existing code without fully understanding what I'm really coding.
>>>
>>> Would you please send me the sources of your `svnput'-tool just as
>>> an example. That would make my efforts a lot easier than they are at
>>> the moment.
>>>
>>
>> I committed it into Subversion weeks ago. It already works. Just
>> compile and go:
>>
>> http://svn.collab.net/repos/svn/trunk/tools/examples/svnput.c
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
>> For additional commands, e-mail: users-help@subversion.tigris.org
>>
>>
> Hm,
>
> for me it doesn't work as expected.
>
> First, the authentication dialog starts with asking for the password
> and continues with asking for the username and then the password again.
>
> Then it crashes with a Segmentation fault. I ran gdb on it and found
> that the crash occurred when I tried to execute the line
>
> err = editor->apply_textdelta (file_baton, NULL, pool,
> &handler, &handler_baton);
>
> I called svnput like so:
> ./svnput a_file http://dhoffmann:50080/packer/repos/test/a_file
>
> The root of the repo is http://dhoffmann:50080/packer/repos/test
>
> I'm sending mail messages to you and to the user list as well. Is that
> ok?
>
> Best regards
> Dirk
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>
Hi Ben,

I did some debugging on the SIGSEGV.

The open_temp_file callback was missing in cbtable (which as far as I
learned from some comments will only be called when svn is accessed over
http)

This is what I added to make things work:

before the main function:

static svn_error_t *
my_open_tmp_file_callback (apr_file_t **fp,
void *callback_baton,
apr_pool_t *pool) {
const char* temp_dir;
const char* temp_file_prefix;
const char* temp_file_name;

SVN_ERR (svn_io_temp_dir (&temp_dir, pool));

temp_file_prefix = (const char*)svn_path_join (temp_dir, "svnput", pool);

SVN_ERR (svn_io_open_unique_file (fp, &temp_file_name,
temp_file_prefix, ".tmp", TRUE, pool));

return SVN_NO_ERROR;
}

inside the main function:

cbtable->open_tmp_file = my_open_tmp_file_callback;

There is still the authentication dialog problem.

Best regards
Dirk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Sep 29 12:38:07 2004

This is an archived mail posted to the Subversion Users mailing list.