Mercurial > public > mercurial-scm > hg
comparison mercurial/chgserver.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 | bdc8a5944d44 |
children | 8e8fd938ca07 |
comparison
equal
deleted
inserted
replaced
44628:4dacd0cef146 | 44629:d37975386798 |
---|---|
526 self._setumask(data) | 526 self._setumask(data) |
527 | 527 |
528 def _setumask(self, data): | 528 def _setumask(self, data): |
529 mask = struct.unpack(b'>I', data)[0] | 529 mask = struct.unpack(b'>I', data)[0] |
530 self.ui.log(b'chgserver', b'setumask %r\n', mask) | 530 self.ui.log(b'chgserver', b'setumask %r\n', mask) |
531 os.umask(mask) | 531 util.setumask(mask) |
532 | 532 |
533 def runcommand(self): | 533 def runcommand(self): |
534 # pager may be attached within the runcommand session, which should | 534 # pager may be attached within the runcommand session, which should |
535 # be detached at the end of the session. otherwise the pager wouldn't | 535 # be detached at the end of the session. otherwise the pager wouldn't |
536 # receive EOF. | 536 # receive EOF. |