You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Garrett Rooney <ro...@electricjellyfish.net> on 2006/08/22 14:22:21 UTC

Re: svn commit: r21177 - in branches/incomplete-directories/subversion: include libsvn_client svn

On 8/22/06, kfogel@tigris.org <kf...@tigris.org> wrote:

> +/* Return string representation of DEPTH */
> +static const char *
> +depth_str(svn_depth_t depth)
> +{
> +  switch (depth)
> +    {
> +    case svn_depth_unknown:
> +      return "unknown";
> +    case svn_depth_zero:
> +      return "zero";
> +    case svn_depth_one:
> +      return "one";
> +    case svn_depth_infinity:
> +      return "infinity";
> +    default:
> +      /* Remember that svn_depth_exclude should never happen here. */
> +      return "INVALID";
> +    }
> +}

It seems like this function should be used in the following printfs,
instead of hardcoding the names in two places.

> +      switch (info->depth)
> +        {
> +        case svn_depth_unknown:
> +          /* Unknown depth is the norm for remote directories anyway
> +             (although infinity would be equally appropriate).  Let's
> +             not bother to print it. */
> +          break;
> +
> +        case svn_depth_zero:
> +          SVN_ERR(svn_cmdline_printf(pool, _("Depth: zero\n")));
> +          break;
> +
> +        case svn_depth_one:
> +          SVN_ERR(svn_cmdline_printf(pool, _("Depth: one\n")));
> +          break;
> +
> +        case svn_depth_infinity:
> +          /* Infinity is the default depth for working copy
> +             directories.  Let's not print it, it's not special enough
> +             to be worth mentioning.  */
> +          break;
> +
> +        default:
> +          /* Remember that svn_depth_exclude should never happen here. */
> +          SVN_ERR(svn_cmdline_printf(pool, _("Depth: INVALID\n")));
> +        }
> +
>        if (info->copyfrom_url)
>          SVN_ERR(svn_cmdline_printf(pool, _("Copied From URL: %s\n"),
>                                     info->copyfrom_url));
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: svn-help@subversion.tigris.org
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: r21177 - in branches/incomplete-directories/subversion: include libsvn_client svn

Posted by Karl Fogel <kf...@google.com>.
"Garrett Rooney" <ro...@electricjellyfish.net> writes:
> On 8/22/06, kfogel@tigris.org <kf...@tigris.org> wrote:
>
>> +/* Return string representation of DEPTH */
>> +static const char *
>> +depth_str(svn_depth_t depth)
>> +{
>> +  switch (depth)
>> +    {
>> +    case svn_depth_unknown:
>> +      return "unknown";
>> +    case svn_depth_zero:
>> +      return "zero";
>> +    case svn_depth_one:
>> +      return "one";
>> +    case svn_depth_infinity:
>> +      return "infinity";
>> +    default:
>> +      /* Remember that svn_depth_exclude should never happen here. */
>> +      return "INVALID";
>> +    }
>> +}
>
> It seems like this function should be used in the following printfs,
> instead of hardcoding the names in two places.

I'd like to, yes, but localization gets a bit trickier then...

-K

>> +      switch (info->depth)
>> +        {
>> +        case svn_depth_unknown:
>> +          /* Unknown depth is the norm for remote directories anyway
>> +             (although infinity would be equally appropriate).  Let's
>> +             not bother to print it. */
>> +          break;
>> +
>> +        case svn_depth_zero:
>> +          SVN_ERR(svn_cmdline_printf(pool, _("Depth: zero\n")));
>> +          break;
>> +
>> +        case svn_depth_one:
>> +          SVN_ERR(svn_cmdline_printf(pool, _("Depth: one\n")));
>> +          break;
>> +
>> +        case svn_depth_infinity:
>> +          /* Infinity is the default depth for working copy
>> +             directories.  Let's not print it, it's not special enough
>> +             to be worth mentioning.  */
>> +          break;
>> +
>> +        default:
>> +          /* Remember that svn_depth_exclude should never happen here. */
>> +          SVN_ERR(svn_cmdline_printf(pool, _("Depth: INVALID\n")));
>> +        }
>> +
>>        if (info->copyfrom_url)
>>          SVN_ERR(svn_cmdline_printf(pool, _("Copied From URL: %s\n"),
>>                                     info->copyfrom_url));

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org