summaryrefslogtreecommitdiff
path: root/tests/test-alias.t
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-alias.t')
-rw-r--r--tests/test-alias.t181
1 files changed, 74 insertions, 107 deletions
diff --git a/tests/test-alias.t b/tests/test-alias.t
index cf19233..eb9e8b3 100644
--- a/tests/test-alias.t
+++ b/tests/test-alias.t
@@ -4,10 +4,7 @@
> graphlog=
>
> [alias]
- > # should clobber ci but not commit (issue2993)
- > ci = version
> myinit = init
- > optionalrepo = showconfig alias.myinit
> cleanstatus = status -c
> unknown = bargle
> ambiguous = s
@@ -24,14 +21,14 @@
> dln = lognull --debug
> nousage = rollback
> put = export -r 0 -o "\$FOO/%R.diff"
- > blank = !printf '\n'
- > self = !printf '\$0\n'
- > echoall = !printf '\$@\n'
- > echo1 = !printf '\$1\n'
- > echo2 = !printf '\$2\n'
- > echo13 = !printf '\$1 \$3\n'
- > count = !hg log -r "\$@" --template=. | wc -c | sed -e 's/ //g'
- > mcount = !hg log \$@ --template=. | wc -c | sed -e 's/ //g'
+ > blank = !echo
+ > self = !echo '\$0'
+ > echo = !echo '\$@'
+ > echo1 = !echo '\$1'
+ > echo2 = !echo '\$2'
+ > echo13 = !echo '\$1' '\$3'
+ > count = !hg log -r '\$@' --template='.' | wc -c | sed -e 's/ //g'
+ > mcount = !hg log \$@ --template='.' | wc -c | sed -e 's/ //g'
> rt = root
> tglog = glog --template "{rev}:{node|short}: '{desc}' {branches}\n"
> idalias = id
@@ -39,10 +36,10 @@
> idaliasshell = !echo test
> parentsshell1 = !echo one
> parentsshell2 = !echo two
- > escaped1 = !printf 'test\$\$test\n'
- > escaped2 = !sh -c 'echo "HGFOO is \$\$HGFOO"'
- > escaped3 = !sh -c 'echo "\$1 is \$\$\$1"'
- > escaped4 = !printf '\$\$0 \$\$@\n'
+ > escaped1 = !echo 'test\$\$test'
+ > escaped2 = !echo "HGFOO is \$\$HGFOO"
+ > escaped3 = !echo "\$1 is \$\$\$1"
+ > escaped4 = !echo '\$\$0' '\$\$@'
>
> [defaults]
> mylog = -q
@@ -107,19 +104,8 @@ invalid options
$ hg help no--repository
error in definition for alias 'no--repository': --repository may only be given on the command line
-optional repository
-
-#if no-outer-repo
- $ hg optionalrepo
- init
-#endif
$ cd alias
- $ cat > .hg/hgrc <<EOF
- > [alias]
- > myinit = init -q
- > EOF
- $ hg optionalrepo
- init -q
+
no usage
@@ -127,7 +113,7 @@ no usage
no rollback information available
$ echo foo > foo
- $ hg commit -Amfoo
+ $ hg ci -Amfoo
adding foo
@@ -144,12 +130,6 @@ with opts and whitespace
positional arguments
- $ hg positional
- abort: too few arguments for command alias
- [255]
- $ hg positional a
- abort: too few arguments for command alias
- [255]
$ hg positional 'node|short' rev
0 e63c23eaa88a | 1970-01-01 00:00 +0000
@@ -200,11 +180,11 @@ simple shell aliases
$ hg self
self
- $ hg echoall
+ $ hg echo
- $ hg echoall foo
+ $ hg echo foo
foo
- $ hg echoall 'test $2' foo
+ $ hg echo 'test $2' foo
test $2 foo
$ hg echo1 foo bar baz
foo
@@ -215,7 +195,7 @@ simple shell aliases
$ hg echo2 foo
$ echo bar > bar
- $ hg commit -qA -m bar
+ $ hg ci -qA -m bar
$ hg count .
1
$ hg count 'branch(default)'
@@ -270,19 +250,19 @@ shell aliases with global options
0
$ hg --cwd .. count 'branch(default)'
2
- $ hg echoall --cwd ..
-
+ $ hg echo --cwd ..
+ --cwd ..
repo specific shell aliases
$ cat >> .hg/hgrc <<EOF
> [alias]
- > subalias = !echo sub
+ > subalias = !echo sub \$@
> EOF
$ cat >> ../.hg/hgrc <<EOF
> [alias]
- > mainalias = !echo main
+ > mainalias = !echo main \$@
> EOF
@@ -325,7 +305,7 @@ invalid arguments
$ hg rt foo
hg rt: invalid arguments
- hg rt
+ hg rt
alias for: hg root
@@ -340,24 +320,23 @@ invalid global arguments for normal commands, aliases, and shell aliases
basic commands:
- add add the specified files on the next commit
- annotate show changeset information by line for each file
- clone make a copy of an existing repository
- commit commit the specified files or all outstanding changes
- diff diff repository (or selected files)
- export dump the header and diffs for one or more changesets
- forget forget the specified files on the next commit
- init create a new repository in the given directory
- log show revision history of entire repository or files
- merge merge working directory with another revision
- phase set or show the current phase name
- pull pull changes from the specified source
- push push changes to the specified destination
- remove remove the specified files on the next commit
- serve start stand-alone webserver
- status show changed files in the working directory
- summary summarize working directory state
- update update working directory (or switch revisions)
+ add add the specified files on the next commit
+ annotate show changeset information by line for each file
+ clone make a copy of an existing repository
+ commit commit the specified files or all outstanding changes
+ diff diff repository (or selected files)
+ export dump the header and diffs for one or more changesets
+ forget forget the specified files on the next commit
+ init create a new repository in the given directory
+ log show revision history of entire repository or files
+ merge merge working directory with another revision
+ pull pull changes from the specified source
+ push push changes to the specified destination
+ remove remove the specified files on the next commit
+ serve start stand-alone webserver
+ status show changed files in the working directory
+ summary summarize working directory state
+ update update working directory (or switch revisions)
use "hg help" for the full list of commands or "hg -v" for details
[255]
@@ -367,24 +346,23 @@ invalid global arguments for normal commands, aliases, and shell aliases
basic commands:
- add add the specified files on the next commit
- annotate show changeset information by line for each file
- clone make a copy of an existing repository
- commit commit the specified files or all outstanding changes
- diff diff repository (or selected files)
- export dump the header and diffs for one or more changesets
- forget forget the specified files on the next commit
- init create a new repository in the given directory
- log show revision history of entire repository or files
- merge merge working directory with another revision
- phase set or show the current phase name
- pull pull changes from the specified source
- push push changes to the specified destination
- remove remove the specified files on the next commit
- serve start stand-alone webserver
- status show changed files in the working directory
- summary summarize working directory state
- update update working directory (or switch revisions)
+ add add the specified files on the next commit
+ annotate show changeset information by line for each file
+ clone make a copy of an existing repository
+ commit commit the specified files or all outstanding changes
+ diff diff repository (or selected files)
+ export dump the header and diffs for one or more changesets
+ forget forget the specified files on the next commit
+ init create a new repository in the given directory
+ log show revision history of entire repository or files
+ merge merge working directory with another revision
+ pull pull changes from the specified source
+ push push changes to the specified destination
+ remove remove the specified files on the next commit
+ serve start stand-alone webserver
+ status show changed files in the working directory
+ summary summarize working directory state
+ update update working directory (or switch revisions)
use "hg help" for the full list of commands or "hg -v" for details
[255]
@@ -394,35 +372,24 @@ invalid global arguments for normal commands, aliases, and shell aliases
basic commands:
- add add the specified files on the next commit
- annotate show changeset information by line for each file
- clone make a copy of an existing repository
- commit commit the specified files or all outstanding changes
- diff diff repository (or selected files)
- export dump the header and diffs for one or more changesets
- forget forget the specified files on the next commit
- init create a new repository in the given directory
- log show revision history of entire repository or files
- merge merge working directory with another revision
- phase set or show the current phase name
- pull pull changes from the specified source
- push push changes to the specified destination
- remove remove the specified files on the next commit
- serve start stand-alone webserver
- status show changed files in the working directory
- summary summarize working directory state
- update update working directory (or switch revisions)
+ add add the specified files on the next commit
+ annotate show changeset information by line for each file
+ clone make a copy of an existing repository
+ commit commit the specified files or all outstanding changes
+ diff diff repository (or selected files)
+ export dump the header and diffs for one or more changesets
+ forget forget the specified files on the next commit
+ init create a new repository in the given directory
+ log show revision history of entire repository or files
+ merge merge working directory with another revision
+ pull pull changes from the specified source
+ push push changes to the specified destination
+ remove remove the specified files on the next commit
+ serve start stand-alone webserver
+ status show changed files in the working directory
+ summary summarize working directory state
+ update update working directory (or switch revisions)
use "hg help" for the full list of commands or "hg -v" for details
[255]
-This should show id:
-
- $ hg --config alias.log='id' log
- 000000000000 tip
-
-This shouldn't:
-
- $ hg --config alias.log='id' history
-
- $ cd ../..