Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 44629:d37975386798
chgserver: update the umask cache before each run
posix.py uses a global variable to store the umask value resulting in caching of
it when using chg. We need to update it before each command run as the umask can
change between commands.
This fixes test-inherit-mode.t with chg.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Tue, 31 Mar 2020 15:11:33 +0530 |
parents | 9d2b2df2c2ba |
children | 3aed7d262bdf 1bab6b61b62b |
comparison
equal
deleted
inserted
replaced
44628:4dacd0cef146 | 44629:d37975386798 |
---|---|
127 statisexec = platform.statisexec | 127 statisexec = platform.statisexec |
128 statislink = platform.statislink | 128 statislink = platform.statislink |
129 umask = platform.umask | 129 umask = platform.umask |
130 unlink = platform.unlink | 130 unlink = platform.unlink |
131 username = platform.username | 131 username = platform.username |
132 | |
133 | |
134 def setumask(val): | |
135 ''' updates the umask. used by chg server ''' | |
136 if pycompat.iswindows: | |
137 return | |
138 os.umask(val) | |
139 global umask | |
140 platform.umask = umask = val & 0o777 | |
141 | |
132 | 142 |
133 # small compat layer | 143 # small compat layer |
134 compengines = compression.compengines | 144 compengines = compression.compengines |
135 SERVERROLE = compression.SERVERROLE | 145 SERVERROLE = compression.SERVERROLE |
136 CLIENTROLE = compression.CLIENTROLE | 146 CLIENTROLE = compression.CLIENTROLE |