mercurial/chgserver.py
changeset 30737 2957409449ac
parent 30727 18eb63ec8475
child 30739 815e1cefd082
--- a/mercurial/chgserver.py	Tue Jan 10 06:58:02 2017 +0800
+++ b/mercurial/chgserver.py	Tue Jan 10 06:58:51 2017 +0800
@@ -231,19 +231,8 @@
                 or self.fout.fileno() != util.stdout.fileno()):
                 return super(chgui, self).system(cmd, environ, cwd, onerr,
                                                  errprefix)
-            # copied from mercurial/util.py:system()
             self.flush()
-            def py2shell(val):
-                if val is None or val is False:
-                    return '0'
-                if val is True:
-                    return '1'
-                return str(val)
-            env = encoding.environ.copy()
-            if environ:
-                env.update((k, py2shell(v)) for k, v in environ.iteritems())
-            env['HG'] = util.hgexecutable()
-            rc = self._csystem(cmd, env, cwd)
+            rc = self._csystem(cmd, util.shellenviron(environ), cwd)
             if rc and onerr:
                 errmsg = '%s %s' % (os.path.basename(cmd.split(None, 1)[0]),
                                     util.explainexit(rc)[0])