You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by void pointer <rc...@gmail.com> on 2008/12/13 01:44:57 UTC

SVN API: How to handle authentication and other callbacks?

Hi,

I'm currently trying to learn the Subversion 1.5.4 library. I'm working on a
small prototype that is supposed to perform a basic checkout. However, I'm
unable to get the svn_client_checkout3() function to succeed. It's crashing
somewhere in the Subversion DLL, so I don't know exactly what the problem
could be. Just guessing, but I think this might be an issue with no
callbacks being registered. For example, there's callbacks to prompt when a
username or password is needed. There's also callbacks to handle
informational data (A sort of progress log) I'm sure. I'm not sure how to go
about setting up the callbacks I need to perform a checkout, much less which
callbacks are required in the first place. Can someone briefly run me
through what I need to do to complete my prototype? I've done as much as I
can up to this point independently. Below is my prototype code:


void test_svn()
{
    apr_initialize();

    apr_pool_t* pool;
    apr_pool_create( &pool, NULL );

    svn_error_t* err;

    svn_client_ctx_t* clientcontext;
    err = svn_client_create_context( &clientcontext, pool );
    assert( err == NULL );

    svn_opt_revision_t pegrevision;
    pegrevision.kind = svn_opt_revision_unspecified;

    svn_opt_revision_t revision;
    revision.kind = svn_opt_revision_head;

    svn_client_checkout3(   NULL,
                            "http://haresvn.googlecode.com/svn/trunk/include
",
                            "C:\\test_checkout",
                            &pegrevision,
                            &revision,
                            svn_depth_infinity,
                            false,
                            false,
                            clientcontext,
                            pool
                            );
}

Thanks in advance for any assistance.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=983618

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: SVN API: How to handle authentication and other callbacks?

Posted by void pointer <rc...@gmail.com>.
On Sat, Dec 13, 2008 at 1:08 PM, D.J. Heap <dj...@gmail.com> wrote:

> On Sat, Dec 13, 2008 at 10:12 AM, void pointer <rc...@gmail.com> wrote:
> [snip]
>
>> I haven't, but I'll look through it. I was looking for a more bare,
>> simplified example, though.
>>
>> I'm not sure I quite understand the 'baton' concept. Is that basically
>> "user data"? I read through all the documentation I could find on the
>> subject but it doesn't quite explain it very well for me. In all of the
>> cases I've seen it used, it looks like just user data. Usually an arbitrary
>> object is passed into this parameter. Is this correct?
>>
>
> Have you looked at the minimal client example?
> http://svn.collab.net/repos/svn/trunk/tools/examples/minimal_client.c
>

Thanks, I'll have a look at it. On a side-note, I'm not sure why the list is
setting my name to "void pointer", it doesn't seem to be using the name I've
specified in my webmail settings. Sorry for the confusion!

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=983999

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=988217

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: SVN API: How to handle authentication and other callbacks?

Posted by void pointer <rc...@gmail.com>.
On Sat, Dec 13, 2008 at 1:08 PM, D.J. Heap <dj...@gmail.com> wrote:

> On Sat, Dec 13, 2008 at 10:12 AM, void pointer <rc...@gmail.com> wrote:
> [snip]
>
>> I haven't, but I'll look through it. I was looking for a more bare,
>> simplified example, though.
>>
>> I'm not sure I quite understand the 'baton' concept. Is that basically
>> "user data"? I read through all the documentation I could find on the
>> subject but it doesn't quite explain it very well for me. In all of the
>> cases I've seen it used, it looks like just user data. Usually an arbitrary
>> object is passed into this parameter. Is this correct?
>>
>
> Have you looked at the minimal client example?
> http://svn.collab.net/repos/svn/trunk/tools/examples/minimal_client.c
>

Thanks, I'll have a look at it. On a side-note, I'm not sure why the list is
setting my name to "void pointer", it doesn't seem to be using the name I've
specified in my webmail settings. Sorry for the confusion!

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=983999

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: SVN API: How to handle authentication and other callbacks?

Posted by "D.J. Heap" <dj...@gmail.com>.
On Sat, Dec 13, 2008 at 10:12 AM, void pointer <rc...@gmail.com> wrote:
[snip]

> I haven't, but I'll look through it. I was looking for a more bare,
> simplified example, though.
>
> I'm not sure I quite understand the 'baton' concept. Is that basically
> "user data"? I read through all the documentation I could find on the
> subject but it doesn't quite explain it very well for me. In all of the
> cases I've seen it used, it looks like just user data. Usually an arbitrary
> object is passed into this parameter. Is this correct?
>

Have you looked at the minimal client example?
http://svn.collab.net/repos/svn/trunk/tools/examples/minimal_client.c

DJ

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=983840

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: SVN API: How to handle authentication and other callbacks?

Posted by Stefan Sperling <st...@elego.de>.
On Sat, Dec 13, 2008 at 11:12:27AM -0600, void pointer wrote:
>    I'm not sure I quite understand the 'baton' concept. Is that basically
>    "user data"?

Yes.

Stefan

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=983802

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: SVN API: How to handle authentication and other callbacks?

Posted by "D.J. Heap" <dj...@gmail.com>.
On Sat, Dec 13, 2008 at 10:12 AM, void pointer <rc...@gmail.com> wrote:
[snip]

> I haven't, but I'll look through it. I was looking for a more bare,
> simplified example, though.
>
> I'm not sure I quite understand the 'baton' concept. Is that basically
> "user data"? I read through all the documentation I could find on the
> subject but it doesn't quite explain it very well for me. In all of the
> cases I've seen it used, it looks like just user data. Usually an arbitrary
> object is passed into this parameter. Is this correct?
>

Have you looked at the minimal client example?
http://svn.collab.net/repos/svn/trunk/tools/examples/minimal_client.c

DJ

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=983840

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=988250

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: SVN API: How to handle authentication and other callbacks?

Posted by void pointer <rc...@gmail.com>.
On Sat, Dec 13, 2008 at 8:23 AM, Hyrum K. Wright <
hyrum_wright@mail.utexas.edu> wrote:

> void pointer wrote:
> > Hi,
> >
> > I'm currently trying to learn the Subversion 1.5.4 library. I'm working
> on a
> > small prototype that is supposed to perform a basic checkout. However,
> I'm
> > unable to get the svn_client_checkout3() function to succeed. It's
> crashing
> > somewhere in the Subversion DLL, so I don't know exactly what the problem
> > could be. Just guessing, but I think this might be an issue with no
> > callbacks being registered. For example, there's callbacks to prompt when
> a
> > username or password is needed. There's also callbacks to handle
> > informational data (A sort of progress log) I'm sure. I'm not sure how to
> go
> > about setting up the callbacks I need to perform a checkout, much less
> which
> > callbacks are required in the first place. Can someone briefly run me
> > through what I need to do to complete my prototype? I've done as much as
> I
> > can up to this point independently. Below is my prototype code:
> >
> >
> > <snip>
> >
> > Thanks in advance for any assistance.
>
> Have you tried looking at the Subversion sources to see what they do?  I
> this
> case, I think subversion/svn/commit-cmd.c would be helpful.


I haven't, but I'll look through it. I was looking for a more bare,
simplified example, though.

I'm not sure I quite understand the 'baton' concept. Is that basically "user
data"? I read through all the documentation I could find on the subject but
it doesn't quite explain it very well for me. In all of the cases I've seen
it used, it looks like just user data. Usually an arbitrary object is passed
into this parameter. Is this correct?

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=983801

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=988313

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: SVN API: How to handle authentication and other callbacks?

Posted by void pointer <rc...@gmail.com>.
On Sat, Dec 13, 2008 at 8:23 AM, Hyrum K. Wright <
hyrum_wright@mail.utexas.edu> wrote:

> void pointer wrote:
> > Hi,
> >
> > I'm currently trying to learn the Subversion 1.5.4 library. I'm working
> on a
> > small prototype that is supposed to perform a basic checkout. However,
> I'm
> > unable to get the svn_client_checkout3() function to succeed. It's
> crashing
> > somewhere in the Subversion DLL, so I don't know exactly what the problem
> > could be. Just guessing, but I think this might be an issue with no
> > callbacks being registered. For example, there's callbacks to prompt when
> a
> > username or password is needed. There's also callbacks to handle
> > informational data (A sort of progress log) I'm sure. I'm not sure how to
> go
> > about setting up the callbacks I need to perform a checkout, much less
> which
> > callbacks are required in the first place. Can someone briefly run me
> > through what I need to do to complete my prototype? I've done as much as
> I
> > can up to this point independently. Below is my prototype code:
> >
> >
> > <snip>
> >
> > Thanks in advance for any assistance.
>
> Have you tried looking at the Subversion sources to see what they do?  I
> this
> case, I think subversion/svn/commit-cmd.c would be helpful.


I haven't, but I'll look through it. I was looking for a more bare,
simplified example, though.

I'm not sure I quite understand the 'baton' concept. Is that basically "user
data"? I read through all the documentation I could find on the subject but
it doesn't quite explain it very well for me. In all of the cases I've seen
it used, it looks like just user data. Usually an arbitrary object is passed
into this parameter. Is this correct?

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=983801

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: SVN API: How to handle authentication and other callbacks?

Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
void pointer wrote:
> Hi,
> 
> I'm currently trying to learn the Subversion 1.5.4 library. I'm working on a
> small prototype that is supposed to perform a basic checkout. However, I'm
> unable to get the svn_client_checkout3() function to succeed. It's crashing
> somewhere in the Subversion DLL, so I don't know exactly what the problem
> could be. Just guessing, but I think this might be an issue with no
> callbacks being registered. For example, there's callbacks to prompt when a
> username or password is needed. There's also callbacks to handle
> informational data (A sort of progress log) I'm sure. I'm not sure how to go
> about setting up the callbacks I need to perform a checkout, much less which
> callbacks are required in the first place. Can someone briefly run me
> through what I need to do to complete my prototype? I've done as much as I
> can up to this point independently. Below is my prototype code:
> 
> 
> void test_svn()
> {
>     apr_initialize();
> 
>     apr_pool_t* pool;
>     apr_pool_create( &pool, NULL );
> 
>     svn_error_t* err;
> 
>     svn_client_ctx_t* clientcontext;
>     err = svn_client_create_context( &clientcontext, pool );
>     assert( err == NULL );
> 
>     svn_opt_revision_t pegrevision;
>     pegrevision.kind = svn_opt_revision_unspecified;
> 
>     svn_opt_revision_t revision;
>     revision.kind = svn_opt_revision_head;
> 
>     svn_client_checkout3(   NULL,
>                             "http://haresvn.googlecode.com/svn/trunk/include
> ",
>                             "C:\\test_checkout",
>                             &pegrevision,
>                             &revision,
>                             svn_depth_infinity,
>                             false,
>                             false,
>                             clientcontext,
>                             pool
>                             );
> }
> 
> Thanks in advance for any assistance.

Have you tried looking at the Subversion sources to see what they do?  I this
case, I think subversion/svn/commit-cmd.c would be helpful.

-Hyrum

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=983746

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].