Skip to content
Snippets Groups Projects
Commit 7bf7544f authored by Jun Wu's avatar Jun Wu
Browse files

chgserver: do not treat HG as sensitive environ when CHGHG is set

When `$CHGHG` is set, `$HG` is ignored by the chg client. Removing it from
chg's sensitive environment list would avoid starting up servers
unnecessarily when `$CHGHG` is the same while `$HG` is different.

Differential Revision: https://phab.mercurial-scm.org/D1177
parent dbb54232
No related branches found
No related tags found
No related merge requests found
......@@ -108,4 +108,9 @@
for section, item in _configsectionitems:
sectionitems.append(ui.config(section, item))
sectionhash = _hashlist(sectionitems)
# If $CHGHG is set, the change to $HG should not trigger a new chg server
if 'CHGHG' in encoding.environ:
ignored = {'HG'}
else:
ignored = set()
envitems = [(k, v) for k, v in encoding.environ.iteritems()
......@@ -111,5 +116,5 @@
envitems = [(k, v) for k, v in encoding.environ.iteritems()
if _envre.match(k)]
if _envre.match(k) and k not in ignored]
envhash = _hashlist(sorted(envitems))
return sectionhash[:6] + envhash[:6]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment