Debian Codegraph @

tests/test-static-http.t

raw
1 $ hg clone http://localhost:$HGPORT/ copy
2 abort: * (glob)
3 [100]
4 $ test -d copy
5 [1]
6
7 This server doesn't do range requests so it's basically only good for
8 one pull
9
10 $ "$PYTHON" "$TESTDIR/dumbhttp.py" -p $HGPORT --pid dumb.pid \
11 > --logfile server.log
12 $ cat dumb.pid >> $DAEMON_PIDS
13 $ hg init remote
14 $ cd remote
15 $ echo foo > bar
16 $ echo c2 > '.dotfile with spaces'
17 $ hg add
18 adding .dotfile with spaces
19 adding bar
20 $ hg commit -m"test"
21 $ hg tip
22 changeset: 0:02770d679fb8
23 tag: tip
24 user: test
25 date: Thu Jan 01 00:00:00 1970 +0000
26 summary: test
27
28 $ cd ..
29 $ hg clone static-http://localhost:$HGPORT/remote local
30 requesting all changes
31 adding changesets
32 adding manifests
33 adding file changes
34 added 1 changesets with 2 changes to 2 files
35 new changesets 02770d679fb8
36 updating to branch default
37 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
38
39 $ cat server.log
40 $LOCALIP - - [$LOGDATE$] "GET /remote/.hg/requires HTTP/1.1" 200 - (glob)
41 $LOCALIP - - [$LOGDATE$] "GET /remote/.hg/store/requires HTTP/1.1" 200 - (glob)
42 $LOCALIP - - [$LOGDATE$] "GET /remote/.hg/store/00manifest.i HTTP/1.1" 200 - (glob)
43 $LOCALIP - - [$LOGDATE$] "GET /remote/.hg/store/00changelog.i HTTP/1.1" 200 - (glob)
44 $LOCALIP - - [$LOGDATE$] "GET /remote/.hg/dirstate HTTP/1.1" 200 - (glob)
45 $LOCALIP - - [$LOGDATE$] "GET /remote/.hg/store/00changelog.i HTTP/1.1" 200 - (glob)
46 $LOCALIP - - [*] code 404, message File not found (glob)
47 $LOCALIP - - [$LOGDATE$] "GET /remote/.hg/bookmarks HTTP/1.1" 404 - (glob)
48 $LOCALIP - - [*] code 404, message File not found (glob)
49 $LOCALIP - - [$LOGDATE$] "GET /remote/.hg/bookmarks.current HTTP/1.1" 404 - (glob)
50 $LOCALIP - - [*] code 404, message File not found (glob)
51 $LOCALIP - - [$LOGDATE$] "GET /remote/.hg/cache/hgtagsfnodes1 HTTP/1.1" 404 - (glob)
52 $LOCALIP - - [$LOGDATE$] "GET /remote/.hg/store/00changelog.d HTTP/1.1" 200 - (glob)
53 $LOCALIP - - [$LOGDATE$] "GET /remote/.hg/store/data/~2edotfile%20with%20spaces.i HTTP/1.1" 200 - (glob)
54 $LOCALIP - - [$LOGDATE$] "GET /remote/.hg/store/data/bar.i HTTP/1.1" 200 - (glob)
55
56 $ cd local
57 $ hg verify -q
58 $ cat bar
59 foo
60 $ cd ../remote
61 $ echo baz > quux
62 $ hg commit -A -mtest2
63 adding quux
64
65 check for HTTP opener failures when cachefile does not exist
66
67 $ rm .hg/cache/*
68 $ cd ../local
69 $ cat >> .hg/hgrc <<EOF
70 > [hooks]
71 > changegroup = sh -c "printenv.py --line changegroup"
72 > EOF
73 $ hg pull
74 pulling from static-http://localhost:$HGPORT/remote
75 searching for changes
76 adding changesets
77 adding manifests
78 adding file changes
79 added 1 changesets with 1 changes to 1 files
80 new changesets 4ac2e3648604
81 changegroup hook: HG_HOOKNAME=changegroup
82 HG_HOOKTYPE=changegroup
83 HG_NODE=4ac2e3648604439c580c69b09ec9d93a88d93432
84 HG_NODE_LAST=4ac2e3648604439c580c69b09ec9d93a88d93432
85 HG_SOURCE=pull
86 HG_TXNID=TXN:$ID$
87 HG_TXNNAME=pull
88 http://localhost:$HGPORT/remote
89 HG_URL=http://localhost:$HGPORT/remote
90
91 (run 'hg update' to get a working copy)
92
93 trying to push
94
95 $ hg update
96 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
97 $ echo more foo >> bar
98 $ hg commit -m"test"
99 $ hg push
100 pushing to static-http://localhost:$HGPORT/remote
101 abort: destination does not support push
102 [255]
103
104 trying clone -r
105
106 $ cd ..
107 $ hg clone -r doesnotexist static-http://localhost:$HGPORT/remote local0
108 abort: unknown revision 'doesnotexist'
109 [10]
110 $ hg clone -r 0 static-http://localhost:$HGPORT/remote local0
111 adding changesets
112 adding manifests
113 adding file changes
114 added 1 changesets with 2 changes to 2 files
115 new changesets 02770d679fb8
116 updating to branch default
117 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
118
119 test with "/" URI (issue747) and subrepo
120
121 $ hg init
122 $ hg init sub
123 $ touch sub/test
124 $ hg -R sub commit -A -m "test"
125 adding test
126 $ hg -R sub tag not-empty
127 $ echo sub=sub > .hgsub
128 $ echo a > a
129 $ hg add a .hgsub
130 $ hg -q ci -ma
131 $ hg clone static-http://localhost:$HGPORT/ local2
132 requesting all changes
133 adding changesets
134 adding manifests
135 adding file changes
136 added 1 changesets with 3 changes to 3 files
137 new changesets a9ebfbe8e587
138 updating to branch default
139 cloning subrepo sub from static-http://localhost:$HGPORT/sub
140 requesting all changes
141 adding changesets
142 adding manifests
143 adding file changes
144 added 2 changesets with 2 changes to 2 files
145 new changesets be090ea66256:322ea90975df
146 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
147 $ cd local2
148 $ hg verify -q
149 $ cat a
150 a
151 $ hg paths
152 default = static-http://localhost:$HGPORT/
153
154 test with empty repo (issue965)
155
156 $ cd ..
157 $ hg init remotempty
158 $ hg clone static-http://localhost:$HGPORT/remotempty local3
159 no changes found
160 updating to branch default
161 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
162 $ cd local3
163 $ hg verify -q
164 $ hg paths
165 default = static-http://localhost:$HGPORT/remotempty
166
167 test autodetecting static-http: scheme (issue6833)
168
169 $ cd ..
170 $ hg init actually-static
171 $ hg clone http://localhost:$HGPORT/actually-static local4
172 no changes found
173 updating to branch default
174 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
175
176 test with non-repo
177
178 $ mkdir notarepo
179 $ hg clone static-http://localhost:$HGPORT/notarepo local3
180 abort: 'http://localhost:$HGPORT/notarepo' does not appear to be an hg repository
181 [255]
182
183 Clone with tags and branches works
184
185 $ hg init remote-with-names
186 $ cd remote-with-names
187 $ echo 0 > foo
188 $ hg -q commit -A -m initial
189 $ echo 1 > foo
190 $ hg commit -m 'commit 1'
191 $ hg -q up 0
192 $ hg branch mybranch
193 marked working directory as branch mybranch
194 (branches are permanent and global, did you want a bookmark?)
195 $ echo 2 > foo
196 $ hg commit -m 'commit 2 (mybranch)'
197 $ hg tag -r 1 'default-tag'
198 $ hg tag -r 2 'branch-tag'
199
200 $ cd ..
201
202 $ hg clone static-http://localhost:$HGPORT/remote-with-names local-with-names
203 requesting all changes
204 adding changesets
205 adding manifests
206 adding file changes
207 added 5 changesets with 5 changes to 2 files (+1 heads)
208 new changesets 68986213bd44:0c325bd2b5a7
209 updating to branch default
210 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
211
212 Clone a specific branch works
213
214 $ hg clone -r mybranch static-http://localhost:$HGPORT/remote-with-names local-with-names-branch
215 adding changesets
216 adding manifests
217 adding file changes
218 added 4 changesets with 4 changes to 2 files
219 new changesets 68986213bd44:0c325bd2b5a7
220 updating to branch mybranch
221 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
222
223 Clone a specific tag works
224
225 $ hg clone -r default-tag static-http://localhost:$HGPORT/remote-with-names local-with-names-tag
226 adding changesets
227 adding manifests
228 adding file changes
229 added 2 changesets with 2 changes to 1 files
230 new changesets 68986213bd44:4ee3fcef1c80
231 updating to branch default
232 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
233
234 $ killdaemons.py
235
236 List of files accessed over HTTP:
237
238 $ cat server.log | sed -n -e 's|.*GET \(/[^ ]*\).*|\1|p' | sort -u
239 /.hg/bookmarks
240 /.hg/bookmarks.current
241 /.hg/cache/hgtagsfnodes1
242 /.hg/dirstate
243 /.hg/requires
244 /.hg/store/00changelog.d
245 /.hg/store/00changelog.i
246 /.hg/store/00manifest.i
247 /.hg/store/data/a.i
248 /.hg/store/data/~2ehgsub.i
249 /.hg/store/data/~2ehgsubstate.i
250 /.hg/store/requires
251 /actually-static/.hg/bookmarks
252 /actually-static/.hg/bookmarks.current
253 /actually-static/.hg/dirstate
254 /actually-static/.hg/requires
255 /actually-static/.hg/store/00changelog.i
256 /actually-static/.hg/store/00manifest.i
257 /actually-static/.hg/store/requires
258 /actually-static/?cmd=capabilities
259 /actually-static?cmd=capabilities
260 /notarepo/.hg/00changelog.i
261 /notarepo/.hg/requires
262 /remote-with-names/.hg/bookmarks
263 /remote-with-names/.hg/bookmarks.current
264 /remote-with-names/.hg/cache/branch2-served
265 /remote-with-names/.hg/cache/hgtagsfnodes1
266 /remote-with-names/.hg/cache/tags2-served
267 /remote-with-names/.hg/dirstate
268 /remote-with-names/.hg/localtags
269 /remote-with-names/.hg/requires
270 /remote-with-names/.hg/store/00changelog.d
271 /remote-with-names/.hg/store/00changelog.i
272 /remote-with-names/.hg/store/00manifest.i
273 /remote-with-names/.hg/store/data/foo.i
274 /remote-with-names/.hg/store/data/~2ehgtags.i
275 /remote-with-names/.hg/store/obsstore
276 /remote-with-names/.hg/store/requires
277 /remote/.hg/bookmarks
278 /remote/.hg/bookmarks.current
279 /remote/.hg/cache/branch2-base
280 /remote/.hg/cache/branch2-immutable
281 /remote/.hg/cache/branch2-served
282 /remote/.hg/cache/hgtagsfnodes1
283 /remote/.hg/cache/rbc-names-v1
284 /remote/.hg/cache/rbc-names-v2
285 /remote/.hg/cache/tags2-served
286 /remote/.hg/dirstate
287 /remote/.hg/localtags
288 /remote/.hg/requires
289 /remote/.hg/store/00changelog.d
290 /remote/.hg/store/00changelog.i
291 /remote/.hg/store/00manifest.i
292 /remote/.hg/store/data/bar.i
293 /remote/.hg/store/data/quux.i
294 /remote/.hg/store/data/~2edotfile%20with%20spaces.i
295 /remote/.hg/store/data/~2ehgtags.i
296 /remote/.hg/store/obsstore
297 /remote/.hg/store/requires
298 /remotempty/.hg/bookmarks
299 /remotempty/.hg/bookmarks.current
300 /remotempty/.hg/dirstate
301 /remotempty/.hg/requires
302 /remotempty/.hg/store/00changelog.i
303 /remotempty/.hg/store/00manifest.i
304 /remotempty/.hg/store/requires
305 /sub/.hg/bookmarks
306 /sub/.hg/bookmarks.current
307 /sub/.hg/cache/hgtagsfnodes1
308 /sub/.hg/dirstate
309 /sub/.hg/requires
310 /sub/.hg/store/00changelog.d
311 /sub/.hg/store/00changelog.i
312 /sub/.hg/store/00manifest.i
313 /sub/.hg/store/data/test.i
314 /sub/.hg/store/data/~2ehgtags.i
315 /sub/.hg/store/requires