Comment 8 for bug 190725

Revision history for this message
John A Meinel (jameinel) wrote : Re: Bzr can't init branch on ntfs-3g filesystem

So... I'm a bit curious if you couldn't mount with the right options and current umask so that the chmod isn't necessary, or is, at least, a no-op.
That would mean that the file mask should be exactly the directory mask, only without the executable bit (0777, 0666, umask 0000 for example, or 0775 0664 and a umask of 0002).

I certainly see this code in "local.py":
st = os.fstat(fd)
if mode is not None and mode != S_IMODE(st.st_mode):
    # Because of umask, we may still need to chmod the file.
    # But in the general case, we won't have to
    os.chmod(abspath, mode)

Alternatively, bzrdir._dir_mode and _file_mode set the modes that we want to achieve, and they can be set to "None" to indicate we don't want to do any chmodding. At the moment, this is triggered when "transport.stat('directory')" raises TransportNotPossible.

So this simple plugin could do the trick:

from bzrlib import transport, errors
from bzrlib.transport import local

class AltLocal(local.LocalTransport):

  def stat(self, relpath):
    raise errors.TransportNotPossible()

transport.register_transport('file:///', AltLocal)

Put the above code into a file like ~/.bazaar/plugins/no_local_stat.py

And see if ntfs-3g starts working for you. There are certainly other things you could do, like test "self.base" for being inside the mount point, etc.