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

Re: Minor annoyance in svn add

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-10-25 20:36:49 CEST

Noel Yap <yap_noel@yahoo.com> writes:

> --- Philip Martin <philip@codematters.co.uk> wrote:
> > Rafael Garcia-Suarez
> > <raphel.garcia-suarez@hexaflux.com> writes:
> >
> > > What do you mean, "number of components" ?
> > ./././///./foo is still longer that foo/bar.
> >
> > Use svn_path_decompose and don't count
> > SVN_EMPTY_PATH components.
>
> Whenever I've needed to do this in the past, I used
> sort to "alphabetize" the list. I think it should
> work since "foo" comes before "foo/bar" in such a
> sort. Assuming svn_path_decompose gets rid of "./"
> and "//", using it before sorting should do what's
> needed.

It's not a simple problem however you do it. Consider

$ cd /xxx/xxx
$ mkdir aaa
$ mkdir aaa/aaa
$ svn add aaa/aaa /xxx/xxx/aaa

where we need /xxx/xxx/aaa before aaa/aaa, versus

$ cd /aaa
$ mkdir xxx
$ mkdir xxx/xxx
$ svn add /aaa/xxx/xxx xxx

where we need xxx before /aaa/xxx/xxx

I think the general solution is to call svn_path_get_absolute and then
sort using svn_path_is_child. A bit like svn_path_condense_targets.

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Oct 25 20:37:30 2002

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.