Mercurial > public > mercurial-scm > hg
diff hgext/chgserver.py @ 29088:983353035cec
chgserver: remove _clearenvaliases
Since we expand environment variables in alias lazily, the _clearenvaliases
hack is no longer necessary.
This resolves an issue that a non-shell alias which has environment variables
in its arguments and is set to use pager will not use pager running with chg.
author | Jun Wu <quark@fb.com> |
---|---|
date | Fri, 06 May 2016 23:57:56 +0100 |
parents | 97c8da2f89f9 |
children | 57a24a85a2bc |
line wrap: on
line diff
--- a/hgext/chgserver.py Sat May 07 00:16:58 2016 +0100 +++ b/hgext/chgserver.py Fri May 06 23:57:56 2016 +0100 @@ -213,18 +213,6 @@ ui.setconfig('ui', 'interactive', False, 'pager') return p -_envvarre = re.compile(r'\$[a-zA-Z_]+') - -def _clearenvaliases(cmdtable): - """Remove stale command aliases referencing env vars; variable expansion - is done at dispatch.addaliases()""" - for name, tab in cmdtable.items(): - cmddef = tab[0] - if (isinstance(cmddef, dispatch.cmdalias) and - not cmddef.definition.startswith('!') and # shell alias - _envvarre.search(cmddef.definition)): - del cmdtable[name] - def _newchgui(srcui, csystem): class chgui(srcui.__class__): def __init__(self, src=None): @@ -525,7 +513,6 @@ _log('setenv: %r\n' % sorted(newenv.keys())) os.environ.clear() os.environ.update(newenv) - _clearenvaliases(commands.table) capabilities = commandserver.server.capabilities.copy() capabilities.update({'attachio': attachio,