On Mon, 01 Oct 2007, Joe Swatosh wrote:
> Hi Day,
>
> On 10/1/07, Daniel Rall <dlr@collab.net> wrote:
> > Why is 'nil' a valid value for the depth parameter? Is it
> > automatically converted to svn_depth_empty (0) somewhere? I noticed
> > that client.status() (and many other Ruby client APIs) use it as a
> > default value.
> >
>
> I think what you are looking for is svn_swig_rb_to_depth.
Thanks Joe! From
subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c:
svn_depth_t
svn_swig_rb_to_depth(VALUE value)
{
if (NIL_P(value)) {
return svn_depth_infinity;
} else if (value == Qtrue) {
return SVN_DEPTH_FROM_RECURSE(TRUE);
} else if (value == Qfalse) {
return SVN_DEPTH_FROM_RECURSE(FALSE);
} else if (RTEST(rb_obj_is_kind_of(value, rb_cString)) ||
RTEST(rb_obj_is_kind_of(value, rb_cSymbol))) {
value = rb_funcall(value, id_to_s, 0);
return svn_depth_from_word(StringValueCStr(value));
} else if (RTEST(rb_obj_is_kind_of(value, rb_cInteger))) {
return NUM2INT(value);
} else {
rb_raise(rb_eArgError,
"'%s' must be DEPTH_STRING (e.g. \"infinity\" or :infinity) "
"or Svn::Core::DEPTH_*",
r2c_inspect(value));
}
}
This seems to fall victim to issue #2951, [sparse-directories] Fix
non-recursive mode of compat APIs to use depth empty instead of files.
Also, it defaults some APIs (e.g. client.proplist) to
svn_depth_infinity, when I'd more intuitively expect them to use depth
empty (as per their behavior from the command-line client).
- application/pgp-signature attachment: stored
Received on Mon Oct 1 20:52:11 2007