# HG changeset patch # User Matt Mackall # Date 1167444270 21600 # Node ID 5e3936eabe5df26f3d9fab26e3647220367beb7a # Parent cd650cd61b06b437464855f6e6499a6696700637 pull umask-checking up diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -851,6 +851,8 @@ if os.name == 'nt': else: nulldev = '/dev/null' + _umask = os.umask(0) + os.umask(_umask) def rcfiles(path): rcs = [os.path.join(path, 'hgrc')] @@ -892,9 +894,7 @@ else: 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)