Strange bzr handling of parent location from bzr branch when $HOME uses a symbolic link.

John Arbash Meinel john at arbash-meinel.com
Thu Dec 17 14:23:18 GMT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

David Ingamells wrote:
> John Arbash Meinel wrote:
> 
>> David Ingamells wrote:
>> > Changing /etc/passwd to give the user's home as /volumes1/home/<user>
>> > and repeating the above commands (after a logout and login and of
> course
>> > removing the defective branch created above) solves the problem.
> 
>> My guess is that the issue is that sometimes the branch under question
>> is accessed as "/home/user/foo" and other times as
>> "/volumes1/home/user/foo". And the parent pointer is being given as a
>> relative path.
>> So if we opened the branch as "/home/user/foo" and find the parent
>> location is "../../../data/id/repos" then when it is accessed as
>> "/volumes1/home/user/foo" the relative path breaks.
> 
> Your guess is correct as the behaviour depends on how the path to the
> branch is given.
> 
>> Feel free to submit a bug on this. I think the basic fixes are:
> 
> https://bugs.launchpad.net/bzr/+bug/497654
> 
>> 1) When computing a relative path, if it goes through '/' just use an
> absolute path.
> 
> I'd say the fix is: don't store relative paths in the config file.
> Always use the URL - which has to be done anyway if the parent was
> accessed by e.g. bzr+ssh .
> 
> 

Except if you have a repository shared over both bzr+ssh and http:// and
direct local access (file://) relative paths "work" for all 3. For example:

/srv/bzr/feature1
/srv/bzr/trunk

If the parent was encoded as "file:///srv/bzr/feature1" then if I
accessed it from another machine as: "bzr+ssh://host/srv/bzr/feature1"
it would look at my *local* machine for trunk. Similarly using
"../trunk" allows "http://host/bzr/foo" to find "http://host/bzr/trunk".

Obviously there are times where relative paths fail, and an absolute one
wouldn't. But it is *usually* the other way around.

And note, that using a relative path as we do above *would* work over
bzr+ssh, since both paths should be available, but probably not over http.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksqPtYACgkQJdeBCYSNAAPcsQCgz9KxFoH6+44G3oqdBv1IMBUM
dA0AoLkQvcLQm8JvN2cCz5QcG7dA9xqS
=Gmhd
-----END PGP SIGNATURE-----



More information about the bazaar mailing list