rhg: set group-writable checkisexec file permissions in Python
authorArseniy Alekseyev <aalekseyev@janestreet.com>
Thu, 05 Dec 2024 15:16:43 +0000
changeset 52526 dd052842fc8e
parent 52525 66e34bc44280
child 52527 64a618048ba8
rhg: set group-writable checkisexec file permissions in Python This actually achieves what the parent commit tried to do, but on the Python side. Unfortunately, `mkstemp` doesn't seem to let us specify the initial file permissions so we have to apply umask by hand when chmodding.
mercurial/posix.py
--- a/mercurial/posix.py	Thu Dec 05 13:17:32 2024 +0000
+++ b/mercurial/posix.py	Thu Dec 05 15:16:43 2024 +0000
@@ -300,6 +300,7 @@
             os.close(fh)
             m = os.stat(fn).st_mode
             if m & EXECFLAGS == 0:
+                m = 0o666 & ~umask
                 os.chmod(fn, m & 0o777 | EXECFLAGS)
                 if os.stat(fn).st_mode & EXECFLAGS != 0:
                     if checkisexec is not None: