Mercurial > hg
changeset 30750:378686afca52
chgserver: add the setprocname interface
This allows clients to change its process title freely.
author | Jun Wu <quark@fb.com> |
---|---|
date | Wed, 11 Jan 2017 07:36:48 +0800 |
parents | e38e7ea21987 |
children | e882c7bb5a0b |
files | mercurial/chgserver.py |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/chgserver.py Tue Jan 10 23:41:58 2017 +0800 +++ b/mercurial/chgserver.py Wed Jan 11 07:36:48 2017 +0800 @@ -464,6 +464,14 @@ 'setenv': setenv, 'setumask': setumask}) + if util.safehasattr(osutil, 'setprocname'): + def setprocname(self): + """Change process title""" + name = self._readstr() + _log('setprocname: %r\n' % name) + osutil.setprocname(name) + capabilities['setprocname'] = setprocname + def _tempaddress(address): return '%s.%d.tmp' % (address, os.getpid())