[BUG] transport.local: when local path given in url form

Alexander Belchenko bialix at ukr.net
Mon Jan 9 21:33:51 GMT 2006


John Arbash Meinel пишет:
> Alexander Belchenko wrote:
> 
>>When I run push command with local path that given in url form with
>>'file://' prefix I got error:
>>
>>E:\work\Python\bzr\bzr.dev>python bzr push file://d:/push/bzr.dev
>>bzr: ERROR: Path u'E:/work/Python/bzr/bzr.dev/file:/d:/push/bzr.dev' is
>>not a child of path u'd:/push'
>>
>>I think it's because LocalTransport.relpath() method does not handle
>>this case (when path specified with 'file://' prefix).
> 
> Yeah, I think LocalTransport is supposed to strip off the file:// stuff.
> 
> I'm not really sure what a correct windows file:// url looks like. I
> know on linux you end up with triple slashes "file:///usr/local/foo".
> I assume that you can go to your browser and type:
> 
> file://d:/push/bzr.dev
> 
> If that works (and isn't modified), then it is probably the correct syntax.

I'm test it with Firefox. Url was modified to triple slashes form:

file:///E:/work/Python/bzr/bzr.dev

So, I guess in constructor and .relpath method should be done strip off 
of "file:///". Trivial patch attached. There is no test because I don't 
think that simple stripping is correct -- see below.

But in this case on Linux will be lost first slash for absolute path 
("file:///usr/local/foo" should be "/usr/local/foo" but when strip off 3 
slashes it will be "usr/local/foo").

Another case is may be user mistype and enter 2 slashes instead of 3. 
What to do in this situation?

--
Alexander
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: local.diff
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20060109/9017ebda/attachment.diff 


More information about the bazaar mailing list