[MERGE] mv accepts paths containing symlinks #66964

Aaron Bentley aaron.bentley at utoronto.ca
Wed Oct 25 17:52:46 BST 2006


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

John Arbash Meinel wrote:
>>>>v- This should probably be:
>>>>
>>>>dirname, basename = os.path.split(path)
>>>>osutils.pathjoin(osutils.realpath(dirname), basename)
>>
>>I assume we shouldn't be using os.path.split, because osutils has custom
>>versions of basename and dirname.  I don't want to use
>>osutils.splitpath, because then I have to synthesize the dirname from
>>the result.  But since we don't have an equivalent of os.path.split, I
>>used osutils.dirname and osutils.basename.
> 
> 
> Well, I can give you the specifics and tell you that os.path.split is
> fine to use, but I understand your hesitancy.

Okay, I've used os.path.split.  But I suspect the previous inefficiency
was vanishingly small.

> I'm not 100% positive that 'realpath' always does the right thing under
> Mac

Actually, I've determined that is does the wrong thing on all platforms
under Python 2.4.1 and previous.

> If you want to add 'split()' to osutils, you are welcome to do so.

I think that would be too confusing, since we've already got pathsplit.

> ^- I understand. I do think it should be an osutils function, but you
> can name it what you like. (follow_early_symlinks_path() :)

I've called it real_parent.

I've also added the symlink guards, and fixed that "== None".

What do you think?

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFFP5Ze0F+nu1YWqI0RArJkAJ9qLGB6Itdb+bSglHlqurH6C7aQpgCghU7Z
NhZlUE0MwTBlp1xx6z/M6t8=
=6DCc
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: real_parent.patch
Type: text/x-patch
Size: 5646 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20061025/2e4ff131/attachment.bin 


More information about the bazaar mailing list