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

Re: mingw32 test failure: svn_dirent_is_canonical

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Sat, 24 Oct 2009 19:45:32 +0200 (Jerusalem Standard Time)

Martin Hauner wrote on Sat, 24 Oct 2009 at 18:55 +0200:
> On 24.10.09 14:07, Daniel Shahaf wrote:
> > Martin Hauner wrote on Sat, 24 Oct 2009 at 11:57 +0200:
> > > Hi I'm trying to make subversion run on mingw32.
> > >
> > > Running any python test fails because of a drive letter case mismatch. I
> > > found
> >
> > I'd be interested to know what mingw does differently that breaks
> > our expectations (causing this assertion).
>
> I did some investigation where the lower case path comes from and it turns out
> it has nothing to do with mingw:
>
> $ python
> ActivePython 2.5.1.1 (ActiveState Software Inc.) based on
> Python 2.5.1 (r251:54863, May 1 2007, 17:47:05) [MSC v.1310 32 bit (Intel)]
> on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import os
> >>> os.path.abspath(".")
> 'c:\\Development\\mingw\\svn-trunk'
> >>>
>

This explains why the lowercase 'c' appears (because svntest/main.py does
the equivalent of "file://`pwd`" to construct the URL for the 'import'
command). But why is the assertion unique to your environment? Are you
the only windows builder using ActivePython?

/me investigates...

I think the assertion is caused not by the lowercase drive letter, but by
the colon following it being URI-encoded. In other words,

    svn info file:///c:/foo # works
    svn info file:///c%3A/foo # asserts

Can you confirm this?

> > > In svn_ra_local__split_URL there is Windows specific code that
> > > excepts lower case drive letters. This doesn't fit with
> > > svn_dirent_is_canonical not excepting lower case rive letters.
> > >
> > > A fix would be to canonicalized the file:///c%3A url. Where would
> > > I add it? Directly in svn_ra_local__split_URL or some levels up?
> >
> > I think you'll find the URL is already canonical (since as early as
> > parsing argv), but URL canonicalization doesn't force the drive letter
> > to uppercase. In other words, svn_ra_local__split_URL() got a canonical
> > URL but passed down a non-canonical dirent (local path).
> >
> > So, IMO, change svn_ra_local__split_URL() to canonicalize (or assert
> > canonicity of) the dirent it creates before passing it down.
>
> Thanks for explanation, I'll try it the way you suggest. :)

Okay :)

(and this should be fixed independently of the %3A issue above... we
shouldn't be passing non-canonical paths to libsvn_repos, period.)

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2411071
Received on 2009-10-24 19:45:45 CEST

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.