[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: Noel Yap <yap_noel_at_yahoo.com>
Date: 2002-10-25 21:03:53 CEST

--- Philip Martin <philip@codematters.co.uk> wrote:
> Noel Yap <yap_noel@yahoo.com> writes:
> > 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.

In the above cases, sorting should still work since
ASCII '/' comes before ASCII 'a'. OTOH, you do bring
up a very good point since my suggestion won't work
when directory names begin with characters whose ASCII
code is less than that of '/' (eg '+').

Simple sorting may still work if paths starting with
'/' were special-cased.

I'm not familiar with the svn_ functions and I'm not
implementing the patch to fix this, anyway, so I'll
stop rambling. Thanks for pointing out holes in my
suggestion.

Noel

__________________________________________________
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
http://webhosting.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Oct 25 21:04:32 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.