##// END OF EJS Templates
test-init: enable for Windows...
Adrian Buehlmann -
r16915:ccebe526 default
parent child Browse files
Show More
@@ -1,196 +1,199
1 $ "$TESTDIR/hghave" no-windows || exit 80
2
3 This test tries to exercise the ssh functionality with a dummy script
1 This test tries to exercise the ssh functionality with a dummy script
4
2
5 $ checknewrepo()
3 $ checknewrepo()
6 > {
4 > {
7 > name=$1
5 > name=$1
8 > if [ -d "$name"/.hg/store ]; then
6 > if [ -d "$name"/.hg/store ]; then
9 > echo store created
7 > echo store created
10 > fi
8 > fi
11 > if [ -f "$name"/.hg/00changelog.i ]; then
9 > if [ -f "$name"/.hg/00changelog.i ]; then
12 > echo 00changelog.i created
10 > echo 00changelog.i created
13 > fi
11 > fi
14 > cat "$name"/.hg/requires
12 > cat "$name"/.hg/requires
15 > }
13 > }
16
14
17 creating 'local'
15 creating 'local'
18
16
19 $ hg init local
17 $ hg init local
20 $ checknewrepo local
18 $ checknewrepo local
21 store created
19 store created
22 00changelog.i created
20 00changelog.i created
23 revlogv1
21 revlogv1
24 fncache
22 fncache
25 store
23 store
26 dotencode
24 dotencode
27 $ echo this > local/foo
25 $ echo this > local/foo
28 $ hg ci --cwd local -A -m "init"
26 $ hg ci --cwd local -A -m "init"
29 adding foo
27 adding foo
30
28
31 creating repo with format.usestore=false
29 creating repo with format.usestore=false
32
30
33 $ hg --config format.usestore=false init old
31 $ hg --config format.usestore=false init old
34 $ checknewrepo old
32 $ checknewrepo old
35 revlogv1
33 revlogv1
36
34
37 creating repo with format.usefncache=false
35 creating repo with format.usefncache=false
38
36
39 $ hg --config format.usefncache=false init old2
37 $ hg --config format.usefncache=false init old2
40 $ checknewrepo old2
38 $ checknewrepo old2
41 store created
39 store created
42 00changelog.i created
40 00changelog.i created
43 revlogv1
41 revlogv1
44 store
42 store
45
43
46 creating repo with format.dotencode=false
44 creating repo with format.dotencode=false
47
45
48 $ hg --config format.dotencode=false init old3
46 $ hg --config format.dotencode=false init old3
49 $ checknewrepo old3
47 $ checknewrepo old3
50 store created
48 store created
51 00changelog.i created
49 00changelog.i created
52 revlogv1
50 revlogv1
53 fncache
51 fncache
54 store
52 store
55
53
56 test failure
54 test failure
57
55
58 $ hg init local
56 $ hg init local
59 abort: repository local already exists!
57 abort: repository local already exists!
60 [255]
58 [255]
61
59
62 init+push to remote2
60 init+push to remote2
63
61
64 $ hg init -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote2
62 $ hg init -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote2
65 $ hg incoming -R remote2 local
63 $ hg incoming -R remote2 local
66 comparing with local
64 comparing with local
67 changeset: 0:08b9e9f63b32
65 changeset: 0:08b9e9f63b32
68 tag: tip
66 tag: tip
69 user: test
67 user: test
70 date: Thu Jan 01 00:00:00 1970 +0000
68 date: Thu Jan 01 00:00:00 1970 +0000
71 summary: init
69 summary: init
72
70
73
71
74 $ hg push -R local -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote2
72 $ hg push -R local -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote2
75 pushing to ssh://user@dummy/remote2
73 pushing to ssh://user@dummy/remote2
76 searching for changes
74 searching for changes
77 remote: adding changesets
75 remote: adding changesets
78 remote: adding manifests
76 remote: adding manifests
79 remote: adding file changes
77 remote: adding file changes
80 remote: added 1 changesets with 1 changes to 1 files
78 remote: added 1 changesets with 1 changes to 1 files
81
79
82 clone to remote1
80 clone to remote1
83
81
84 $ hg clone -e "python \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote1
82 $ hg clone -e "python \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote1
85 searching for changes
83 searching for changes
86 remote: adding changesets
84 remote: adding changesets
87 remote: adding manifests
85 remote: adding manifests
88 remote: adding file changes
86 remote: adding file changes
89 remote: added 1 changesets with 1 changes to 1 files
87 remote: added 1 changesets with 1 changes to 1 files
90
88
91 init to existing repo
89 init to existing repo
92
90
93 $ hg init -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote1
91 $ hg init -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote1
94 abort: repository remote1 already exists!
92 abort: repository remote1 already exists!
95 abort: could not create remote repo!
93 abort: could not create remote repo!
96 [255]
94 [255]
97
95
98 clone to existing repo
96 clone to existing repo
99
97
100 $ hg clone -e "python \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote1
98 $ hg clone -e "python \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote1
101 abort: repository remote1 already exists!
99 abort: repository remote1 already exists!
102 abort: could not create remote repo!
100 abort: could not create remote repo!
103 [255]
101 [255]
104
102
105 output of dummyssh
103 output of dummyssh
106
104
107 $ cat dummylog
105 $ cat dummylog
108 Got arguments 1:user@dummy 2:hg init remote2
106 Got arguments 1:user@dummy 2:hg init remote2
109 Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio
107 Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio
110 Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio
108 Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio
111 Got arguments 1:user@dummy 2:hg init remote1
109 Got arguments 1:user@dummy 2:hg init remote1
112 Got arguments 1:user@dummy 2:hg -R remote1 serve --stdio
110 Got arguments 1:user@dummy 2:hg -R remote1 serve --stdio
113 Got arguments 1:user@dummy 2:hg init remote1
111 Got arguments 1:user@dummy 2:hg init remote1
114 Got arguments 1:user@dummy 2:hg init remote1
112 Got arguments 1:user@dummy 2:hg init remote1
115
113
116 comparing repositories
114 comparing repositories
117
115
118 $ hg tip -q -R local
116 $ hg tip -q -R local
119 0:08b9e9f63b32
117 0:08b9e9f63b32
120 $ hg tip -q -R remote1
118 $ hg tip -q -R remote1
121 0:08b9e9f63b32
119 0:08b9e9f63b32
122 $ hg tip -q -R remote2
120 $ hg tip -q -R remote2
123 0:08b9e9f63b32
121 0:08b9e9f63b32
124
122
125 check names for repositories (clashes with URL schemes, special chars)
123 check names for repositories (clashes with URL schemes, special chars)
126
124
127 $ for i in bundle file hg http https old-http ssh static-http " " "with space"; do
125 $ for i in bundle file hg http https old-http ssh static-http "with space"; do
128 > printf "hg init \"$i\"... "
126 > printf "hg init \"$i\"... "
129 > hg init "$i"
127 > hg init "$i"
130 > test -d "$i" -a -d "$i/.hg" && echo "ok" || echo "failed"
128 > test -d "$i" -a -d "$i/.hg" && echo "ok" || echo "failed"
131 > done
129 > done
132 hg init "bundle"... ok
130 hg init "bundle"... ok
133 hg init "file"... ok
131 hg init "file"... ok
134 hg init "hg"... ok
132 hg init "hg"... ok
135 hg init "http"... ok
133 hg init "http"... ok
136 hg init "https"... ok
134 hg init "https"... ok
137 hg init "old-http"... ok
135 hg init "old-http"... ok
138 hg init "ssh"... ok
136 hg init "ssh"... ok
139 hg init "static-http"... ok
137 hg init "static-http"... ok
140 hg init " "... ok
141 hg init "with space"... ok
138 hg init "with space"... ok
139 #if no-windows
140 /* " " is not a valid name for a directory on Windows */
141 $ hg init " "
142 $ test -d " "
143 $ test -d " /.hg"
144 #endif
142
145
143 creating 'local/sub/repo'
146 creating 'local/sub/repo'
144
147
145 $ hg init local/sub/repo
148 $ hg init local/sub/repo
146 $ checknewrepo local/sub/repo
149 $ checknewrepo local/sub/repo
147 store created
150 store created
148 00changelog.i created
151 00changelog.i created
149 revlogv1
152 revlogv1
150 fncache
153 fncache
151 store
154 store
152 dotencode
155 dotencode
153
156
154 prepare test of init of url configured from paths
157 prepare test of init of url configured from paths
155
158
156 $ echo '[paths]' >> $HGRCPATH
159 $ echo '[paths]' >> $HGRCPATH
157 $ echo "somewhere = `pwd`/url from paths" >> $HGRCPATH
160 $ echo "somewhere = `pwd`/url from paths" >> $HGRCPATH
158 $ echo "elsewhere = `pwd`/another paths url" >> $HGRCPATH
161 $ echo "elsewhere = `pwd`/another paths url" >> $HGRCPATH
159
162
160 init should (for consistency with clone) expand the url
163 init should (for consistency with clone) expand the url
161
164
162 $ hg init somewhere
165 $ hg init somewhere
163 $ checknewrepo "url from paths"
166 $ checknewrepo "url from paths"
164 store created
167 store created
165 00changelog.i created
168 00changelog.i created
166 revlogv1
169 revlogv1
167 fncache
170 fncache
168 store
171 store
169 dotencode
172 dotencode
170
173
171 verify that clone also expand urls
174 verify that clone also expand urls
172
175
173 $ hg clone somewhere elsewhere
176 $ hg clone somewhere elsewhere
174 updating to branch default
177 updating to branch default
175 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
178 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
176 $ checknewrepo "another paths url"
179 $ checknewrepo "another paths url"
177 store created
180 store created
178 00changelog.i created
181 00changelog.i created
179 revlogv1
182 revlogv1
180 fncache
183 fncache
181 store
184 store
182 dotencode
185 dotencode
183
186
184 clone bookmarks
187 clone bookmarks
185
188
186 $ hg -R local bookmark test
189 $ hg -R local bookmark test
187 $ hg -R local bookmarks
190 $ hg -R local bookmarks
188 * test 0:08b9e9f63b32
191 * test 0:08b9e9f63b32
189 $ hg clone -e "python \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote-bookmarks
192 $ hg clone -e "python \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote-bookmarks
190 searching for changes
193 searching for changes
191 remote: adding changesets
194 remote: adding changesets
192 remote: adding manifests
195 remote: adding manifests
193 remote: adding file changes
196 remote: adding file changes
194 remote: added 1 changesets with 1 changes to 1 files
197 remote: added 1 changesets with 1 changes to 1 files
195 $ hg -R remote-bookmarks bookmarks
198 $ hg -R remote-bookmarks bookmarks
196 test 0:08b9e9f63b32
199 test 0:08b9e9f63b32
General Comments 0
You need to be logged in to leave comments. Login now