##// END OF EJS Templates
test-static-http.t: enable on Windows...
Patrick Mezard -
r17538:31ca918d default
parent child Browse files
Show More
@@ -1,174 +1,191 b''
1 $ "$TESTDIR/hghave" serve || exit 80
1 $ "$TESTDIR/hghave" killdaemons || exit 80
2
2
3 #if windows
3 #if windows
4 $ hg clone http://localhost:$HGPORT/ copy
4 $ hg clone http://localhost:$HGPORT/ copy
5 abort: * (glob)
5 abort: * (glob)
6 [255]
6 [255]
7 #else
7 #else
8 $ hg clone http://localhost:$HGPORT/ copy
8 $ hg clone http://localhost:$HGPORT/ copy
9 abort: error: Connection refused
9 abort: error: Connection refused
10 [255]
10 [255]
11 #endif
11 #endif
12 $ test -d copy
12 $ test -d copy
13 [1]
13 [1]
14
14
15 This server doesn't do range requests so it's basically only good for
15 This server doesn't do range requests so it's basically only good for
16 one pull
16 one pull
17
17
18 $ cat > dumb.py <<EOF
18 $ cat > dumb.py <<EOF
19 > import BaseHTTPServer, SimpleHTTPServer, os, signal, sys
19 > import BaseHTTPServer, SimpleHTTPServer, os, signal, sys
20 >
20 >
21 > def run(server_class=BaseHTTPServer.HTTPServer,
21 > def run(server_class=BaseHTTPServer.HTTPServer,
22 > handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler):
22 > handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler):
23 > server_address = ('localhost', int(os.environ['HGPORT']))
23 > server_address = ('localhost', int(os.environ['HGPORT']))
24 > httpd = server_class(server_address, handler_class)
24 > httpd = server_class(server_address, handler_class)
25 > httpd.serve_forever()
25 > httpd.serve_forever()
26 >
26 >
27 > signal.signal(signal.SIGTERM, lambda x, y: sys.exit(0))
27 > signal.signal(signal.SIGTERM, lambda x, y: sys.exit(0))
28 > fp = file('dumb.pid', 'wb')
29 > fp.write(str(os.getpid()) + '\n')
30 > fp.close()
28 > run()
31 > run()
29 > EOF
32 > EOF
30 $ python dumb.py 2>/dev/null &
33 $ python dumb.py 2>/dev/null &
31 $ echo $! >> $DAEMON_PIDS
34
35 Cannot just read $!, it will not be set to the right value on Windows/MinGW
36
37 $ cat > wait.py <<EOF
38 > import time
39 > while True:
40 > try:
41 > if '\n' in file('dumb.pid', 'rb').read():
42 > break
43 > except IOError:
44 > pass
45 > time.sleep(0.2)
46 > EOF
47 $ python wait.py
48 $ cat dumb.pid >> $DAEMON_PIDS
32 $ hg init remote
49 $ hg init remote
33 $ cd remote
50 $ cd remote
34 $ echo foo > bar
51 $ echo foo > bar
35 $ echo c2 > '.dotfile with spaces'
52 $ echo c2 > '.dotfile with spaces'
36 $ hg add
53 $ hg add
37 adding .dotfile with spaces
54 adding .dotfile with spaces
38 adding bar
55 adding bar
39 $ hg commit -m"test"
56 $ hg commit -m"test"
40 $ hg tip
57 $ hg tip
41 changeset: 0:02770d679fb8
58 changeset: 0:02770d679fb8
42 tag: tip
59 tag: tip
43 user: test
60 user: test
44 date: Thu Jan 01 00:00:00 1970 +0000
61 date: Thu Jan 01 00:00:00 1970 +0000
45 summary: test
62 summary: test
46
63
47 $ cd ..
64 $ cd ..
48 $ hg clone static-http://localhost:$HGPORT/remote local
65 $ hg clone static-http://localhost:$HGPORT/remote local
49 requesting all changes
66 requesting all changes
50 adding changesets
67 adding changesets
51 adding manifests
68 adding manifests
52 adding file changes
69 adding file changes
53 added 1 changesets with 2 changes to 2 files
70 added 1 changesets with 2 changes to 2 files
54 updating to branch default
71 updating to branch default
55 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
72 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
56 $ cd local
73 $ cd local
57 $ hg verify
74 $ hg verify
58 checking changesets
75 checking changesets
59 checking manifests
76 checking manifests
60 crosschecking files in changesets and manifests
77 crosschecking files in changesets and manifests
61 checking files
78 checking files
62 2 files, 1 changesets, 2 total revisions
79 2 files, 1 changesets, 2 total revisions
63 $ cat bar
80 $ cat bar
64 foo
81 foo
65 $ cd ../remote
82 $ cd ../remote
66 $ echo baz > quux
83 $ echo baz > quux
67 $ hg commit -A -mtest2
84 $ hg commit -A -mtest2
68 adding quux
85 adding quux
69
86
70 check for HTTP opener failures when cachefile does not exist
87 check for HTTP opener failures when cachefile does not exist
71
88
72 $ rm .hg/cache/*
89 $ rm .hg/cache/*
73 $ cd ../local
90 $ cd ../local
74 $ echo '[hooks]' >> .hg/hgrc
91 $ echo '[hooks]' >> .hg/hgrc
75 $ echo "changegroup = python \"$TESTDIR/printenv.py\" changegroup" >> .hg/hgrc
92 $ echo "changegroup = python \"$TESTDIR/printenv.py\" changegroup" >> .hg/hgrc
76 $ hg pull
93 $ hg pull
77 pulling from static-http://localhost:$HGPORT/remote
94 pulling from static-http://localhost:$HGPORT/remote
78 searching for changes
95 searching for changes
79 adding changesets
96 adding changesets
80 adding manifests
97 adding manifests
81 adding file changes
98 adding file changes
82 added 1 changesets with 1 changes to 1 files
99 added 1 changesets with 1 changes to 1 files
83 changegroup hook: HG_NODE=4ac2e3648604439c580c69b09ec9d93a88d93432 HG_SOURCE=pull HG_URL=http://localhost:$HGPORT/remote
100 changegroup hook: HG_NODE=4ac2e3648604439c580c69b09ec9d93a88d93432 HG_SOURCE=pull HG_URL=http://localhost:$HGPORT/remote
84 (run 'hg update' to get a working copy)
101 (run 'hg update' to get a working copy)
85
102
86 trying to push
103 trying to push
87
104
88 $ hg update
105 $ hg update
89 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
106 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
90 $ echo more foo >> bar
107 $ echo more foo >> bar
91 $ hg commit -m"test"
108 $ hg commit -m"test"
92 $ hg push
109 $ hg push
93 pushing to static-http://localhost:$HGPORT/remote
110 pushing to static-http://localhost:$HGPORT/remote
94 abort: destination does not support push
111 abort: destination does not support push
95 [255]
112 [255]
96
113
97 trying clone -r
114 trying clone -r
98
115
99 $ cd ..
116 $ cd ..
100 $ hg clone -r doesnotexist static-http://localhost:$HGPORT/remote local0
117 $ hg clone -r doesnotexist static-http://localhost:$HGPORT/remote local0
101 abort: unknown revision 'doesnotexist'!
118 abort: unknown revision 'doesnotexist'!
102 [255]
119 [255]
103 $ hg clone -r 0 static-http://localhost:$HGPORT/remote local0
120 $ hg clone -r 0 static-http://localhost:$HGPORT/remote local0
104 adding changesets
121 adding changesets
105 adding manifests
122 adding manifests
106 adding file changes
123 adding file changes
107 added 1 changesets with 2 changes to 2 files
124 added 1 changesets with 2 changes to 2 files
108 updating to branch default
125 updating to branch default
109 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
126 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
110
127
111 test with "/" URI (issue 747) and subrepo
128 test with "/" URI (issue 747) and subrepo
112
129
113 $ hg init
130 $ hg init
114 $ hg init sub
131 $ hg init sub
115 $ touch sub/test
132 $ touch sub/test
116 $ hg -R sub commit -A -m "test"
133 $ hg -R sub commit -A -m "test"
117 adding test
134 adding test
118 $ hg -R sub tag not-empty
135 $ hg -R sub tag not-empty
119 $ echo sub=sub > .hgsub
136 $ echo sub=sub > .hgsub
120 $ echo a > a
137 $ echo a > a
121 $ hg add a .hgsub
138 $ hg add a .hgsub
122 $ hg -q ci -ma
139 $ hg -q ci -ma
123 $ hg clone static-http://localhost:$HGPORT/ local2
140 $ hg clone static-http://localhost:$HGPORT/ local2
124 requesting all changes
141 requesting all changes
125 adding changesets
142 adding changesets
126 adding manifests
143 adding manifests
127 adding file changes
144 adding file changes
128 added 1 changesets with 3 changes to 3 files
145 added 1 changesets with 3 changes to 3 files
129 updating to branch default
146 updating to branch default
130 cloning subrepo sub from static-http://localhost:$HGPORT/sub
147 cloning subrepo sub from static-http://localhost:$HGPORT/sub
131 requesting all changes
148 requesting all changes
132 adding changesets
149 adding changesets
133 adding manifests
150 adding manifests
134 adding file changes
151 adding file changes
135 added 2 changesets with 2 changes to 2 files
152 added 2 changesets with 2 changes to 2 files
136 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
153 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
137 $ cd local2
154 $ cd local2
138 $ hg verify
155 $ hg verify
139 checking changesets
156 checking changesets
140 checking manifests
157 checking manifests
141 crosschecking files in changesets and manifests
158 crosschecking files in changesets and manifests
142 checking files
159 checking files
143 3 files, 1 changesets, 3 total revisions
160 3 files, 1 changesets, 3 total revisions
144 $ cat a
161 $ cat a
145 a
162 a
146 $ hg paths
163 $ hg paths
147 default = static-http://localhost:$HGPORT/
164 default = static-http://localhost:$HGPORT/
148
165
149 test with empty repo (issue965)
166 test with empty repo (issue965)
150
167
151 $ cd ..
168 $ cd ..
152 $ hg init remotempty
169 $ hg init remotempty
153 $ hg clone static-http://localhost:$HGPORT/remotempty local3
170 $ hg clone static-http://localhost:$HGPORT/remotempty local3
154 no changes found
171 no changes found
155 updating to branch default
172 updating to branch default
156 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
173 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
157 $ cd local3
174 $ cd local3
158 $ hg verify
175 $ hg verify
159 checking changesets
176 checking changesets
160 checking manifests
177 checking manifests
161 crosschecking files in changesets and manifests
178 crosschecking files in changesets and manifests
162 checking files
179 checking files
163 0 files, 0 changesets, 0 total revisions
180 0 files, 0 changesets, 0 total revisions
164 $ hg paths
181 $ hg paths
165 default = static-http://localhost:$HGPORT/remotempty
182 default = static-http://localhost:$HGPORT/remotempty
166
183
167 test with non-repo
184 test with non-repo
168
185
169 $ cd ..
186 $ cd ..
170 $ mkdir notarepo
187 $ mkdir notarepo
171 $ hg clone static-http://localhost:$HGPORT/notarepo local3
188 $ hg clone static-http://localhost:$HGPORT/notarepo local3
172 abort: 'http://localhost:$HGPORT/notarepo' does not appear to be an hg repository!
189 abort: 'http://localhost:$HGPORT/notarepo' does not appear to be an hg repository!
173 [255]
190 [255]
174 $ kill $!
191 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
General Comments 0
You need to be logged in to leave comments. Login now