##// END OF EJS Templates
tests: test generaldelta configuration in test-init.t...
Pierre-Yves David -
r26921:b11495c2 default
parent child Browse files
Show More
@@ -1,235 +1,260 b''
1 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
2
2
3 (enable general delta early)
4
5 $ cat << EOF >> $HGRCPATH
6 > [format]
7 > usegeneraldelta=yes
8 > EOF
9
3 $ checknewrepo()
10 $ checknewrepo()
4 > {
11 > {
5 > name=$1
12 > name=$1
6 > if [ -d "$name"/.hg/store ]; then
13 > if [ -d "$name"/.hg/store ]; then
7 > echo store created
14 > echo store created
8 > fi
15 > fi
9 > if [ -f "$name"/.hg/00changelog.i ]; then
16 > if [ -f "$name"/.hg/00changelog.i ]; then
10 > echo 00changelog.i created
17 > echo 00changelog.i created
11 > fi
18 > fi
12 > cat "$name"/.hg/requires
19 > cat "$name"/.hg/requires
13 > }
20 > }
14
21
15 creating 'local'
22 creating 'local'
16
23
17 $ hg init local
24 $ hg init local
18 $ checknewrepo local
25 $ checknewrepo local
19 store created
26 store created
20 00changelog.i created
27 00changelog.i created
21 dotencode
28 dotencode
22 fncache
29 fncache
30 generaldelta
23 revlogv1
31 revlogv1
24 store
32 store
25 $ echo this > local/foo
33 $ echo this > local/foo
26 $ hg ci --cwd local -A -m "init"
34 $ hg ci --cwd local -A -m "init"
27 adding foo
35 adding foo
28
36
29 test custom revlog chunk cache sizes
37 test custom revlog chunk cache sizes
30
38
31 $ hg --config format.chunkcachesize=0 log -R local -pv
39 $ hg --config format.chunkcachesize=0 log -R local -pv
32 abort: revlog chunk cache size 0 is not greater than 0!
40 abort: revlog chunk cache size 0 is not greater than 0!
33 [255]
41 [255]
34 $ hg --config format.chunkcachesize=1023 log -R local -pv
42 $ hg --config format.chunkcachesize=1023 log -R local -pv
35 abort: revlog chunk cache size 1023 is not a power of 2!
43 abort: revlog chunk cache size 1023 is not a power of 2!
36 [255]
44 [255]
37 $ hg --config format.chunkcachesize=1024 log -R local -pv
45 $ hg --config format.chunkcachesize=1024 log -R local -pv
38 changeset: 0:08b9e9f63b32
46 changeset: 0:08b9e9f63b32
39 tag: tip
47 tag: tip
40 user: test
48 user: test
41 date: Thu Jan 01 00:00:00 1970 +0000
49 date: Thu Jan 01 00:00:00 1970 +0000
42 files: foo
50 files: foo
43 description:
51 description:
44 init
52 init
45
53
46
54
47 diff -r 000000000000 -r 08b9e9f63b32 foo
55 diff -r 000000000000 -r 08b9e9f63b32 foo
48 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
56 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
49 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
57 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
50 @@ -0,0 +1,1 @@
58 @@ -0,0 +1,1 @@
51 +this
59 +this
52
60
53
61
54 creating repo with format.usestore=false
62 creating repo with format.usestore=false
55
63
56 $ hg --config format.usestore=false init old
64 $ hg --config format.usestore=false init old
57 $ checknewrepo old
65 $ checknewrepo old
66 generaldelta
58 revlogv1
67 revlogv1
59
68
60 creating repo with format.usefncache=false
69 creating repo with format.usefncache=false
61
70
62 $ hg --config format.usefncache=false init old2
71 $ hg --config format.usefncache=false init old2
63 $ checknewrepo old2
72 $ checknewrepo old2
64 store created
73 store created
65 00changelog.i created
74 00changelog.i created
75 generaldelta
66 revlogv1
76 revlogv1
67 store
77 store
68
78
69 creating repo with format.dotencode=false
79 creating repo with format.dotencode=false
70
80
71 $ hg --config format.dotencode=false init old3
81 $ hg --config format.dotencode=false init old3
72 $ checknewrepo old3
82 $ checknewrepo old3
73 store created
83 store created
74 00changelog.i created
84 00changelog.i created
75 fncache
85 fncache
86 generaldelta
87 revlogv1
88 store
89
90 creating repo with format.dotencode=false
91
92 $ hg --config format.generaldelta=false --config format.usegeneraldelta=false init old4
93 $ checknewrepo old4
94 store created
95 00changelog.i created
96 dotencode
97 fncache
76 revlogv1
98 revlogv1
77 store
99 store
78
100
79 test failure
101 test failure
80
102
81 $ hg init local
103 $ hg init local
82 abort: repository local already exists!
104 abort: repository local already exists!
83 [255]
105 [255]
84
106
85 init+push to remote2
107 init+push to remote2
86
108
87 $ hg init -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote2
109 $ hg init -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote2
88 $ hg incoming -R remote2 local
110 $ hg incoming -R remote2 local
89 comparing with local
111 comparing with local
90 changeset: 0:08b9e9f63b32
112 changeset: 0:08b9e9f63b32
91 tag: tip
113 tag: tip
92 user: test
114 user: test
93 date: Thu Jan 01 00:00:00 1970 +0000
115 date: Thu Jan 01 00:00:00 1970 +0000
94 summary: init
116 summary: init
95
117
96
118
97 $ hg push -R local -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote2
119 $ hg push -R local -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote2
98 pushing to ssh://user@dummy/remote2
120 pushing to ssh://user@dummy/remote2
99 searching for changes
121 searching for changes
100 remote: adding changesets
122 remote: adding changesets
101 remote: adding manifests
123 remote: adding manifests
102 remote: adding file changes
124 remote: adding file changes
103 remote: added 1 changesets with 1 changes to 1 files
125 remote: added 1 changesets with 1 changes to 1 files
104
126
105 clone to remote1
127 clone to remote1
106
128
107 $ hg clone -e "python \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote1
129 $ hg clone -e "python \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote1
108 searching for changes
130 searching for changes
109 remote: adding changesets
131 remote: adding changesets
110 remote: adding manifests
132 remote: adding manifests
111 remote: adding file changes
133 remote: adding file changes
112 remote: added 1 changesets with 1 changes to 1 files
134 remote: added 1 changesets with 1 changes to 1 files
113
135
114 The largefiles extension doesn't crash
136 The largefiles extension doesn't crash
115 $ hg clone -e "python \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remotelf --config extensions.largefiles=
137 $ hg clone -e "python \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remotelf --config extensions.largefiles=
116 searching for changes
138 searching for changes
117 remote: adding changesets
139 remote: adding changesets
118 remote: adding manifests
140 remote: adding manifests
119 remote: adding file changes
141 remote: adding file changes
120 remote: added 1 changesets with 1 changes to 1 files
142 remote: added 1 changesets with 1 changes to 1 files
121
143
122 init to existing repo
144 init to existing repo
123
145
124 $ hg init -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote1
146 $ hg init -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote1
125 abort: repository remote1 already exists!
147 abort: repository remote1 already exists!
126 abort: could not create remote repo!
148 abort: could not create remote repo!
127 [255]
149 [255]
128
150
129 clone to existing repo
151 clone to existing repo
130
152
131 $ hg clone -e "python \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote1
153 $ hg clone -e "python \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote1
132 abort: repository remote1 already exists!
154 abort: repository remote1 already exists!
133 abort: could not create remote repo!
155 abort: could not create remote repo!
134 [255]
156 [255]
135
157
136 output of dummyssh
158 output of dummyssh
137
159
138 $ cat dummylog
160 $ cat dummylog
139 Got arguments 1:user@dummy 2:hg init remote2
161 Got arguments 1:user@dummy 2:hg init remote2
140 Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio
162 Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio
141 Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio
163 Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio
142 Got arguments 1:user@dummy 2:hg init remote1
164 Got arguments 1:user@dummy 2:hg init remote1
143 Got arguments 1:user@dummy 2:hg -R remote1 serve --stdio
165 Got arguments 1:user@dummy 2:hg -R remote1 serve --stdio
144 Got arguments 1:user@dummy 2:hg init remotelf
166 Got arguments 1:user@dummy 2:hg init remotelf
145 Got arguments 1:user@dummy 2:hg -R remotelf serve --stdio
167 Got arguments 1:user@dummy 2:hg -R remotelf serve --stdio
146 Got arguments 1:user@dummy 2:hg init remote1
168 Got arguments 1:user@dummy 2:hg init remote1
147 Got arguments 1:user@dummy 2:hg init remote1
169 Got arguments 1:user@dummy 2:hg init remote1
148
170
149 comparing repositories
171 comparing repositories
150
172
151 $ hg tip -q -R local
173 $ hg tip -q -R local
152 0:08b9e9f63b32
174 0:08b9e9f63b32
153 $ hg tip -q -R remote1
175 $ hg tip -q -R remote1
154 0:08b9e9f63b32
176 0:08b9e9f63b32
155 $ hg tip -q -R remote2
177 $ hg tip -q -R remote2
156 0:08b9e9f63b32
178 0:08b9e9f63b32
157
179
158 check names for repositories (clashes with URL schemes, special chars)
180 check names for repositories (clashes with URL schemes, special chars)
159
181
160 $ for i in bundle file hg http https old-http ssh static-http "with space"; do
182 $ for i in bundle file hg http https old-http ssh static-http "with space"; do
161 > printf "hg init \"$i\"... "
183 > printf "hg init \"$i\"... "
162 > hg init "$i"
184 > hg init "$i"
163 > test -d "$i" -a -d "$i/.hg" && echo "ok" || echo "failed"
185 > test -d "$i" -a -d "$i/.hg" && echo "ok" || echo "failed"
164 > done
186 > done
165 hg init "bundle"... ok
187 hg init "bundle"... ok
166 hg init "file"... ok
188 hg init "file"... ok
167 hg init "hg"... ok
189 hg init "hg"... ok
168 hg init "http"... ok
190 hg init "http"... ok
169 hg init "https"... ok
191 hg init "https"... ok
170 hg init "old-http"... ok
192 hg init "old-http"... ok
171 hg init "ssh"... ok
193 hg init "ssh"... ok
172 hg init "static-http"... ok
194 hg init "static-http"... ok
173 hg init "with space"... ok
195 hg init "with space"... ok
174 #if eol-in-paths
196 #if eol-in-paths
175 /* " " is not a valid name for a directory on Windows */
197 /* " " is not a valid name for a directory on Windows */
176 $ hg init " "
198 $ hg init " "
177 $ test -d " "
199 $ test -d " "
178 $ test -d " /.hg"
200 $ test -d " /.hg"
179 #endif
201 #endif
180
202
181 creating 'local/sub/repo'
203 creating 'local/sub/repo'
182
204
183 $ hg init local/sub/repo
205 $ hg init local/sub/repo
184 $ checknewrepo local/sub/repo
206 $ checknewrepo local/sub/repo
185 store created
207 store created
186 00changelog.i created
208 00changelog.i created
187 dotencode
209 dotencode
188 fncache
210 fncache
211 generaldelta
189 revlogv1
212 revlogv1
190 store
213 store
191
214
192 prepare test of init of url configured from paths
215 prepare test of init of url configured from paths
193
216
194 $ echo '[paths]' >> $HGRCPATH
217 $ echo '[paths]' >> $HGRCPATH
195 $ echo "somewhere = `pwd`/url from paths" >> $HGRCPATH
218 $ echo "somewhere = `pwd`/url from paths" >> $HGRCPATH
196 $ echo "elsewhere = `pwd`/another paths url" >> $HGRCPATH
219 $ echo "elsewhere = `pwd`/another paths url" >> $HGRCPATH
197
220
198 init should (for consistency with clone) expand the url
221 init should (for consistency with clone) expand the url
199
222
200 $ hg init somewhere
223 $ hg init somewhere
201 $ checknewrepo "url from paths"
224 $ checknewrepo "url from paths"
202 store created
225 store created
203 00changelog.i created
226 00changelog.i created
204 dotencode
227 dotencode
205 fncache
228 fncache
229 generaldelta
206 revlogv1
230 revlogv1
207 store
231 store
208
232
209 verify that clone also expand urls
233 verify that clone also expand urls
210
234
211 $ hg clone somewhere elsewhere
235 $ hg clone somewhere elsewhere
212 updating to branch default
236 updating to branch default
213 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
237 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
214 $ checknewrepo "another paths url"
238 $ checknewrepo "another paths url"
215 store created
239 store created
216 00changelog.i created
240 00changelog.i created
217 dotencode
241 dotencode
218 fncache
242 fncache
243 generaldelta
219 revlogv1
244 revlogv1
220 store
245 store
221
246
222 clone bookmarks
247 clone bookmarks
223
248
224 $ hg -R local bookmark test
249 $ hg -R local bookmark test
225 $ hg -R local bookmarks
250 $ hg -R local bookmarks
226 * test 0:08b9e9f63b32
251 * test 0:08b9e9f63b32
227 $ hg clone -e "python \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote-bookmarks
252 $ hg clone -e "python \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote-bookmarks
228 searching for changes
253 searching for changes
229 remote: adding changesets
254 remote: adding changesets
230 remote: adding manifests
255 remote: adding manifests
231 remote: adding file changes
256 remote: adding file changes
232 remote: added 1 changesets with 1 changes to 1 files
257 remote: added 1 changesets with 1 changes to 1 files
233 exporting bookmark test
258 exporting bookmark test
234 $ hg -R remote-bookmarks bookmarks
259 $ hg -R remote-bookmarks bookmarks
235 test 0:08b9e9f63b32
260 test 0:08b9e9f63b32
General Comments 0
You need to be logged in to leave comments. Login now