[MERGE] Fix for bug 183831

Geoff Bache geoff.bache at gmail.com
Tue Mar 17 18:51:27 GMT 2009


Hi all,

I've made a small change to osutils.relpath so that it can handle
symbolic links in a better way. The main point is to fix the myriad
problems that can occur when Bazaar is given a repository path
containing symbolic links, see
https://bugs.launchpad.net/bzr/+bug/183831 and the various duplicates.

The fix is available as a branch on launchpad,
https://code.launchpad.net/~geoff.bache/bzr/trunk. I guess that's
sufficient, let me know if not.

I added a new blackbox test, test_add_with_symlink, which is skipped
on platforms that don't have symbolic links. I haven't added any unit
tests because I don't know how meaningful they would be. I ran all the
tests and got 2 failures, which are the same 2 failures I get with the
code unchanged.

It could be advanced that this change might slow things down: after
all it adds complexity to quite a low-level function, and
os.path.samefile will hit the file system whereas the old function was
purely string manipulation. In practice I doubt it will make much
difference as it shouldn't be called too repeatedly, but I'm open to
being told otherwise. Time to run all tests and all benchmarks was not
noticeably different in any case.

Regards,
Geoff Bache



More information about the bazaar mailing list