[merge] BzrDir controls file modes, not LockableFiles

Martin Pool mbp at canonical.com
Tue May 13 01:58:46 BST 2008


LockableFiles has varied and somewhat messy responsibilities; one of
them is to know about the default file and directory permissions for
things created underneath it.  These can be applied either implicitly when
doing file operations on .control_files, or explicitly passed to the
transport.

I'd like to move that to a better place and it seems to me that BzrDir
would be a reasonable place: we should generally have the same
permissions on everything inside .bzr.

This patch doesn't (unless I've made a mistake) require BzrDir to have
any concept of permissions or to assume that it does any file-level
access.  If the BzrDir and its components don't do any transport
operations, this will not introduce them.

This patch is from a stack of LockableFiles-related changes so while it
should apply cleanly to trunk it does not convert all callers.

There is one open issue: at the moment LockableFiles has this:

    # If set to False (by a plugin, etc) BzrBranch will not set the
    # mode on created files or directories
    _set_file_mode = True
    _set_dir_mode = True

I haven't duplicated this functionality, and I'm not sure it is still
needed.  Does anyone actually use such a plugin?  If we want the option
for users to turn off mode setting or force a particular mode maybe that
would be better controlled by a config setting?

-- 
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20080512-filemodes.diff
Type: text/x-diff
Size: 21175 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080513/1974356e/attachment-0001.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080513/1974356e/attachment-0001.pgp 


More information about the bazaar mailing list