# HG changeset patch # User Yuya Nishihara # Date 2016-03-20 17:44:15 # Node ID 83127a9fe76ea8b9379d9efa3afefff075b4f920 # Parent cd10171d6c712ace6be834bd94b7dc3694dcedf3 chgserver: drop old hack to recreate ui on HGPLAIN change It's been superseded by config/env hash. A log message is simplified as we no longer need a diff of environment variables. Also, _loadnewui() is changed to require args since it can't copy old --config values without args. diff --git a/hgext/chgserver.py b/hgext/chgserver.py --- a/hgext/chgserver.py +++ b/hgext/chgserver.py @@ -267,10 +267,7 @@ def _newchgui(srcui, csystem): return chgui(srcui) -def _loadnewui(srcui, args=None): - if not args: - args = [] - +def _loadnewui(srcui, args): newui = srcui.__class__() for a in ['fin', 'fout', 'ferr', 'environ']: setattr(newui, a, getattr(srcui, a)) @@ -524,18 +521,9 @@ class chgcmdserver(commandserver.server) newenv = dict(s.split('=', 1) for s in l) except ValueError: raise ValueError('unexpected value in setenv request') - - diffkeys = set(k for k in set(os.environ.keys() + newenv.keys()) - if os.environ.get(k) != newenv.get(k)) - _log('change env: %r\n' % sorted(diffkeys)) - + _log('setenv: %r\n' % sorted(newenv.keys())) os.environ.clear() os.environ.update(newenv) - - if set(['HGPLAIN', 'HGPLAINEXCEPT']) & diffkeys: - # reload config so that ui.plain() takes effect - self.ui, _lui = _loadnewui(self.ui) - _clearenvaliases(commands.table) capabilities = commandserver.server.capabilities.copy()