Patchwork chg: ignore HG_* in confighash

login
register
mail settings
Submitter Jun Wu
Date Dec. 14, 2016, 2:21 a.m.
Message ID <b215e409984eb261508e.1481682091@x1c>
Download mbox | patch
Permalink /patch/17893/
State Superseded
Headers show

Comments

Jun Wu - Dec. 14, 2016, 2:21 a.m.
# HG changeset patch
# User Jun Wu <quark@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.
Yuya Nishihara - Dec. 14, 2016, 1:23 p.m.
On Wed, 14 Dec 2016 02:21:31 +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 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.

Seems fine

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

but we probably want to include "HG" which belongs to the same category
as "CHGHG".
Jun Wu - Dec. 14, 2016, 2:28 p.m.
Excerpts from Yuya Nishihara's message of 2016-12-14 22:23:16 +0900:
> On Wed, 14 Dec 2016 02:21:31 +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 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.
> 
> Seems fine
> 
> > --- 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].*
> 
> but we probably want to include "HG" which belongs to the same category
> as "CHGHG".

Sorry, I should have remembered that. Will send a V2. 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_.*