# HG changeset patch # User Jun Wu # Date 2017-01-10 23:36:48 # Node ID 378686afca52374822420e0fcd026fb9de502b81 # Parent e38e7ea2198796035bca918137170d11da11b405 chgserver: add the setprocname interface This allows clients to change its process title freely. diff --git a/mercurial/chgserver.py b/mercurial/chgserver.py --- a/mercurial/chgserver.py +++ b/mercurial/chgserver.py @@ -464,6 +464,14 @@ class chgcmdserver(commandserver.server) '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())