[MERGE] Handle a file turning in to a directory in TreeTransform.

John Arbash Meinel john at arbash-meinel.com
Thu Jul 17 16:45:55 BST 2008


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

James Westby wrote:
| Hi all,
|
| When a file turns in to a directory in a TreeTransform and a child
| is added to this new directory stat is called on the child path.
| stat throws "ENOTDIR" as there is a file on disk that is named the
| same as one of the parents of the path it is given. This means
| that the file is not present, and so we should handle ENOTDIR
| in the same way as ENOENT. The attached patch does this.
|
| Thanks,
|
| James
|
|

I would probably change the if/else logic here:
~             if e.errno == errno.ENOENT:
~                 return
+            elif e.errno == errno.ENOTDIR:
+                # If the file is in a directory that was a file in
+                # tree on disk ENOTDIR will be raised. This error tells
+                # us that the file is not present on disk, so we handle
+                # it the same as ENOENT. See bug 248448.

And do:

if e.errno in (errno.ENOENT, errno.ENOTDIR):
~  # Either the target directory doesn't exist, or the parent of the
~  # target is not a directory (but will be one eventually)
~  # Either way, we know it doesn't exist *right now*
~  # See also bug #248448
~  return

BB:tweak

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

iEYEARECAAYFAkh/aTMACgkQJdeBCYSNAAOBfgCgpmpjQTGoVNTcGnqdI86wp5TD
gkUAn1CLDtVY4m8d7mTWS7syR9axs3x/
=eMky
-----END PGP SIGNATURE-----



More information about the bazaar mailing list