##// END OF EJS Templates
test-static-http.t: get kill actually working...
Adrian Buehlmann -
r13208:b6693876 default
parent child Browse files
Show More
@@ -1,154 +1,154 b''
1
1
2 $ cp "$TESTDIR"/printenv.py .
2 $ cp "$TESTDIR"/printenv.py .
3 $ hg clone http://localhost:$HGPORT/ copy
3 $ hg clone http://localhost:$HGPORT/ copy
4 abort: error: Connection refused
4 abort: error: Connection refused
5 [255]
5 [255]
6 $ test -d copy
6 $ test -d copy
7 [1]
7 [1]
8
8
9 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
10 one pull
10 one pull
11
11
12 $ cat > dumb.py <<EOF
12 $ cat > dumb.py <<EOF
13 > import BaseHTTPServer, SimpleHTTPServer, os, signal
13 > import BaseHTTPServer, SimpleHTTPServer, os, signal, sys
14 >
14 >
15 > def run(server_class=BaseHTTPServer.HTTPServer,
15 > def run(server_class=BaseHTTPServer.HTTPServer,
16 > handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler):
16 > handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler):
17 > server_address = ('localhost', int(os.environ['HGPORT']))
17 > server_address = ('localhost', int(os.environ['HGPORT']))
18 > httpd = server_class(server_address, handler_class)
18 > httpd = server_class(server_address, handler_class)
19 > httpd.serve_forever()
19 > httpd.serve_forever()
20 >
20 >
21 > signal.signal(signal.SIGTERM, lambda x: sys.exit(0))
21 > signal.signal(signal.SIGTERM, lambda x, y: sys.exit(0))
22 > run()
22 > run()
23 > EOF
23 > EOF
24 $ python dumb.py 2>/dev/null &
24 $ python dumb.py 2>/dev/null &
25 $ echo $! >> $DAEMON_PIDS
25 $ echo $! >> $DAEMON_PIDS
26 $ mkdir remote
26 $ mkdir remote
27 $ cd remote
27 $ cd remote
28 $ hg init
28 $ hg init
29 $ echo foo > bar
29 $ echo foo > bar
30 $ hg add bar
30 $ hg add bar
31 $ hg commit -m"test"
31 $ hg commit -m"test"
32 $ hg tip
32 $ hg tip
33 changeset: 0:61c9426e69fe
33 changeset: 0:61c9426e69fe
34 tag: tip
34 tag: tip
35 user: test
35 user: test
36 date: Thu Jan 01 00:00:00 1970 +0000
36 date: Thu Jan 01 00:00:00 1970 +0000
37 summary: test
37 summary: test
38
38
39 $ cd ..
39 $ cd ..
40 $ hg clone static-http://localhost:$HGPORT/remote local
40 $ hg clone static-http://localhost:$HGPORT/remote local
41 requesting all changes
41 requesting all changes
42 adding changesets
42 adding changesets
43 adding manifests
43 adding manifests
44 adding file changes
44 adding file changes
45 added 1 changesets with 1 changes to 1 files
45 added 1 changesets with 1 changes to 1 files
46 updating to branch default
46 updating to branch default
47 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
47 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
48 $ cd local
48 $ cd local
49 $ hg verify
49 $ hg verify
50 checking changesets
50 checking changesets
51 checking manifests
51 checking manifests
52 crosschecking files in changesets and manifests
52 crosschecking files in changesets and manifests
53 checking files
53 checking files
54 1 files, 1 changesets, 1 total revisions
54 1 files, 1 changesets, 1 total revisions
55 $ cat bar
55 $ cat bar
56 foo
56 foo
57 $ cd ../remote
57 $ cd ../remote
58 $ echo baz > quux
58 $ echo baz > quux
59 $ hg commit -A -mtest2
59 $ hg commit -A -mtest2
60 adding quux
60 adding quux
61
61
62 check for HTTP opener failures when cachefile does not exist
62 check for HTTP opener failures when cachefile does not exist
63
63
64 $ rm .hg/*.cache
64 $ rm .hg/*.cache
65 $ cd ../local
65 $ cd ../local
66 $ echo '[hooks]' >> .hg/hgrc
66 $ echo '[hooks]' >> .hg/hgrc
67 $ echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc
67 $ echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc
68 $ hg pull
68 $ hg pull
69 changegroup hook: HG_NODE=822d6e31f08b9d6e3b898ce5e52efc0a4bf4905a HG_SOURCE=pull HG_URL=http://localhost:$HGPORT/remote
69 changegroup hook: HG_NODE=822d6e31f08b9d6e3b898ce5e52efc0a4bf4905a HG_SOURCE=pull HG_URL=http://localhost:$HGPORT/remote
70 pulling from static-http://localhost:$HGPORT/remote
70 pulling from static-http://localhost:$HGPORT/remote
71 searching for changes
71 searching for changes
72 adding changesets
72 adding changesets
73 adding manifests
73 adding manifests
74 adding file changes
74 adding file changes
75 added 1 changesets with 1 changes to 1 files
75 added 1 changesets with 1 changes to 1 files
76 (run 'hg update' to get a working copy)
76 (run 'hg update' to get a working copy)
77
77
78 trying to push
78 trying to push
79
79
80 $ hg update
80 $ hg update
81 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
81 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
82 $ echo more foo >> bar
82 $ echo more foo >> bar
83 $ hg commit -m"test"
83 $ hg commit -m"test"
84 $ hg push
84 $ hg push
85 pushing to static-http://localhost:$HGPORT/remote
85 pushing to static-http://localhost:$HGPORT/remote
86 abort: cannot lock static-http repository
86 abort: cannot lock static-http repository
87 [255]
87 [255]
88
88
89 trying clone -r
89 trying clone -r
90
90
91 $ cd ..
91 $ cd ..
92 $ hg clone -r donotexist static-http://localhost:$HGPORT/remote local0
92 $ hg clone -r donotexist static-http://localhost:$HGPORT/remote local0
93 abort: unknown revision 'donotexist'!
93 abort: unknown revision 'donotexist'!
94 [255]
94 [255]
95 $ hg clone -r 0 static-http://localhost:$HGPORT/remote local0
95 $ hg clone -r 0 static-http://localhost:$HGPORT/remote local0
96 adding changesets
96 adding changesets
97 adding manifests
97 adding manifests
98 adding file changes
98 adding file changes
99 added 1 changesets with 1 changes to 1 files
99 added 1 changesets with 1 changes to 1 files
100 updating to branch default
100 updating to branch default
101 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
101 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
102
102
103 test with "/" URI (issue 747)
103 test with "/" URI (issue 747)
104
104
105 $ hg init
105 $ hg init
106 $ echo a > a
106 $ echo a > a
107 $ hg add a
107 $ hg add a
108 $ hg ci -ma
108 $ hg ci -ma
109 $ hg clone static-http://localhost:$HGPORT/ local2
109 $ hg clone static-http://localhost:$HGPORT/ local2
110 requesting all changes
110 requesting all changes
111 adding changesets
111 adding changesets
112 adding manifests
112 adding manifests
113 adding file changes
113 adding file changes
114 added 1 changesets with 1 changes to 1 files
114 added 1 changesets with 1 changes to 1 files
115 updating to branch default
115 updating to branch default
116 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
116 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
117 $ cd local2
117 $ cd local2
118 $ hg verify
118 $ hg verify
119 checking changesets
119 checking changesets
120 checking manifests
120 checking manifests
121 crosschecking files in changesets and manifests
121 crosschecking files in changesets and manifests
122 checking files
122 checking files
123 1 files, 1 changesets, 1 total revisions
123 1 files, 1 changesets, 1 total revisions
124 $ cat a
124 $ cat a
125 a
125 a
126 $ hg paths
126 $ hg paths
127 default = static-http://localhost:$HGPORT/
127 default = static-http://localhost:$HGPORT/
128
128
129 test with empty repo (issue965)
129 test with empty repo (issue965)
130
130
131 $ cd ..
131 $ cd ..
132 $ hg init remotempty
132 $ hg init remotempty
133 $ hg clone static-http://localhost:$HGPORT/remotempty local3
133 $ hg clone static-http://localhost:$HGPORT/remotempty local3
134 no changes found
134 no changes found
135 updating to branch default
135 updating to branch default
136 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
136 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
137 $ cd local3
137 $ cd local3
138 $ hg verify
138 $ hg verify
139 checking changesets
139 checking changesets
140 checking manifests
140 checking manifests
141 crosschecking files in changesets and manifests
141 crosschecking files in changesets and manifests
142 checking files
142 checking files
143 0 files, 0 changesets, 0 total revisions
143 0 files, 0 changesets, 0 total revisions
144 $ hg paths
144 $ hg paths
145 default = static-http://localhost:$HGPORT/remotempty
145 default = static-http://localhost:$HGPORT/remotempty
146
146
147 test with non-repo
147 test with non-repo
148
148
149 $ cd ..
149 $ cd ..
150 $ mkdir notarepo
150 $ mkdir notarepo
151 $ hg clone static-http://localhost:$HGPORT/notarepo local3
151 $ hg clone static-http://localhost:$HGPORT/notarepo local3
152 abort: 'http://localhost:$HGPORT/notarepo' does not appear to be an hg repository!
152 abort: 'http://localhost:$HGPORT/notarepo' does not appear to be an hg repository!
153 [255]
153 [255]
154 $ kill $!
154 $ kill $!
General Comments 0
You need to be logged in to leave comments. Login now