[PATCH V2] chg: ignore HG_* in confighash

Jun Wu quark at fb.com
Wed Dec 14 09:34:12 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 97bed60e80b3884e24524822f0614b0ba7654dbf
# Parent  af482d20004c97e7ad8d6e2e5932e82a934761e3
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 97bed60e80b3
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

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(?:
-                    |HG.*
+                    |HG(?:[A-Z].*)?

More information about the Mercurial-devel mailing list