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

Re: svn_client_ls - how can I tell file from dir

From: Garrett Rooney <rooneg_at_electricjellyfish.net>
Date: 2004-03-25 02:47:31 CET

On Mar 24, 2004, at 8:30 PM, Ben Reser wrote:

> On Wed, Mar 24, 2004 at 08:14:58PM -0500, Garrett Rooney wrote:
>> No, you have to use libsvn_ra to test if the target is a file or
>> directory, you can't derive the info from svn_client_ls. See the
>> check_path function in the svn_ra_plugin_t data structure.
>
> No? What I gave works with the one exception that I mentioned. Which
> is if a directory contains a single file of the same name as the
> directory then you cannot infer the node type of the target of
> svn_client_ls.

Yeah, but "works with one exception" == "doesn't work" for all intents
and purposes ;-)

> The ra lib option works. But it is very ugly. In his particular case
> he might as well reimplement svn_client_ls practically if he did that.

True.

> I suppose we should deprecate svn_client_ls and replace it with a
> function that returns relative paths to the target. I.E. if you ask
> for
> foo and foo is a file you'd get a key named foo. If you ask for foo
> and
> foo is a directory containing a file named foo you'd get foo/foo.
>
> Apps that wanted just the basename could use svn_path_basename.
>
> ISTR that there were other things we wanted to fix in svn_client_ls.
> Maybe we want to make it take more than one target? I also recall
> someone complaining that the name was too "unix" for the API. So when
> we fix these we could rename it to svn_client_dir or svn_client_list or
> whatever else we desired.

If anyone is going to implement a replacement I'd say hold out for more
requirements first, I'd hate to waste the decent names (svn_client_list
would be my pick, for what it's worth) and then find we missed
something ;-)

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Mar 25 02:47:50 2004

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.