chgserver: more explicit about sensitive environ variables
authorJun Wu <quark@fb.com>
Wed, 10 May 2017 11:55:22 -0700
changeset 32271 6096d27dc119
parent 32270 218ca8526ec0
child 32272 78496ac30025
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.
mercurial/chgserver.py
--- a/mercurial/chgserver.py	Thu May 11 08:49:33 2017 -0700
+++ b/mercurial/chgserver.py	Wed May 10 11:55:22 2017 -0700
@@ -75,7 +75,8 @@
 # sensitive environment variables affecting confighash
 _envre = re.compile(r'''\A(?:
                     CHGHG
-                    |HG(?:[A-Z].*)?
+                    |HG(?:DEMANDIMPORT|EMITWARNINGS|MODULEPOLICY|PROF|RCPATH)?
+                    |HG(?:ENCODING|PLAIN).*
                     |LANG(?:UAGE)?
                     |LC_.*
                     |LD_.*