Show More
@@ -213,18 +213,6 b' def _setuppagercmd(ui, options, cmd):' | |||||
213 | ui.setconfig('ui', 'interactive', False, 'pager') |
|
213 | ui.setconfig('ui', 'interactive', False, 'pager') | |
214 | return p |
|
214 | return p | |
215 |
|
215 | |||
216 | _envvarre = re.compile(r'\$[a-zA-Z_]+') |
|
|||
217 |
|
||||
218 | def _clearenvaliases(cmdtable): |
|
|||
219 | """Remove stale command aliases referencing env vars; variable expansion |
|
|||
220 | is done at dispatch.addaliases()""" |
|
|||
221 | for name, tab in cmdtable.items(): |
|
|||
222 | cmddef = tab[0] |
|
|||
223 | if (isinstance(cmddef, dispatch.cmdalias) and |
|
|||
224 | not cmddef.definition.startswith('!') and # shell alias |
|
|||
225 | _envvarre.search(cmddef.definition)): |
|
|||
226 | del cmdtable[name] |
|
|||
227 |
|
||||
228 | def _newchgui(srcui, csystem): |
|
216 | def _newchgui(srcui, csystem): | |
229 | class chgui(srcui.__class__): |
|
217 | class chgui(srcui.__class__): | |
230 | def __init__(self, src=None): |
|
218 | def __init__(self, src=None): | |
@@ -525,7 +513,6 b' class chgcmdserver(commandserver.server)' | |||||
525 | _log('setenv: %r\n' % sorted(newenv.keys())) |
|
513 | _log('setenv: %r\n' % sorted(newenv.keys())) | |
526 | os.environ.clear() |
|
514 | os.environ.clear() | |
527 | os.environ.update(newenv) |
|
515 | os.environ.update(newenv) | |
528 | _clearenvaliases(commands.table) |
|
|||
529 |
|
516 | |||
530 | capabilities = commandserver.server.capabilities.copy() |
|
517 | capabilities = commandserver.server.capabilities.copy() | |
531 | capabilities.update({'attachio': attachio, |
|
518 | capabilities.update({'attachio': attachio, |
@@ -10,3 +10,23 b' ill-formed config' | |||||
10 | $ hg status |
|
10 | $ hg status | |
11 | hg: parse error at * (glob) |
|
11 | hg: parse error at * (glob) | |
12 | [255] |
|
12 | [255] | |
|
13 | ||||
|
14 | alias having an environment variable and set to use pager | |||
|
15 | ||||
|
16 | $ rm $HGRCPATH | |||
|
17 | $ cat >> $HGRCPATH <<'EOF' | |||
|
18 | > [ui] | |||
|
19 | > formatted = yes | |||
|
20 | > [extensions] | |||
|
21 | > pager = | |||
|
22 | > [pager] | |||
|
23 | > pager = sed -e 's/^/P/' | |||
|
24 | > attend = printa | |||
|
25 | > [alias] | |||
|
26 | > printa = log -T "$A\n" -r 0 | |||
|
27 | > EOF | |||
|
28 | ||||
|
29 | $ A=1 hg printa | |||
|
30 | P1 | |||
|
31 | $ A=2 hg printa | |||
|
32 | P2 |
General Comments 0
You need to be logged in to leave comments.
Login now