##// END OF EJS Templates
test-static-http: use printenv.py
Alexis S. L. Carvalho -
r4290:347766c2 default
parent child Browse files
Show More
@@ -1,50 +1,52
1 #!/bin/sh
1 #!/bin/sh
2
2
3 cp "$TESTDIR"/printenv.py .
4
3 http_proxy= hg clone static-http://localhost:20059/ copy
5 http_proxy= hg clone static-http://localhost:20059/ copy
4 echo $?
6 echo $?
5 test -d copy || echo copy: No such file or directory
7 test -d copy || echo copy: No such file or directory
6
8
7 # This server doesn't do range requests so it's basically only good for
9 # This server doesn't do range requests so it's basically only good for
8 # one pull
10 # one pull
9 cat > dumb.py <<EOF
11 cat > dumb.py <<EOF
10 import BaseHTTPServer, SimpleHTTPServer, signal
12 import BaseHTTPServer, SimpleHTTPServer, signal
11
13
12 def run(server_class=BaseHTTPServer.HTTPServer,
14 def run(server_class=BaseHTTPServer.HTTPServer,
13 handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler):
15 handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler):
14 server_address = ('localhost', 20059)
16 server_address = ('localhost', 20059)
15 httpd = server_class(server_address, handler_class)
17 httpd = server_class(server_address, handler_class)
16 httpd.serve_forever()
18 httpd.serve_forever()
17
19
18 signal.signal(signal.SIGTERM, lambda x: sys.exit(0))
20 signal.signal(signal.SIGTERM, lambda x: sys.exit(0))
19 run()
21 run()
20 EOF
22 EOF
21
23
22 python dumb.py 2>/dev/null &
24 python dumb.py 2>/dev/null &
23 echo $! >> $DAEMON_PIDS
25 echo $! >> $DAEMON_PIDS
24
26
25 mkdir remote
27 mkdir remote
26 cd remote
28 cd remote
27 hg init
29 hg init
28 echo foo > bar
30 echo foo > bar
29 hg add bar
31 hg add bar
30 hg commit -m"test" -d "1000000 0"
32 hg commit -m"test" -d "1000000 0"
31 hg tip
33 hg tip
32
34
33 cd ..
35 cd ..
34
36
35 http_proxy= hg clone static-http://localhost:20059/remote local
37 http_proxy= hg clone static-http://localhost:20059/remote local
36
38
37 cd local
39 cd local
38 hg verify
40 hg verify
39 cat bar
41 cat bar
40
42
41 cd ../remote
43 cd ../remote
42 echo baz > quux
44 echo baz > quux
43 hg commit -A -mtest2 -d '100000000 0'
45 hg commit -A -mtest2 -d '100000000 0'
44
46
45 cd ../local
47 cd ../local
46 echo '[hooks]' >> .hg/hgrc
48 echo '[hooks]' >> .hg/hgrc
47 echo 'changegroup = echo changegroup: u=$HG_URL' >> .hg/hgrc
49 echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc
48 http_proxy= hg pull
50 http_proxy= hg pull
49
51
50 kill $!
52 kill $!
@@ -1,30 +1,30
1 abort: Connection refused
1 abort: Connection refused
2 255
2 255
3 copy: No such file or directory
3 copy: No such file or directory
4 changeset: 0:53e17d176ae6
4 changeset: 0:53e17d176ae6
5 tag: tip
5 tag: tip
6 user: test
6 user: test
7 date: Mon Jan 12 13:46:40 1970 +0000
7 date: Mon Jan 12 13:46:40 1970 +0000
8 summary: test
8 summary: test
9
9
10 requesting all changes
10 requesting all changes
11 adding changesets
11 adding changesets
12 adding manifests
12 adding manifests
13 adding file changes
13 adding file changes
14 added 1 changesets with 1 changes to 1 files
14 added 1 changesets with 1 changes to 1 files
15 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
15 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
16 checking changesets
16 checking changesets
17 checking manifests
17 checking manifests
18 crosschecking files in changesets and manifests
18 crosschecking files in changesets and manifests
19 checking files
19 checking files
20 1 files, 1 changesets, 1 total revisions
20 1 files, 1 changesets, 1 total revisions
21 foo
21 foo
22 adding quux
22 adding quux
23 changegroup: u=static-http://localhost:20059/remote
23 changegroup hook: HG_NODE=34401e0e9971e9720b613d9089ffa9a6eefb3d2d HG_SOURCE=pull HG_URL=static-http://localhost:20059/remote
24 pulling from static-http://localhost:20059/remote
24 pulling from static-http://localhost:20059/remote
25 searching for changes
25 searching for changes
26 adding changesets
26 adding changesets
27 adding manifests
27 adding manifests
28 adding file changes
28 adding file changes
29 added 1 changesets with 1 changes to 1 files
29 added 1 changesets with 1 changes to 1 files
30 (run 'hg update' to get a working copy)
30 (run 'hg update' to get a working copy)
General Comments 0
You need to be logged in to leave comments. Login now