tests/test-chg.t
author Jun Wu <quark@fb.com>
Fri, 06 May 2016 23:57:56 +0100
changeset 29088 983353035cec
parent 28516 3bf2892f685f
child 29274 148a9a5379f0
permissions -rw-r--r--
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.

init repo

  $ hg init foo
  $ cd foo

ill-formed config

  $ hg status
  $ echo '=brokenconfig' >> $HGRCPATH
  $ hg status
  hg: parse error at * (glob)
  [255]

alias having an environment variable and set to use pager

  $ rm $HGRCPATH
  $ cat >> $HGRCPATH <<'EOF'
  > [ui]
  > formatted = yes
  > [extensions]
  > pager =
  > [pager]
  > pager = sed -e 's/^/P/'
  > attend = printa
  > [alias]
  > printa = log -T "$A\n" -r 0
  > EOF

  $ A=1 hg printa
  P1
  $ A=2 hg printa
  P2