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

Re: [PATCH] Refactor code for --auto-props and --no-auto-props mutual exclusion

From: Karl Fogel <kfogel_at_red-bean.com>
Date: 2007-08-14 00:23:03 CEST

Kamesh Jayachandran <kamesh@collab.net> writes:
>> /* Update auto-props-enable option, and populate the MIME types
>> map,
>> - for add/import commands */
>> + for add/import commands. Also check for mutually exclusive options
>> + --auto-props and --no-auto-props */
>> if (subcommand->cmd_func == svn_cl__add
>> || subcommand->cmd_func == svn_cl__import)
>> {
>> + if (opt_state.autoprops && opt_state.no_autoprops)
>> + {
>> + err = svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
>> + _("--auto-props and --no-auto-props are "
>> + "mutually exclusive"));
>> + return svn_cmdline_handle_exit_error(err, pool, "svn: ");
>> + }
>> +
>>
> This code may not compile in older version of C compilers(code before
> declaration.)

I don't see any instance of code-before-decl here ('err' is already
declared), but do watch out for tabs -- those should be spaces
instead, so the indentation will come out right.

Also, why make it conditional on svn_cl__add or svn_cl__import? I
would think autoprops and no_autoprops would be mutually exclusive in
any conceivable universe :-). If so, it makes sense to check for the
exclusivity outside any other conditional, since the check is cheap.

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Aug 14 00:20:56 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.