Patchwork [V2] chg: ignore HG_* in confighash

login
register
mail settings
Submitter Jun Wu
Date Dec. 14, 2016, 2:34 p.m.
Message ID <97bed60e80b3884e2452.1481726052@x1c>
Download mbox | patch
Permalink /patch/17906/
State Accepted
Headers show

Comments

Jun Wu - Dec. 14, 2016, 2:34 p.m.
# HG changeset patch
# User Jun Wu <quark@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
confighash.

This would avoid spawning an unbound number of chg server processes if
commit hook calls hg frequently.
Yuya Nishihara - Dec. 14, 2016, 2:42 p.m.
On Wed, 14 Dec 2016 14:34:12 +0000, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark@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

Queued this, thanks.

Patch

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_.*