[PATCH 4 of 5] chgserver: add umask method
Yuya Nishihara
yuya at tcha.org
Tue Feb 16 09:21:12 EST 2016
On Mon, 15 Feb 2016 14:42:52 +0000, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark at fb.com>
> # Date 1455546497 0
> # Mon Feb 15 14:28:17 2016 +0000
> # Node ID 35ad63ce921c694c506304e36486063c1cc7f9c5
> # Parent d1444fdc143a66f041052701d5de27a3f13881d8
> chgserver: add umask method
>
> Before this patch, the server won't inherit umask from the client, which
> will fail test-inherit-mode.t. This patch provides a way for the client
> to change umask of the server, similar to chdir.
>
> diff --git a/hgext/chgserver.py b/hgext/chgserver.py
> --- a/hgext/chgserver.py
> +++ b/hgext/chgserver.py
> @@ -289,6 +289,14 @@
> _log('chdir to %r\n' % path)
> os.chdir(path)
>
> + def umask(self):
> + """Change umask"""
> + mask = self._readstr()
> + if mask is None:
> + return
> + _log('umask %r\n' % mask)
> + os.umask(int(mask))
Command-server protocol is binary. Can it be a 32bit unsigned integer in
network byteorder?
And I think 'setumask' is better name as this 'umask' command doesn't return
the old value.
More information about the Mercurial-devel
mailing list