From patchwork Wed May 10 18:56:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: chgserver: more explicit about sensitive environ variables From: Jun Wu X-Patchwork-Id: 20562 Message-Id: To: Date: Wed, 10 May 2017 11:56:39 -0700 # HG changeset patch # User Jun Wu # Date 1494442522 25200 # Wed May 10 11:55:22 2017 -0700 # Node ID f275d21ea713de70a8cae521d3afc1fbe497de25 # Parent 1ada3d18e7fbc9069910f2c036992d2f2b28e058 # Available At https://bitbucket.org/quark-zju/hg-draft # hg pull https://bitbucket.org/quark-zju/hg-draft -r f275d21ea713 chgserver: more explicit about sensitive environ variables Environment variables like HGUSER, HGEDITOR, HGEDITFROM should not trigger a new chgserver. This patch uses a whitelist for environ variables starting with "HG" to reduce the number of servers. I have went through `grep -o "[\"']HG[A-Z_0-9]*['\"]" -hR . | sort -u` so the list should be up-to-date. diff --git a/mercurial/chgserver.py b/mercurial/chgserver.py --- a/mercurial/chgserver.py +++ b/mercurial/chgserver.py @@ -76,5 +76,6 @@ def _hashlist(items): _envre = re.compile(r'''\A(?: CHGHG - |HG(?:[A-Z].*)? + |HG(?:DEMANDIMPORT|EMITWARNINGS|MODULEPOLICY|PROF|RCPATH)? + |HG(?:ENCODING|PLAIN).* |LANG(?:UAGE)? |LC_.*