[RFC] per-branch umask

Matthieu Moy Matthieu.Moy at imag.fr
Tue Dec 13 20:08:56 GMT 2005


John Arbash Meinel <john at arbash-meinel.com> writes:

> I suppose inside the transport.put function we could do:
> 	f = open(fn, 'wb')
> 	dir_mode = stat.S_IMODE(os.stat(os.path.dirname(fn)).st_mode)
> 	os.fchmod(f.fileno(), dir_mode & 0666)

Hmm, the problem is that as I understand, "put" doesn't make any
difference between adding a new file and changing an old one, so you
have to do the stat+chmod every time. That's probably completely
acceptable for a local access, but means a lot of round-trips for
remote accesses.

One possible optimization would be to factor out the "stat" part when
creating several files in the same directory.

Perhaps a solution would be to use the permissions of .bzr/ itself as
umask. Only one "stat" would be needed, and a single "umask" can be
set when available.

Doing a "chmod -R /path/to/branch" is quite natural to change the
permissions on an archive, so it would be nice if bzr could just keep
the permissions of the complete branch (the .bzr part) consistant.

-- 
Matthieu




More information about the bazaar mailing list