annotate tests/test-init @ 4258:47ba52121433

Add import --exact. When this option is set, import will apply the patch (which must be generated by export) to the parents specified in the patch, and check that the node produced by the patch matches the node ID in the patch.
author Brendan Cully <brendan@kublai.com>
date Thu, 22 Mar 2007 10:44:59 -0700
parents c0271aba6abe
children 27590c19ad30
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2599
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
1 #!/bin/sh
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
2
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
3 # This test tries to exercise the ssh functionality with a dummy script
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
4
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
5 cat <<'EOF' > dummyssh
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
6 #!/bin/sh
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
7 # this attempts to deal with relative pathnames
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
8 cd `dirname $0`
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
9
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
10 # check for proper args
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
11 if [ $1 != "user@dummy" ] ; then
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
12 exit -1
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
13 fi
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
14
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
15 # check that we're in the right directory
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
16 if [ ! -x dummyssh ] ; then
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
17 exit -1
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
18 fi
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
19
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
20 echo Got arguments 1:$1 2:$2 3:$3 4:$4 5:$5 >> dummylog
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
21 $2
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
22 EOF
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
23 chmod +x dummyssh
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
24
4166
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
25 checknewrepo()
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
26 {
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
27 name=$1
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
28
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
29 if [ -d $name/.hg/store ]; then
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
30 echo store created
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
31 fi
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
32
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
33 if [ -f $name/.hg/00changelog.i ]; then
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
34 echo 00changelog.i created
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
35 fi
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
36
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
37 cat $name/.hg/requires
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
38 }
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
39
2599
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
40 echo "# creating 'local'"
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
41 hg init local
4166
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
42 checknewrepo local
2599
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
43 echo this > local/foo
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
44 hg ci --cwd local -A -m "init" -d "1000000 0"
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
45
4166
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
46 echo "# creating repo with old format"
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
47 hg --config format.usestore=false init old
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
48 checknewrepo old
c0271aba6abe small fixes for the parent patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3713
diff changeset
49
3034
3acb76f0124d clone: simplifying dest repo creation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2599
diff changeset
50 echo "#test failure"
3acb76f0124d clone: simplifying dest repo creation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2599
diff changeset
51 hg init local
3acb76f0124d clone: simplifying dest repo creation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2599
diff changeset
52
2599
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
53 echo "# init+push to remote2"
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
54 hg init -e ./dummyssh ssh://user@dummy/remote2
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
55 hg incoming -R remote2 local
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
56 hg push -R local -e ./dummyssh ssh://user@dummy/remote2
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
57
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
58 echo "# clone to remote1"
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
59 hg clone -e ./dummyssh local ssh://user@dummy/remote1
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
60
3034
3acb76f0124d clone: simplifying dest repo creation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2599
diff changeset
61 echo "# init to existing repo"
3acb76f0124d clone: simplifying dest repo creation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2599
diff changeset
62 hg init -e ./dummyssh ssh://user@dummy/remote1
3acb76f0124d clone: simplifying dest repo creation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2599
diff changeset
63
3acb76f0124d clone: simplifying dest repo creation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2599
diff changeset
64 echo "# clone to existing repo"
3acb76f0124d clone: simplifying dest repo creation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2599
diff changeset
65 hg clone -e ./dummyssh local ssh://user@dummy/remote1
3acb76f0124d clone: simplifying dest repo creation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2599
diff changeset
66
2599
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
67 echo "# output of dummyssh"
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
68 cat dummylog
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
69
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
70 echo "# comparing repositories"
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
71 hg tip -q -R local
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
72 hg tip -q -R remote1
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
73 hg tip -q -R remote2
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
74
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
75 echo "# check names for repositories (clashes with URL schemes, special chars)"
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
76 for i in bundle file hg http https old-http ssh static-http " " "with space"; do
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
77 echo "# hg init \"$i\""
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
78 hg init "$i"
3713
8ae88ed2a3b6 don't create the .hg/data at init time
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 3034
diff changeset
79 test -d "$i" -a -d "$i/.hg" && echo "ok" || echo "failed"
2599
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
80 done
e4b5e48052c6 Added tests for local and remote init.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
81