comparison mercurial/chgserver.py @ 34887:7bf7544fd6cc

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
author Jun Wu <quark@fb.com>
date Wed, 18 Oct 2017 14:55:39 -0700
parents 110040e715c9
children d3d35a55e03b
comparison
equal deleted inserted replaced
34886:dbb542326582 34887:7bf7544fd6cc
106 for section in _configsections: 106 for section in _configsections:
107 sectionitems.append(ui.configitems(section)) 107 sectionitems.append(ui.configitems(section))
108 for section, item in _configsectionitems: 108 for section, item in _configsectionitems:
109 sectionitems.append(ui.config(section, item)) 109 sectionitems.append(ui.config(section, item))
110 sectionhash = _hashlist(sectionitems) 110 sectionhash = _hashlist(sectionitems)
111 # If $CHGHG is set, the change to $HG should not trigger a new chg server
112 if 'CHGHG' in encoding.environ:
113 ignored = {'HG'}
114 else:
115 ignored = set()
111 envitems = [(k, v) for k, v in encoding.environ.iteritems() 116 envitems = [(k, v) for k, v in encoding.environ.iteritems()
112 if _envre.match(k)] 117 if _envre.match(k) and k not in ignored]
113 envhash = _hashlist(sorted(envitems)) 118 envhash = _hashlist(sorted(envitems))
114 return sectionhash[:6] + envhash[:6] 119 return sectionhash[:6] + envhash[:6]
115 120
116 def _getmtimepaths(ui): 121 def _getmtimepaths(ui):
117 """get a list of paths that should be checked to detect change 122 """get a list of paths that should be checked to detect change