You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Philip Martin <ph...@codematters.co.uk> on 2002/08/06 23:51:50 UTC
paths, locks and canonicalisation
Hello
Further path canonicalisation questions arise while messing around
with the new locking code.
Within libsvn_wc
1. Is "." a canonical path?
2. Is "A" a canonical path?
3. Should svn_path_is_child(".", "A") return NULL indicating not a
child?
--
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: paths, locks and canonicalisation
Posted by Philip Martin <ph...@codematters.co.uk>.
Branko Äibej <br...@xbc.nu> writes:
> >3. Should svn_path_is_child(".", "A") return NULL indicating not a
> > child?
> >
> That's a tough question. I'd say that any relative path is a child of
> the current dir, so svn_path_is_child should just return the second
> path in this case.
That's the answer I wanted, and what I'm doing locally :-)
--
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: paths, locks and canonicalisation
Posted by Marcus Comstedt <ma...@mc.pp.se>.
=?UTF-8?B?QnJhbmtvIMSMaWJlag==?= <br...@xbc.nu> writes:
> Yes, except that statting "." works, but statting "" fails,
> IIRC. Consistency is nice, but only to a point. :-)
That's OS dependent. On AmigaOS, statting "" would work and statting
"." would fail. The path needs to be "decanonicalized" before
statting it.
// Marcus
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: paths, locks and canonicalisation
Posted by Branko Čibej <br...@xbc.nu>.
Marcus Comstedt wrote:
>=?UTF-8?B?QnJhbmtvIMSMaWJlag==?= <br...@xbc.nu> writes:
>
>
>
>>Yes, and yes. See the examples in the docstring for svn_path_split, in
>>svn_path.h. svn_path_split should do something smart with ".". Also,
>>maybe "./foo" should be canonicalized to "foo", and "" to "."?
>>
>>
>
>This sounds backwards. If "./foo" is canonicalized to "foo", then
>surely "." should be canonicalized to "", not the other way around?
>
Yes, except that statting "." works, but statting "" fails, IIRC.
Consistency is nice, but only to a point. :-)
--
Brane Čibej <br...@xbc.nu> http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
RE: paths, locks and canonicalisation
Posted by Sander Striker <st...@apache.org>.
> From: Marcus Comstedt [mailto:marcus@mc.pp.se]
> Sent: 08 August 2002 19:55
> =?UTF-8?B?QnJhbmtvIMSMaWJlag==?= <br...@xbc.nu> writes:
>
> > Yes, and yes. See the examples in the docstring for svn_path_split, in
> > svn_path.h. svn_path_split should do something smart with ".". Also,
> > maybe "./foo" should be canonicalized to "foo", and "" to "."?
>
> This sounds backwards. If "./foo" is canonicalized to "foo", then
> surely "." should be canonicalized to "", not the other way around?
apr_filepath_merge does exactly what you describe.
Sander
PS. I've not forgotten about that issue :)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: paths, locks and canonicalisation
Posted by Marcus Comstedt <ma...@mc.pp.se>.
=?UTF-8?B?QnJhbmtvIMSMaWJlag==?= <br...@xbc.nu> writes:
> Yes, and yes. See the examples in the docstring for svn_path_split, in
> svn_path.h. svn_path_split should do something smart with ".". Also,
> maybe "./foo" should be canonicalized to "foo", and "" to "."?
This sounds backwards. If "./foo" is canonicalized to "foo", then
surely "." should be canonicalized to "", not the other way around?
// Marcus
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: paths, locks and canonicalisation
Posted by br...@xbc.nu.
Quoting solo turn <so...@yahoo.com>:
> --- Branko �ibej <br...@xbc.nu> wrote:
> > Philip Martin wrote:
> > >1. Is "." a canonical path?
> > >2. Is "A" a canonical path?
> > Yes, and yes. See the examples in the docstring for svn_path_split,
> > in
> > svn_path.h. svn_path_split should do something smart with ".".
> > Also,
> > maybe "./foo" should be canonicalized to "foo", and "" to "."?
>
> hmmm ... when executing commands, it makes some differences if you
> write foocmd, or ./foocmd, maybe the ./foo version should be the
> canonical on?
This is not about executing commands, it's about relative paths in the working copy.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: paths, locks and canonicalisation
Posted by solo turn <so...@yahoo.com>.
--- Branko Čibej <br...@xbc.nu> wrote:
> Philip Martin wrote:
> >1. Is "." a canonical path?
> >2. Is "A" a canonical path?
> Yes, and yes. See the examples in the docstring for svn_path_split,
> in
> svn_path.h. svn_path_split should do something smart with ".".
> Also,
> maybe "./foo" should be canonicalized to "foo", and "" to "."?
hmmm ... when executing commands, it makes some differences if you
write foocmd, or ./foocmd, maybe the ./foo version should be the
canonical on?
ford
__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: paths, locks and canonicalisation
Posted by Branko Čibej <br...@xbc.nu>.
Philip Martin wrote:
>Hello
>
>Further path canonicalisation questions arise while messing around
>with the new locking code.
>
>Within libsvn_wc
>
>1. Is "." a canonical path?
>2. Is "A" a canonical path?
>
Yes, and yes. See the examples in the docstring for svn_path_split, in
svn_path.h. svn_path_split should do something smart with ".". Also,
maybe "./foo" should be canonicalized to "foo", and "" to "."?
>3. Should svn_path_is_child(".", "A") return NULL indicating not a
> child?
>
That's a tough question. I'd say that any relative path is a child of
the current dir, so svn_path_is_child should just return the second path
in this case.
I'm not sure we're consistent about "." and "./" prefixes, WRT
canonicalization, splitting and joining, but this is a perfect
opporunity to define a policy. :-)
--
Brane Čibej <br...@xbc.nu> http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org