Mercurial > hg
annotate tests/test-ssh @ 2039:0c438fd25e6e
bash_completion: small optimization
Right now we always call "hg help $cmd" to get the canonical name of $cmd
(i.e. to go from "co" to "update").
This patch optimistically assumes that $cmd is already the canonical form
and tries to generate completions for it. If that fails, it falls back
to canonicalizing $cmd and trying again.
This means that:
- if a command or alias is explicitly handled by the
_hg_command_specific function, things get somewhat faster
- as long as the canonical $cmd is handled by _hg_command_specific, all
its aliases and abbreviations are also handled.
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Sun, 02 Apr 2006 18:20:52 +0200 |
parents | 70ba0c86da8b |
children | e8c4f3d3df8c |
rev | line source |
---|---|
1110 | 1 #!/bin/sh |
2 | |
3 # This test tries to exercise the ssh functionality with a dummy script | |
4 | |
5 cat <<'EOF' > dummyssh | |
6 #!/bin/sh | |
7 # this attempts to deal with relative pathnames | |
8 cd `dirname $0` | |
9 | |
10 # check for proper args | |
11 if [ $1 != "user@dummy" ] ; then | |
12 exit -1 | |
13 fi | |
14 | |
15 # check that we're in the right directory | |
1168
235e0effa672
Fixed two tests to run with bourne shell.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1110
diff
changeset
|
16 if [ ! -x dummyssh ] ; then |
1110 | 17 exit -1 |
18 fi | |
19 | |
20 echo Got arguments 1:$1 2:$2 3:$3 4:$4 5:$5 >> dummylog | |
21 $2 | |
22 EOF | |
23 chmod +x dummyssh | |
24 | |
25 echo "# creating 'remote'" | |
26 hg init remote | |
27 cd remote | |
28 echo this > foo | |
1933
7544700fd931
Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1168
diff
changeset
|
29 hg ci -A -m "init" -d "1000000 0" foo |
1110 | 30 |
31 cd .. | |
32 | |
33 echo "# clone remote" | |
34 hg clone -e ./dummyssh ssh://user@dummy/remote local | |
35 | |
36 echo "# verify" | |
37 cd local | |
38 hg verify | |
39 | |
40 echo "# empty default pull" | |
41 hg paths | |
42 hg pull -e ../dummyssh | |
43 | |
44 echo "# local change" | |
45 echo bleah > foo | |
1933
7544700fd931
Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1168
diff
changeset
|
46 hg ci -m "add" -d "1000000 0" |
1110 | 47 |
48 echo "# updating rc" | |
49 echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc | |
50 echo "[ui]" >> .hg/hgrc | |
51 echo "ssh = ../dummyssh" >> .hg/hgrc | |
52 | |
53 echo "# find outgoing" | |
54 hg out ssh://user@dummy/remote | |
55 | |
1982
70ba0c86da8b
Added test for incoming via ssh.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1933
diff
changeset
|
56 echo "# find incoming on the remote side" |
70ba0c86da8b
Added test for incoming via ssh.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1933
diff
changeset
|
57 hg incoming -R ../remote -e ../dummyssh ssh://user@dummy/local |
70ba0c86da8b
Added test for incoming via ssh.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1933
diff
changeset
|
58 |
1110 | 59 echo "# push" |
60 hg push | |
61 | |
62 cd ../remote | |
63 | |
64 echo "# check remote tip" | |
65 hg tip | |
66 hg verify | |
67 hg cat foo | |
68 | |
69 cd .. | |
70 cat dummylog |