chgserver: drop old hack to recreate ui on HGPLAIN change
authorYuya Nishihara <yuya@tcha.org>
Sun, 20 Mar 2016 10:44:15 -0700
changeset 28602 83127a9fe76e
parent 28601 cd10171d6c71
child 28603 f467073cd798
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.
hgext/chgserver.py
--- a/hgext/chgserver.py	Sat Mar 19 16:37:47 2016 -0700
+++ b/hgext/chgserver.py	Sun Mar 20 10:44:15 2016 -0700
@@ -267,10 +267,7 @@
 
     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 @@
             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()