comparison tests/test-alias.t @ 29087:ad1bdea43965

dispatch: defer environment variable resolution in alias commands (BC) Before this patch, if there are environment variables in an alias command, they will be expanded immediately when we first see the alias. This will cause issues with chg, because environment variable updates will not propagate to expanded arguments. This patch makes "args" of "cmdalias" a property that will be calculated every time when accessed.
author Jun Wu <quark@fb.com>
date Sat, 07 May 2016 00:16:58 +0100
parents 6822f9382b4c
children 7109d5ddeb0c
comparison
equal deleted inserted replaced
29086:fe50341de1ff 29087:ad1bdea43965
523 update update working directory (or switch revisions) 523 update update working directory (or switch revisions)
524 524
525 (use "hg help" for the full list of commands or "hg -v" for details) 525 (use "hg help" for the full list of commands or "hg -v" for details)
526 [255] 526 [255]
527 527
528 environment variable changes in alias commands
529
530 $ cat > $TESTTMP/setcount.py <<EOF
531 > import os
532 > def uisetup(ui):
533 > os.environ['COUNT'] = '2'
534 > EOF
535
536 $ cat >> $HGRCPATH <<'EOF'
537 > [extensions]
538 > setcount = $TESTTMP/setcount.py
539 > [alias]
540 > showcount = log -T "$COUNT\n" -r .
541 > EOF
542
543 $ COUNT=1 hg showcount
544 2
545
528 This should show id: 546 This should show id:
529 547
530 $ hg --config alias.log='id' log 548 $ hg --config alias.log='id' log
531 000000000000 tip 549 000000000000 tip
532 550