You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "Daniel L. Rall" <dl...@finemaltcoding.com> on 2007/05/26 02:10:53 UTC

[bug] Inconsistent path output from 'svn mkdir --parents'

In a complete empty WC (corresponding to an empty repos), try the
following:

$ svn mkdir --parents branches/foo/bar
A         /tmp/wc/branches
A         /tmp/wc/branches/foo
A         branches/foo/bar

Note how the first two paths in the ouput are absolute, while the
final path is relative.

Re: [bug] Inconsistent path output from 'svn mkdir --parents'

Posted by Daniel Rall <dl...@collab.net>.
On Thu, 31 May 2007, Hyrum K. Wright wrote:

> Daniel Rall wrote:
> > On Fri, 25 May 2007, Daniel L. Rall wrote:
> > 
> >> In a complete empty WC (corresponding to an empty repos), try the
> >> following:
> >>
> >> $ svn mkdir --parents branches/foo/bar
> >> A         /tmp/wc/branches
> >> A         /tmp/wc/branches/foo
> >> A         branches/foo/bar
> >>
> >> Note how the first two paths in the ouput are absolute, while the
> >> final path is relative.
> > 
> > I'm guessing that this is because we get the absolute path of the
> > parent directories as we walk towards the leaf directory of our WC or
> > repository.  Has anyone looked at this one yet?
> 
> Dan,
> Your guess is correct.  I've looked at it, just haven't had time to do
> anything about it yet.

Mike fixed this in r25333 by making all the paths absolute when in
--parents mode.

It'd be more consistent with other Subversion behavior (e.g. diff) if
we used relative paths if a relative path was provided, but perhaps
that's not possible in this case?

> Do we have any way of recovering a relative pathname from an
> absolute pathname?

Some path arithmatic with svn_path.h would probably do the trick,
perhaps using svn_path_get_longest_ancestor() or svn_path_split().

Re: [bug] Inconsistent path output from 'svn mkdir --parents'

Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
Daniel Rall wrote:
> On Fri, 25 May 2007, Daniel L. Rall wrote:
> 
>> In a complete empty WC (corresponding to an empty repos), try the
>> following:
>>
>> $ svn mkdir --parents branches/foo/bar
>> A         /tmp/wc/branches
>> A         /tmp/wc/branches/foo
>> A         branches/foo/bar
>>
>> Note how the first two paths in the ouput are absolute, while the
>> final path is relative.
> 
> I'm guessing that this is because we get the absolute path of the
> parent directories as we walk towards the leaf directory of our WC or
> repository.  Has anyone looked at this one yet?

Dan,
Your guess is correct.  I've looked at it, just haven't had time to do
anything about it yet.  Do we have any way of recovering a relative
pathname from an absolute pathname?

-Hyrum


Re: [bug] Inconsistent path output from 'svn mkdir --parents'

Posted by Daniel Rall <dl...@collab.net>.
On Fri, 25 May 2007, Daniel L. Rall wrote:

> In a complete empty WC (corresponding to an empty repos), try the
> following:
> 
> $ svn mkdir --parents branches/foo/bar
> A         /tmp/wc/branches
> A         /tmp/wc/branches/foo
> A         branches/foo/bar
> 
> Note how the first two paths in the ouput are absolute, while the
> final path is relative.

I'm guessing that this is because we get the absolute path of the
parent directories as we walk towards the leaf directory of our WC or
repository.  Has anyone looked at this one yet?