comparison mercurial/util.py @ 3995:a4e79f86d304

pull umask-checking up
author Matt Mackall <mpm@selenic.com>
date Fri, 29 Dec 2006 20:04:30 -0600
parents 1cc60eebc71f
children c190df14338c
comparison
equal deleted inserted replaced
3994:1cc60eebc71f 3995:a4e79f86d304
809 except ImportError: 809 except ImportError:
810 pass 810 pass
811 811
812 else: 812 else:
813 nulldev = '/dev/null' 813 nulldev = '/dev/null'
814 _umask = os.umask(0)
815 os.umask(_umask)
814 816
815 def rcfiles(path): 817 def rcfiles(path):
816 rcs = [os.path.join(path, 'hgrc')] 818 rcs = [os.path.join(path, 'hgrc')]
817 rcdir = os.path.join(path, 'hgrc.d') 819 rcdir = os.path.join(path, 'hgrc.d')
818 try: 820 try:
850 if (s & 0100 != 0) == mode: 852 if (s & 0100 != 0) == mode:
851 return 853 return
852 if mode: 854 if mode:
853 # Turn on +x for every +r bit when making a file executable 855 # Turn on +x for every +r bit when making a file executable
854 # and obey umask. 856 # and obey umask.
855 umask = os.umask(0) 857 os.chmod(f, s | (s & 0444) >> 2 & ~_umask)
856 os.umask(umask)
857 os.chmod(f, s | (s & 0444) >> 2 & ~umask)
858 else: 858 else:
859 os.chmod(f, s & 0666) 859 os.chmod(f, s & 0666)
860 860
861 def set_binary(fd): 861 def set_binary(fd):
862 pass 862 pass