D912: test-alias: make it compatible with chg
quark (Jun Wu)
phabricator at mercurial-scm.org
Thu Oct 5 10:01:39 EDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGa8a9c0d3232b: test-alias: make it compatible with chg (authored by quark, committed by ).
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D912?vs=2452&id=2462
REVISION DETAIL
https://phab.mercurial-scm.org/D912
AFFECTED FILES
tests/test-alias.t
CHANGE DETAILS
diff --git a/tests/test-alias.t b/tests/test-alias.t
--- a/tests/test-alias.t
+++ b/tests/test-alias.t
@@ -527,21 +527,29 @@
environment variable changes in alias commands
- $ cat > $TESTTMP/setcount.py <<EOF
+ $ cat > $TESTTMP/expandalias.py <<EOF
> import os
- > def uisetup(ui):
+ > from mercurial import cmdutil, commands, registrar
+ > cmdtable = {}
+ > command = registrar.command(cmdtable)
+ > @command('expandalias')
+ > def expandalias(ui, repo, name):
+ > alias = cmdutil.findcmd(name, commands.table)[1][0]
+ > ui.write('%s args: %s\n' % (name, ' '.join(alias.args)))
> os.environ['COUNT'] = '2'
+ > ui.write('%s args: %s (with COUNT=2)\n' % (name, ' '.join(alias.args)))
> EOF
$ cat >> $HGRCPATH <<'EOF'
> [extensions]
- > setcount = $TESTTMP/setcount.py
+ > expandalias = $TESTTMP/expandalias.py
> [alias]
- > showcount = log -T "$COUNT\n" -r .
+ > showcount = log -T "$COUNT" -r .
> EOF
- $ COUNT=1 hg showcount
- 2
+ $ COUNT=1 hg expandalias showcount
+ showcount args: -T 1 -r .
+ showcount args: -T 2 -r . (with COUNT=2)
This should show id:
To: quark, #hg-reviewers, yuja
Cc: yuja, mercurial-devel
More information about the Mercurial-devel
mailing list