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

Re: Fix issue #2363: Ignore unreadable files with a warning.

From: Nicolás Lichtmaier <nick_at_reloco.com.ar>
Date: 2007-04-07 21:11:42 CEST

John Szakmeister wrote:

> I think it basically boiled down to the fact that
> svn_config_get_config() is called directly by main(). There is no
> client context at that point. So, if we want to dump a warning we
> need to do it from main() of the client (and yes, every client would
> have to do the same if they want the same behavior). Otherwise, we
> could clear the error and return an empty configuration silently. The
> down side is that you don't get a warning. The upside is that
> everyone benefits. We could also add a callback, rev the api, and
> provide a warning that way. But it hardly seems worth the effort.
>
> I think that's where we're at for the moment.

Exactly. The problem is detected in the function svn_config__parse_file.
When this function is called, this is the backtrace:

#0 svn_config__parse_file (cfg=0x8167fd0,
    file=0x8167f50 "/etc/subversion/servers", must_exist=0, pool=0x81679c0)
#1 0x08111032 in svn_config_read (cfgp=0xbfa1756c,
    file=0x8167f50 "/etc/subversion/servers", must_exist=0, pool=0x81679c0)
#2 0x081110c1 in read_all (cfgp=0xbfa1756c, sys_registry_path=0x0,
    usr_registry_path=0x0, sys_file_path=0x8167f50
"/etc/subversion/servers",
    usr_file_path=0x8167fb0 "/home/nick/.subversion/servers",
pool=0x81679c0)
#3 0x0811121c in get_category_config (cfg=0xbfa1756c, config_dir=0x0,
    category=0x8152bd9 "servers", pool=0x81679c0)
#4 0x08111272 in svn_config_get_config (cfg_hash=0x8167eac,
config_dir=0x0,
    pool=0x81679c0) at subversion/libsvn_subr/config.c:238
#5 0x08054e0f in main (argc=2, argv=0xbfa17874)

There's no "context" in any of these function calls in which to add a
notification callback.

I see two options:

    * Creating a context that should be passed to all these functions.
      This would imply new revisions of them. Seems overkill, but
      perhaps such a context can be usefull elsewhere too.
    * Use a global variable to set a global notification handler, which
      would be used as a fallback when a better one can't be found. Not
      pretty, but this callback would be to show system, modal, warnings
      or important notifications.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Apr 7 21:12:13 2007

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.