[PATCH] chg: ignore HG_* in confighash

Jun Wu quark at fb.com
Tue Dec 13 21:21:31 EST 2016


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1481681879 0
#      Wed Dec 14 02:17:59 2016 +0000
# Node ID b215e409984eb261508e24b6e55f4c18716cb6f6
# Parent  af482d20004c97e7ad8d6e2e5932e82a934761e3
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r b215e409984e
chg: ignore HG_* in confighash

The environment variables `HG_*` are usually used by hooks. Unlike `HGPLAIN`
etc, they do not actually affect hg's behavior. So do not include them in
confighash.

This would avoid spawning an unbound number of chg server processes if
commit hook calls hg frequently.

diff --git a/mercurial/chgserver.py b/mercurial/chgserver.py
--- a/mercurial/chgserver.py
+++ b/mercurial/chgserver.py
@@ -78,5 +78,5 @@ def _hashlist(items):
 _envre = re.compile(r'''\A(?:
                     CHGHG
-                    |HG.*
+                    |HG[A-Z].*
                     |LANG(?:UAGE)?
                     |LC_.*


More information about the Mercurial-devel mailing list