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

Re: svn commit: rev 7556 - in trunk/subversion: include libsvn_subr tests/libsvn_subr

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2003-10-29 23:37:17 CET

brane@tigris.org wrote:
> Author: brane
> Date: Tue Oct 28 20:49:00 2003
> New Revision: 7556
...
> Log:
> Add svn_config functions for parsing boolean option values.
> Tweak svn_config_get_server_setting_int.

> Modified: trunk/subversion/include/svn_config.h
> ==============================================================================
> --- trunk/subversion/include/svn_config.h (original)
> +++ trunk/subversion/include/svn_config.h Tue Oct 28 20:49:00 2003
> @@ -91,6 +91,9 @@
...
>
> +#define SVN_CONFIG_TRUE "true"
> +#define SVN_CONFIG_FALSE "false"
> +

So those are the canonical values. Are the other pairs (yes/no, on/off) recognised for backwards compatibility, or because it seems more friendly to recognise a variety of synonyms? I am hoping the former, because giving users lots of equivalent possibilities often leads in the end to more confusion rather than less. For example:

  sysadmin: Does your config file look like this?
  user: No. Where yours says "authentication=no", mine says "authentication=false". Is no authentication the same as false authentication?
  sysadmin: Yes, they mean the same. Now, how about the rest of the file?
  user: ...

I'm not going to push my argument further; I just want to gently discourage unnecessary flexibility.

> @@ -157,6 +160,24 @@
> void svn_config_set (svn_config_t *cfg,
> const char *section, const char *option,
> const char *value);
> +
> +/** Like @t svn_config_get, but for boolean values.
> + *
> + * Parses the option as a boolean value. The recoginzed representations
> + * are 'true'/'false', 'yes'/'no', 'on'/'off'; case does not matter.
> + * Returns an error ### if the option doesn't contain a known string.

 * Returns SVN_ERR_RA_DAV_INVALID_CONFIG_VALUE if the option doesn't contain a known string.

> + */
> +svn_error_t *svn_config_get_bool (svn_config_t *cfg, svn_boolean_t *valuep,
> + const char *section, const char *option,
> + svn_boolean_t default_value);

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Oct 29 23:36:42 2003

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.