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

Re: JavaHL - setConfigDirectory() method working?

From: Mark Phippard <markphip_at_gmail.com>
Date: Tue, 17 May 2011 08:36:57 -0400

On Mon, May 16, 2011 at 6:11 PM, Konstantin Kolinko
<knst.kolinko_at_gmail.com> wrote:
> 2011/5/16 Mark Phippard <markphip_at_gmail.com>:
>> Looking at the code in trunk, it seems like this is coded properly and
>> should be working.  I am seeing unexpected behavior.  Maybe I just do
>> not understand how it works?
>>
>> In Subclipse we expose UI to tell us the config directory location.
>> Most people just leave this as the default, which is same as command
>> line.  I wanted to test the password callbacks, so I pointed it at a
>> new folder so that I would get prompted again to cache credentials and
>> accept certs etc.  I have verified that the Subclipse code is properly
>> calling the method to set this folder, however I do not get any
>> prompts.
>>  Only if I rename the default config directory do I get
>> prompts.  And I also see SVN recreate the default.
>>
>> This leads me to believe this code is broken in trunk, but from what I
>> can see it looks right.
>>
>> It looks like it calls a method on ClientContext:
>>
>> ClientContext::setConfigDirectory(const char *configDir)
>> {
>>    // A change to the config directory may necessitate creation of
>>    // the config templates.
>>    SVN::Pool requestPool;
>>    SVN_JNI_ERR(svn_config_ensure(configDir, requestPool.pool()), );
>>
>>    m_configDir = (configDir == NULL ? "" : configDir);
>> }
>>
>> Any ideas?
>
> Just guessing:
>
> 1. When you call the method, does it create
> "README.txt", "config", "servers" files in the specified directory?
>
> If so, then svn_config_ensure(..) call works correctly.

Yes. But that is also why it seems like a problem in SVN. I can see
it create the folder but the actual auth cache is still coming from
the default folder. And if I remove the default folder, it gets
recreated.

> 2. The m_configDir field is later used by
> ClientContext::getContext(CommitMessage *message)
>
> Are you calling getContext() after the call to setConfigDirectory() ?

getContext() is not exposed to JavaHL. It is only used internally by the C++.

> 3. Command line client works:
> svn --config-dir conf co https://127.0.0.1/
> creates the configuration directory, asks whether I trust the
> certificate and remember the choice.
>
> This is with svn 1.7.0-dev from TortoiseSVN nightly. It is built from
> r1103260 of trunk.

These questions are about JavaHL, not the CLI. Of course it is good
to validate it with the CLI, but as an example, I do not recall the
CLI ever using the auth cache of the default configuration area when
--config-dir was passed. So it seems like this is potentially a
problem in the way JavaHL is driving the API.

-- 
Thanks
Mark Phippard
http://markphip.blogspot.com/
Received on 2011-05-17 14:37:29 CEST

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.