Patchwork chgserver: do not copy configs set by environment variables

login
register
mail settings
Submitter Jun Wu
Date March 28, 2017, 3:41 p.m.
Message ID <00edeed528adcf61316b.1490715684@localhost.localdomain>
Download mbox | patch
Permalink /patch/19789/
State Accepted
Headers show

Comments

Jun Wu - March 28, 2017, 3:41 p.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1490715612 25200
#      Tue Mar 28 08:40:12 2017 -0700
# Node ID 00edeed528adcf61316b83cd281b2ba3bc27c14b
# Parent  01cb4d7bd67aca078f3ca74fdbffd5685a17defe
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 00edeed528ad
chgserver: do not copy configs set by environment variables

Config set by environment variables have a source like "$ENVNAME". They
should not be copied because they will be recalculated by
rcutil.rccomponents.
Yuya Nishihara - March 28, 2017, 3:52 p.m.
On Tue, 28 Mar 2017 08:41:24 -0700, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark@fb.com>
> # Date 1490715612 25200
> #      Tue Mar 28 08:40:12 2017 -0700
> # Node ID 00edeed528adcf61316b83cd281b2ba3bc27c14b
> # Parent  01cb4d7bd67aca078f3ca74fdbffd5685a17defe
> # Available At https://bitbucket.org/quark-zju/hg-draft
> #              hg pull https://bitbucket.org/quark-zju/hg-draft -r 00edeed528ad
> chgserver: do not copy configs set by environment variables

Ah, queued, thanks.

Patch

diff --git a/mercurial/chgserver.py b/mercurial/chgserver.py
--- a/mercurial/chgserver.py
+++ b/mercurial/chgserver.py
@@ -214,6 +214,6 @@  def _loadnewui(srcui, args):
     for section, name, value in srcui.walkconfig():
         source = srcui.configsource(section, name)
-        if ':' in source or source == '--config':
-            # path:line or command line
+        if ':' in source or source == '--config' or source.startswith('$'):
+            # path:line or command line, or environ
             continue
         newui.setconfig(section, name, value, source)