chgserver: add the setprocname interface
This allows clients to change its process title freely.
--- 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())