pull umask-checking up
authorMatt Mackall <mpm@selenic.com>
Fri, 29 Dec 2006 20:04:30 -0600
changeset 3995 a4e79f86d304
parent 3994 1cc60eebc71f
child 3996 c190df14338c
pull umask-checking up
mercurial/util.py
--- a/mercurial/util.py	Fri Dec 29 20:04:30 2006 -0600
+++ b/mercurial/util.py	Fri Dec 29 20:04:30 2006 -0600
@@ -811,6 +811,8 @@
 
 else:
     nulldev = '/dev/null'
+    _umask = os.umask(0)
+    os.umask(_umask)
 
     def rcfiles(path):
         rcs = [os.path.join(path, 'hgrc')]
@@ -852,9 +854,7 @@
         if mode:
             # Turn on +x for every +r bit when making a file executable
             # and obey umask.
-            umask = os.umask(0)
-            os.umask(umask)
-            os.chmod(f, s | (s & 0444) >> 2 & ~umask)
+            os.chmod(f, s | (s & 0444) >> 2 & ~_umask)
         else:
             os.chmod(f, s & 0666)