##// END OF EJS Templates
stream-requirements: smoother matching in test-http-protocol.t...
marmoute -
r49497:c3239f2e default
parent child Browse files
Show More
@@ -1,663 +1,663 b''
1 #require no-chg
1 #require no-chg
2
2
3 persistent-nodemap is not enabled by default. It is not relevant for this test
3 persistent-nodemap is not enabled by default. It is not relevant for this test
4 so disable it.
4 so disable it.
5
5
6 $ . $TESTDIR/wireprotohelpers.sh
6 $ . $TESTDIR/wireprotohelpers.sh
7
7
8 $ cat >> $HGRCPATH << EOF
8 $ cat >> $HGRCPATH << EOF
9 > [format]
9 > [format]
10 > use-persistent-nodemap = no
10 > use-persistent-nodemap = no
11 > [web]
11 > [web]
12 > push_ssl = false
12 > push_ssl = false
13 > allow_push = *
13 > allow_push = *
14 > EOF
14 > EOF
15
15
16 $ hg init server
16 $ hg init server
17 $ cd server
17 $ cd server
18 $ touch a
18 $ touch a
19 $ hg -q commit -A -m initial
19 $ hg -q commit -A -m initial
20 $ cd ..
20 $ cd ..
21
21
22 $ hg serve -R server -p $HGPORT -d --pid-file hg.pid
22 $ hg serve -R server -p $HGPORT -d --pid-file hg.pid
23 $ cat hg.pid >> $DAEMON_PIDS
23 $ cat hg.pid >> $DAEMON_PIDS
24
24
25 compression formats are advertised in compression capability
25 compression formats are advertised in compression capability
26
26
27 #if zstd
27 #if zstd
28 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=zstd,zlib$' > /dev/null
28 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=zstd,zlib$' > /dev/null
29 #else
29 #else
30 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=zlib$' > /dev/null
30 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=zlib$' > /dev/null
31 #endif
31 #endif
32
32
33 $ killdaemons.py
33 $ killdaemons.py
34
34
35 server.compressionengines can replace engines list wholesale
35 server.compressionengines can replace engines list wholesale
36
36
37 $ hg serve --config server.compressionengines=none -R server -p $HGPORT -d --pid-file hg.pid
37 $ hg serve --config server.compressionengines=none -R server -p $HGPORT -d --pid-file hg.pid
38 $ cat hg.pid > $DAEMON_PIDS
38 $ cat hg.pid > $DAEMON_PIDS
39 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=none$' > /dev/null
39 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=none$' > /dev/null
40
40
41 $ killdaemons.py
41 $ killdaemons.py
42
42
43 Order of engines can also change
43 Order of engines can also change
44
44
45 $ hg serve --config server.compressionengines=none,zlib -R server -p $HGPORT -d --pid-file hg.pid
45 $ hg serve --config server.compressionengines=none,zlib -R server -p $HGPORT -d --pid-file hg.pid
46 $ cat hg.pid > $DAEMON_PIDS
46 $ cat hg.pid > $DAEMON_PIDS
47 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=none,zlib$' > /dev/null
47 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=none,zlib$' > /dev/null
48
48
49 $ killdaemons.py
49 $ killdaemons.py
50
50
51 Start a default server again
51 Start a default server again
52
52
53 $ hg serve -R server -p $HGPORT -d --pid-file hg.pid
53 $ hg serve -R server -p $HGPORT -d --pid-file hg.pid
54 $ cat hg.pid > $DAEMON_PIDS
54 $ cat hg.pid > $DAEMON_PIDS
55
55
56 Server should send application/mercurial-0.1 to clients if no Accept is used
56 Server should send application/mercurial-0.1 to clients if no Accept is used
57
57
58 $ get-with-headers.py --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' -
58 $ get-with-headers.py --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' -
59 200 Script output follows
59 200 Script output follows
60 content-type: application/mercurial-0.1
60 content-type: application/mercurial-0.1
61 date: $HTTP_DATE$
61 date: $HTTP_DATE$
62 server: testing stub value
62 server: testing stub value
63 transfer-encoding: chunked
63 transfer-encoding: chunked
64
64
65 Server should send application/mercurial-0.1 when client says it wants it
65 Server should send application/mercurial-0.1 when client says it wants it
66
66
67 $ get-with-headers.py --hgproto '0.1' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' -
67 $ get-with-headers.py --hgproto '0.1' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' -
68 200 Script output follows
68 200 Script output follows
69 content-type: application/mercurial-0.1
69 content-type: application/mercurial-0.1
70 date: $HTTP_DATE$
70 date: $HTTP_DATE$
71 server: testing stub value
71 server: testing stub value
72 transfer-encoding: chunked
72 transfer-encoding: chunked
73
73
74 Server should send application/mercurial-0.2 when client says it wants it
74 Server should send application/mercurial-0.2 when client says it wants it
75
75
76 $ get-with-headers.py --hgproto '0.2' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' -
76 $ get-with-headers.py --hgproto '0.2' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' -
77 200 Script output follows
77 200 Script output follows
78 content-type: application/mercurial-0.2
78 content-type: application/mercurial-0.2
79 date: $HTTP_DATE$
79 date: $HTTP_DATE$
80 server: testing stub value
80 server: testing stub value
81 transfer-encoding: chunked
81 transfer-encoding: chunked
82
82
83 $ get-with-headers.py --hgproto '0.1 0.2' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' -
83 $ get-with-headers.py --hgproto '0.1 0.2' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' -
84 200 Script output follows
84 200 Script output follows
85 content-type: application/mercurial-0.2
85 content-type: application/mercurial-0.2
86 date: $HTTP_DATE$
86 date: $HTTP_DATE$
87 server: testing stub value
87 server: testing stub value
88 transfer-encoding: chunked
88 transfer-encoding: chunked
89
89
90 Requesting a compression format that server doesn't support results will fall back to 0.1
90 Requesting a compression format that server doesn't support results will fall back to 0.1
91
91
92 $ get-with-headers.py --hgproto '0.2 comp=aa' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' -
92 $ get-with-headers.py --hgproto '0.2 comp=aa' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' -
93 200 Script output follows
93 200 Script output follows
94 content-type: application/mercurial-0.1
94 content-type: application/mercurial-0.1
95 date: $HTTP_DATE$
95 date: $HTTP_DATE$
96 server: testing stub value
96 server: testing stub value
97 transfer-encoding: chunked
97 transfer-encoding: chunked
98
98
99 #if zstd
99 #if zstd
100 zstd is used if available
100 zstd is used if available
101
101
102 $ get-with-headers.py --hgproto '0.2 comp=zstd' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp
102 $ get-with-headers.py --hgproto '0.2 comp=zstd' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp
103 $ f --size --hexdump --bytes 36 --sha1 resp
103 $ f --size --hexdump --bytes 36 --sha1 resp
104 resp: size=248, sha1=f11b5c098c638068b3d5fe2f9e6241bf5228
104 resp: size=248, sha1=f11b5c098c638068b3d5fe2f9e6241bf5228
105 0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu|
105 0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu|
106 0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 04 7a 73 74 64 |t follows...zstd|
106 0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 04 7a 73 74 64 |t follows...zstd|
107 0020: 28 b5 2f fd |(./.|
107 0020: 28 b5 2f fd |(./.|
108
108
109 #endif
109 #endif
110
110
111 application/mercurial-0.2 is not yet used on non-streaming responses
111 application/mercurial-0.2 is not yet used on non-streaming responses
112
112
113 $ get-with-headers.py --hgproto '0.2' $LOCALIP:$HGPORT '?cmd=heads' -
113 $ get-with-headers.py --hgproto '0.2' $LOCALIP:$HGPORT '?cmd=heads' -
114 200 Script output follows
114 200 Script output follows
115 content-length: 41
115 content-length: 41
116 content-type: application/mercurial-0.1
116 content-type: application/mercurial-0.1
117 date: $HTTP_DATE$
117 date: $HTTP_DATE$
118 server: testing stub value
118 server: testing stub value
119
119
120 e93700bd72895c5addab234c56d4024b487a362f
120 e93700bd72895c5addab234c56d4024b487a362f
121
121
122 Now test protocol preference usage
122 Now test protocol preference usage
123
123
124 $ killdaemons.py
124 $ killdaemons.py
125 $ hg serve --config server.compressionengines=none,zlib -R server -p $HGPORT -d --pid-file hg.pid
125 $ hg serve --config server.compressionengines=none,zlib -R server -p $HGPORT -d --pid-file hg.pid
126 $ cat hg.pid > $DAEMON_PIDS
126 $ cat hg.pid > $DAEMON_PIDS
127
127
128 No Accept will send 0.1+zlib, even though "none" is preferred b/c "none" isn't supported on 0.1
128 No Accept will send 0.1+zlib, even though "none" is preferred b/c "none" isn't supported on 0.1
129
129
130 $ get-with-headers.py --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' Content-Type
130 $ get-with-headers.py --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' Content-Type
131 200 Script output follows
131 200 Script output follows
132 content-type: application/mercurial-0.1
132 content-type: application/mercurial-0.1
133
133
134 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp
134 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp
135 $ f --size --hexdump --bytes 28 --sha1 resp
135 $ f --size --hexdump --bytes 28 --sha1 resp
136 resp: size=227, sha1=35a4c074da74f32f5440da3cbf04
136 resp: size=227, sha1=35a4c074da74f32f5440da3cbf04
137 0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu|
137 0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu|
138 0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 78 |t follows..x|
138 0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 78 |t follows..x|
139
139
140 Explicit 0.1 will send zlib because "none" isn't supported on 0.1
140 Explicit 0.1 will send zlib because "none" isn't supported on 0.1
141
141
142 $ get-with-headers.py --hgproto '0.1' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp
142 $ get-with-headers.py --hgproto '0.1' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp
143 $ f --size --hexdump --bytes 28 --sha1 resp
143 $ f --size --hexdump --bytes 28 --sha1 resp
144 resp: size=227, sha1=35a4c074da74f32f5440da3cbf04
144 resp: size=227, sha1=35a4c074da74f32f5440da3cbf04
145 0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu|
145 0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu|
146 0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 78 |t follows..x|
146 0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 78 |t follows..x|
147
147
148 0.2 with no compression will get "none" because that is server's preference
148 0.2 with no compression will get "none" because that is server's preference
149 (spec says ZL and UN are implicitly supported)
149 (spec says ZL and UN are implicitly supported)
150
150
151 $ get-with-headers.py --hgproto '0.2' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp
151 $ get-with-headers.py --hgproto '0.2' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp
152 $ f --size --hexdump --bytes 32 --sha1 resp
152 $ f --size --hexdump --bytes 32 --sha1 resp
153 resp: size=432, sha1=ac931b412ec185a02e0e5bcff98dac83
153 resp: size=432, sha1=ac931b412ec185a02e0e5bcff98dac83
154 0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu|
154 0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu|
155 0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 04 6e 6f 6e 65 |t follows...none|
155 0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 04 6e 6f 6e 65 |t follows...none|
156
156
157 Client receives server preference even if local order doesn't match
157 Client receives server preference even if local order doesn't match
158
158
159 $ get-with-headers.py --hgproto '0.2 comp=zlib,none' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp
159 $ get-with-headers.py --hgproto '0.2 comp=zlib,none' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp
160 $ f --size --hexdump --bytes 32 --sha1 resp
160 $ f --size --hexdump --bytes 32 --sha1 resp
161 resp: size=432, sha1=ac931b412ec185a02e0e5bcff98dac83
161 resp: size=432, sha1=ac931b412ec185a02e0e5bcff98dac83
162 0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu|
162 0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu|
163 0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 04 6e 6f 6e 65 |t follows...none|
163 0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 04 6e 6f 6e 65 |t follows...none|
164
164
165 Client receives only supported format even if not server preferred format
165 Client receives only supported format even if not server preferred format
166
166
167 $ get-with-headers.py --hgproto '0.2 comp=zlib' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp
167 $ get-with-headers.py --hgproto '0.2 comp=zlib' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp
168 $ f --size --hexdump --bytes 33 --sha1 resp
168 $ f --size --hexdump --bytes 33 --sha1 resp
169 resp: size=232, sha1=a1c727f0c9693ca15742a75c30419bc36
169 resp: size=232, sha1=a1c727f0c9693ca15742a75c30419bc36
170 0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu|
170 0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu|
171 0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 04 7a 6c 69 62 |t follows...zlib|
171 0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 04 7a 6c 69 62 |t follows...zlib|
172 0020: 78 |x|
172 0020: 78 |x|
173
173
174 $ killdaemons.py
174 $ killdaemons.py
175 $ cd ..
175 $ cd ..
176
176
177 Test listkeys for listing namespaces
177 Test listkeys for listing namespaces
178
178
179 $ hg init empty
179 $ hg init empty
180 $ hg -R empty serve -p $HGPORT -d --pid-file hg.pid
180 $ hg -R empty serve -p $HGPORT -d --pid-file hg.pid
181 $ cat hg.pid > $DAEMON_PIDS
181 $ cat hg.pid > $DAEMON_PIDS
182
182
183 $ hg --verbose debugwireproto http://$LOCALIP:$HGPORT << EOF
183 $ hg --verbose debugwireproto http://$LOCALIP:$HGPORT << EOF
184 > command listkeys
184 > command listkeys
185 > namespace namespaces
185 > namespace namespaces
186 > EOF
186 > EOF
187 s> setsockopt(6, 1, 1) -> None (?)
187 s> setsockopt(6, 1, 1) -> None (?)
188 s> GET /?cmd=capabilities HTTP/1.1\r\n
188 s> GET /?cmd=capabilities HTTP/1.1\r\n
189 s> Accept-Encoding: identity\r\n
189 s> Accept-Encoding: identity\r\n
190 s> accept: application/mercurial-0.1\r\n
190 s> accept: application/mercurial-0.1\r\n
191 s> host: $LOCALIP:$HGPORT\r\n (glob)
191 s> host: $LOCALIP:$HGPORT\r\n (glob)
192 s> user-agent: Mercurial debugwireproto\r\n
192 s> user-agent: Mercurial debugwireproto\r\n
193 s> \r\n
193 s> \r\n
194 s> makefile('rb', None)
194 s> makefile('rb', None)
195 s> HTTP/1.1 200 Script output follows\r\n
195 s> HTTP/1.1 200 Script output follows\r\n
196 s> Server: testing stub value\r\n
196 s> Server: testing stub value\r\n
197 s> Date: $HTTP_DATE$\r\n
197 s> Date: $HTTP_DATE$\r\n
198 s> Content-Type: application/mercurial-0.1\r\n
198 s> Content-Type: application/mercurial-0.1\r\n
199 s> Content-Length: *\r\n (glob)
199 s> Content-Length: *\r\n (glob)
200 s> \r\n
200 s> \r\n
201 s> batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
201 s> batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset compression=\$BUNDLE2_COMPRESSIONS\$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (re)
202 sending listkeys command
202 sending listkeys command
203 s> setsockopt(6, 1, 1) -> None (?)
203 s> setsockopt(6, 1, 1) -> None (?)
204 s> GET /?cmd=listkeys HTTP/1.1\r\n
204 s> GET /?cmd=listkeys HTTP/1.1\r\n
205 s> Accept-Encoding: identity\r\n
205 s> Accept-Encoding: identity\r\n
206 s> vary: X-HgArg-1,X-HgProto-1\r\n
206 s> vary: X-HgArg-1,X-HgProto-1\r\n
207 s> x-hgarg-1: namespace=namespaces\r\n
207 s> x-hgarg-1: namespace=namespaces\r\n
208 s> x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n
208 s> x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n
209 s> accept: application/mercurial-0.1\r\n
209 s> accept: application/mercurial-0.1\r\n
210 s> host: $LOCALIP:$HGPORT\r\n (glob)
210 s> host: $LOCALIP:$HGPORT\r\n (glob)
211 s> user-agent: Mercurial debugwireproto\r\n
211 s> user-agent: Mercurial debugwireproto\r\n
212 s> \r\n
212 s> \r\n
213 s> makefile('rb', None)
213 s> makefile('rb', None)
214 s> HTTP/1.1 200 Script output follows\r\n
214 s> HTTP/1.1 200 Script output follows\r\n
215 s> Server: testing stub value\r\n
215 s> Server: testing stub value\r\n
216 s> Date: $HTTP_DATE$\r\n
216 s> Date: $HTTP_DATE$\r\n
217 s> Content-Type: application/mercurial-0.1\r\n
217 s> Content-Type: application/mercurial-0.1\r\n
218 s> Content-Length: 30\r\n
218 s> Content-Length: 30\r\n
219 s> \r\n
219 s> \r\n
220 s> bookmarks\t\n
220 s> bookmarks\t\n
221 s> namespaces\t\n
221 s> namespaces\t\n
222 s> phases\t
222 s> phases\t
223 response: {
223 response: {
224 b'bookmarks': b'',
224 b'bookmarks': b'',
225 b'namespaces': b'',
225 b'namespaces': b'',
226 b'phases': b''
226 b'phases': b''
227 }
227 }
228 (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
228 (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
229
229
230 Same thing, but with "httprequest" command
230 Same thing, but with "httprequest" command
231
231
232 $ hg --verbose debugwireproto --peer raw http://$LOCALIP:$HGPORT << EOF
232 $ hg --verbose debugwireproto --peer raw http://$LOCALIP:$HGPORT << EOF
233 > httprequest GET ?cmd=listkeys
233 > httprequest GET ?cmd=listkeys
234 > user-agent: test
234 > user-agent: test
235 > x-hgarg-1: namespace=namespaces
235 > x-hgarg-1: namespace=namespaces
236 > EOF
236 > EOF
237 using raw connection to peer
237 using raw connection to peer
238 s> setsockopt(6, 1, 1) -> None (?)
238 s> setsockopt(6, 1, 1) -> None (?)
239 s> GET /?cmd=listkeys HTTP/1.1\r\n
239 s> GET /?cmd=listkeys HTTP/1.1\r\n
240 s> Accept-Encoding: identity\r\n
240 s> Accept-Encoding: identity\r\n
241 s> user-agent: test\r\n
241 s> user-agent: test\r\n
242 s> x-hgarg-1: namespace=namespaces\r\n
242 s> x-hgarg-1: namespace=namespaces\r\n
243 s> host: $LOCALIP:$HGPORT\r\n (glob)
243 s> host: $LOCALIP:$HGPORT\r\n (glob)
244 s> \r\n
244 s> \r\n
245 s> makefile('rb', None)
245 s> makefile('rb', None)
246 s> HTTP/1.1 200 Script output follows\r\n
246 s> HTTP/1.1 200 Script output follows\r\n
247 s> Server: testing stub value\r\n
247 s> Server: testing stub value\r\n
248 s> Date: $HTTP_DATE$\r\n
248 s> Date: $HTTP_DATE$\r\n
249 s> Content-Type: application/mercurial-0.1\r\n
249 s> Content-Type: application/mercurial-0.1\r\n
250 s> Content-Length: 30\r\n
250 s> Content-Length: 30\r\n
251 s> \r\n
251 s> \r\n
252 s> bookmarks\t\n
252 s> bookmarks\t\n
253 s> namespaces\t\n
253 s> namespaces\t\n
254 s> phases\t
254 s> phases\t
255 $ killdaemons.py
255 $ killdaemons.py
256
256
257 HTTP client follows HTTP redirect on handshake to new repo
257 HTTP client follows HTTP redirect on handshake to new repo
258
258
259 $ cd $TESTTMP
259 $ cd $TESTTMP
260
260
261 $ hg init redirector
261 $ hg init redirector
262 $ hg init redirected
262 $ hg init redirected
263 $ cd redirected
263 $ cd redirected
264 $ touch foo
264 $ touch foo
265 $ hg -q commit -A -m initial
265 $ hg -q commit -A -m initial
266 $ cd ..
266 $ cd ..
267
267
268 $ cat > paths.conf << EOF
268 $ cat > paths.conf << EOF
269 > [paths]
269 > [paths]
270 > / = $TESTTMP/*
270 > / = $TESTTMP/*
271 > EOF
271 > EOF
272
272
273 $ cat > redirectext.py << EOF
273 $ cat > redirectext.py << EOF
274 > from mercurial import extensions, wireprotoserver
274 > from mercurial import extensions, wireprotoserver
275 > def wrappedcallhttp(orig, repo, req, res, proto, cmd):
275 > def wrappedcallhttp(orig, repo, req, res, proto, cmd):
276 > path = req.advertisedurl[len(req.advertisedbaseurl):]
276 > path = req.advertisedurl[len(req.advertisedbaseurl):]
277 > if not path.startswith(b'/redirector'):
277 > if not path.startswith(b'/redirector'):
278 > return orig(repo, req, res, proto, cmd)
278 > return orig(repo, req, res, proto, cmd)
279 > relpath = path[len(b'/redirector'):]
279 > relpath = path[len(b'/redirector'):]
280 > res.status = b'301 Redirect'
280 > res.status = b'301 Redirect'
281 > newurl = b'%s/redirected%s' % (req.baseurl, relpath)
281 > newurl = b'%s/redirected%s' % (req.baseurl, relpath)
282 > if not repo.ui.configbool(b'testing', b'redirectqs', True) and b'?' in newurl:
282 > if not repo.ui.configbool(b'testing', b'redirectqs', True) and b'?' in newurl:
283 > newurl = newurl[0:newurl.index(b'?')]
283 > newurl = newurl[0:newurl.index(b'?')]
284 > res.headers[b'Location'] = newurl
284 > res.headers[b'Location'] = newurl
285 > res.headers[b'Content-Type'] = b'text/plain'
285 > res.headers[b'Content-Type'] = b'text/plain'
286 > res.setbodybytes(b'redirected')
286 > res.setbodybytes(b'redirected')
287 > return True
287 > return True
288 >
288 >
289 > extensions.wrapfunction(wireprotoserver, '_callhttp', wrappedcallhttp)
289 > extensions.wrapfunction(wireprotoserver, '_callhttp', wrappedcallhttp)
290 > EOF
290 > EOF
291
291
292 $ hg --config extensions.redirect=$TESTTMP/redirectext.py \
292 $ hg --config extensions.redirect=$TESTTMP/redirectext.py \
293 > --config server.compressionengines=zlib \
293 > --config server.compressionengines=zlib \
294 > serve --web-conf paths.conf --pid-file hg.pid -p $HGPORT -d
294 > serve --web-conf paths.conf --pid-file hg.pid -p $HGPORT -d
295 $ cat hg.pid > $DAEMON_PIDS
295 $ cat hg.pid > $DAEMON_PIDS
296
296
297 Verify our HTTP 301 is served properly
297 Verify our HTTP 301 is served properly
298
298
299 $ hg --verbose debugwireproto --peer raw http://$LOCALIP:$HGPORT << EOF
299 $ hg --verbose debugwireproto --peer raw http://$LOCALIP:$HGPORT << EOF
300 > httprequest GET /redirector?cmd=capabilities
300 > httprequest GET /redirector?cmd=capabilities
301 > user-agent: test
301 > user-agent: test
302 > EOF
302 > EOF
303 using raw connection to peer
303 using raw connection to peer
304 s> setsockopt(6, 1, 1) -> None (?)
304 s> setsockopt(6, 1, 1) -> None (?)
305 s> GET /redirector?cmd=capabilities HTTP/1.1\r\n
305 s> GET /redirector?cmd=capabilities HTTP/1.1\r\n
306 s> Accept-Encoding: identity\r\n
306 s> Accept-Encoding: identity\r\n
307 s> user-agent: test\r\n
307 s> user-agent: test\r\n
308 s> host: $LOCALIP:$HGPORT\r\n (glob)
308 s> host: $LOCALIP:$HGPORT\r\n (glob)
309 s> \r\n
309 s> \r\n
310 s> makefile('rb', None)
310 s> makefile('rb', None)
311 s> HTTP/1.1 301 Redirect\r\n
311 s> HTTP/1.1 301 Redirect\r\n
312 s> Server: testing stub value\r\n
312 s> Server: testing stub value\r\n
313 s> Date: $HTTP_DATE$\r\n
313 s> Date: $HTTP_DATE$\r\n
314 s> Location: http://$LOCALIP:$HGPORT/redirected?cmd=capabilities\r\n (glob)
314 s> Location: http://$LOCALIP:$HGPORT/redirected?cmd=capabilities\r\n (glob)
315 s> Content-Type: text/plain\r\n
315 s> Content-Type: text/plain\r\n
316 s> Content-Length: 10\r\n
316 s> Content-Length: 10\r\n
317 s> \r\n
317 s> \r\n
318 s> redirected
318 s> redirected
319 s> setsockopt(6, 1, 1) -> None (?)
319 s> setsockopt(6, 1, 1) -> None (?)
320 s> GET /redirected?cmd=capabilities HTTP/1.1\r\n
320 s> GET /redirected?cmd=capabilities HTTP/1.1\r\n
321 s> Accept-Encoding: identity\r\n
321 s> Accept-Encoding: identity\r\n
322 s> user-agent: test\r\n
322 s> user-agent: test\r\n
323 s> host: $LOCALIP:$HGPORT\r\n (glob)
323 s> host: $LOCALIP:$HGPORT\r\n (glob)
324 s> \r\n
324 s> \r\n
325 s> makefile('rb', None)
325 s> makefile('rb', None)
326 s> HTTP/1.1 200 Script output follows\r\n
326 s> HTTP/1.1 200 Script output follows\r\n
327 s> Server: testing stub value\r\n
327 s> Server: testing stub value\r\n
328 s> Date: $HTTP_DATE$\r\n
328 s> Date: $HTTP_DATE$\r\n
329 s> Content-Type: application/mercurial-0.1\r\n
329 s> Content-Type: application/mercurial-0.1\r\n
330 s> Content-Length: 484\r\n
330 s> Content-Length: \d+\\r\\n (re)
331 s> \r\n
331 s> \r\n
332 s> batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
332 s> batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset compression=\$BUNDLE2_COMPRESSIONS\$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (re)
333
333
334 Test with the HTTP peer
334 Test with the HTTP peer
335
335
336 $ hg --verbose debugwireproto http://$LOCALIP:$HGPORT/redirector << EOF
336 $ hg --verbose debugwireproto http://$LOCALIP:$HGPORT/redirector << EOF
337 > command heads
337 > command heads
338 > EOF
338 > EOF
339 s> setsockopt(6, 1, 1) -> None (?)
339 s> setsockopt(6, 1, 1) -> None (?)
340 s> GET /redirector?cmd=capabilities HTTP/1.1\r\n
340 s> GET /redirector?cmd=capabilities HTTP/1.1\r\n
341 s> Accept-Encoding: identity\r\n
341 s> Accept-Encoding: identity\r\n
342 s> accept: application/mercurial-0.1\r\n
342 s> accept: application/mercurial-0.1\r\n
343 s> host: $LOCALIP:$HGPORT\r\n (glob)
343 s> host: $LOCALIP:$HGPORT\r\n (glob)
344 s> user-agent: Mercurial debugwireproto\r\n
344 s> user-agent: Mercurial debugwireproto\r\n
345 s> \r\n
345 s> \r\n
346 s> makefile('rb', None)
346 s> makefile('rb', None)
347 s> HTTP/1.1 301 Redirect\r\n
347 s> HTTP/1.1 301 Redirect\r\n
348 s> Server: testing stub value\r\n
348 s> Server: testing stub value\r\n
349 s> Date: $HTTP_DATE$\r\n
349 s> Date: $HTTP_DATE$\r\n
350 s> Location: http://$LOCALIP:$HGPORT/redirected?cmd=capabilities\r\n (glob)
350 s> Location: http://$LOCALIP:$HGPORT/redirected?cmd=capabilities\r\n (glob)
351 s> Content-Type: text/plain\r\n
351 s> Content-Type: text/plain\r\n
352 s> Content-Length: 10\r\n
352 s> Content-Length: 10\r\n
353 s> \r\n
353 s> \r\n
354 s> redirected
354 s> redirected
355 s> setsockopt(6, 1, 1) -> None (?)
355 s> setsockopt(6, 1, 1) -> None (?)
356 s> GET /redirected?cmd=capabilities HTTP/1.1\r\n
356 s> GET /redirected?cmd=capabilities HTTP/1.1\r\n
357 s> Accept-Encoding: identity\r\n
357 s> Accept-Encoding: identity\r\n
358 s> accept: application/mercurial-0.1\r\n
358 s> accept: application/mercurial-0.1\r\n
359 s> host: $LOCALIP:$HGPORT\r\n (glob)
359 s> host: $LOCALIP:$HGPORT\r\n (glob)
360 s> user-agent: Mercurial debugwireproto\r\n
360 s> user-agent: Mercurial debugwireproto\r\n
361 s> \r\n
361 s> \r\n
362 s> makefile('rb', None)
362 s> makefile('rb', None)
363 s> HTTP/1.1 200 Script output follows\r\n
363 s> HTTP/1.1 200 Script output follows\r\n
364 s> Server: testing stub value\r\n
364 s> Server: testing stub value\r\n
365 s> Date: $HTTP_DATE$\r\n
365 s> Date: $HTTP_DATE$\r\n
366 s> Content-Type: application/mercurial-0.1\r\n
366 s> Content-Type: application/mercurial-0.1\r\n
367 s> Content-Length: 484\r\n
367 s> Content-Length: \d+\\r\\n (re)
368 s> \r\n
368 s> \r\n
369 real URL is http://$LOCALIP:$HGPORT/redirected (glob)
369 real URL is http://$LOCALIP:$HGPORT/redirected (glob)
370 s> batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
370 s> batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset compression=\$BUNDLE2_COMPRESSIONS\$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (re)
371 sending heads command
371 sending heads command
372 s> setsockopt(6, 1, 1) -> None (?)
372 s> setsockopt(6, 1, 1) -> None (?)
373 s> GET /redirected?cmd=heads HTTP/1.1\r\n
373 s> GET /redirected?cmd=heads HTTP/1.1\r\n
374 s> Accept-Encoding: identity\r\n
374 s> Accept-Encoding: identity\r\n
375 s> vary: X-HgProto-1\r\n
375 s> vary: X-HgProto-1\r\n
376 s> x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n
376 s> x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n
377 s> accept: application/mercurial-0.1\r\n
377 s> accept: application/mercurial-0.1\r\n
378 s> host: $LOCALIP:$HGPORT\r\n (glob)
378 s> host: $LOCALIP:$HGPORT\r\n (glob)
379 s> user-agent: Mercurial debugwireproto\r\n
379 s> user-agent: Mercurial debugwireproto\r\n
380 s> \r\n
380 s> \r\n
381 s> makefile('rb', None)
381 s> makefile('rb', None)
382 s> HTTP/1.1 200 Script output follows\r\n
382 s> HTTP/1.1 200 Script output follows\r\n
383 s> Server: testing stub value\r\n
383 s> Server: testing stub value\r\n
384 s> Date: $HTTP_DATE$\r\n
384 s> Date: $HTTP_DATE$\r\n
385 s> Content-Type: application/mercurial-0.1\r\n
385 s> Content-Type: application/mercurial-0.1\r\n
386 s> Content-Length: 41\r\n
386 s> Content-Length: 41\r\n
387 s> \r\n
387 s> \r\n
388 s> 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n
388 s> 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n
389 response: [
389 response: [
390 b'\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL'
390 b'\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL'
391 ]
391 ]
392 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
392 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
393
393
394 $ killdaemons.py
394 $ killdaemons.py
395
395
396 Now test a variation where we strip the query string from the redirect URL.
396 Now test a variation where we strip the query string from the redirect URL.
397 (SCM Manager apparently did this and clients would recover from it)
397 (SCM Manager apparently did this and clients would recover from it)
398
398
399 $ hg --config extensions.redirect=$TESTTMP/redirectext.py \
399 $ hg --config extensions.redirect=$TESTTMP/redirectext.py \
400 > --config server.compressionengines=zlib \
400 > --config server.compressionengines=zlib \
401 > --config testing.redirectqs=false \
401 > --config testing.redirectqs=false \
402 > serve --web-conf paths.conf --pid-file hg.pid -p $HGPORT -d
402 > serve --web-conf paths.conf --pid-file hg.pid -p $HGPORT -d
403 $ cat hg.pid > $DAEMON_PIDS
403 $ cat hg.pid > $DAEMON_PIDS
404
404
405 $ hg --verbose debugwireproto --peer raw http://$LOCALIP:$HGPORT << EOF
405 $ hg --verbose debugwireproto --peer raw http://$LOCALIP:$HGPORT << EOF
406 > httprequest GET /redirector?cmd=capabilities
406 > httprequest GET /redirector?cmd=capabilities
407 > user-agent: test
407 > user-agent: test
408 > EOF
408 > EOF
409 using raw connection to peer
409 using raw connection to peer
410 s> setsockopt(6, 1, 1) -> None (?)
410 s> setsockopt(6, 1, 1) -> None (?)
411 s> GET /redirector?cmd=capabilities HTTP/1.1\r\n
411 s> GET /redirector?cmd=capabilities HTTP/1.1\r\n
412 s> Accept-Encoding: identity\r\n
412 s> Accept-Encoding: identity\r\n
413 s> user-agent: test\r\n
413 s> user-agent: test\r\n
414 s> host: $LOCALIP:$HGPORT\r\n (glob)
414 s> host: $LOCALIP:$HGPORT\r\n (glob)
415 s> \r\n
415 s> \r\n
416 s> makefile('rb', None)
416 s> makefile('rb', None)
417 s> HTTP/1.1 301 Redirect\r\n
417 s> HTTP/1.1 301 Redirect\r\n
418 s> Server: testing stub value\r\n
418 s> Server: testing stub value\r\n
419 s> Date: $HTTP_DATE$\r\n
419 s> Date: $HTTP_DATE$\r\n
420 s> Location: http://$LOCALIP:$HGPORT/redirected\r\n (glob)
420 s> Location: http://$LOCALIP:$HGPORT/redirected\r\n (glob)
421 s> Content-Type: text/plain\r\n
421 s> Content-Type: text/plain\r\n
422 s> Content-Length: 10\r\n
422 s> Content-Length: 10\r\n
423 s> \r\n
423 s> \r\n
424 s> redirected
424 s> redirected
425 s> setsockopt(6, 1, 1) -> None (?)
425 s> setsockopt(6, 1, 1) -> None (?)
426 s> GET /redirected HTTP/1.1\r\n
426 s> GET /redirected HTTP/1.1\r\n
427 s> Accept-Encoding: identity\r\n
427 s> Accept-Encoding: identity\r\n
428 s> user-agent: test\r\n
428 s> user-agent: test\r\n
429 s> host: $LOCALIP:$HGPORT\r\n (glob)
429 s> host: $LOCALIP:$HGPORT\r\n (glob)
430 s> \r\n
430 s> \r\n
431 s> makefile('rb', None)
431 s> makefile('rb', None)
432 s> HTTP/1.1 200 Script output follows\r\n
432 s> HTTP/1.1 200 Script output follows\r\n
433 s> Server: testing stub value\r\n
433 s> Server: testing stub value\r\n
434 s> Date: $HTTP_DATE$\r\n
434 s> Date: $HTTP_DATE$\r\n
435 s> ETag: W/"*"\r\n (glob)
435 s> ETag: W/"*"\r\n (glob)
436 s> Content-Type: text/html; charset=ascii\r\n
436 s> Content-Type: text/html; charset=ascii\r\n
437 s> Transfer-Encoding: chunked\r\n
437 s> Transfer-Encoding: chunked\r\n
438 s> \r\n
438 s> \r\n
439 s> 414\r\n
439 s> 414\r\n
440 s> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\n
440 s> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\n
441 s> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">\n
441 s> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">\n
442 s> <head>\n
442 s> <head>\n
443 s> <link rel="icon" href="/redirected/static/hgicon.png" type="image/png" />\n
443 s> <link rel="icon" href="/redirected/static/hgicon.png" type="image/png" />\n
444 s> <meta name="robots" content="index, nofollow" />\n
444 s> <meta name="robots" content="index, nofollow" />\n
445 s> <link rel="stylesheet" href="/redirected/static/style-paper.css" type="text/css" />\n
445 s> <link rel="stylesheet" href="/redirected/static/style-paper.css" type="text/css" />\n
446 s> <script type="text/javascript" src="/redirected/static/mercurial.js"></script>\n
446 s> <script type="text/javascript" src="/redirected/static/mercurial.js"></script>\n
447 s> \n
447 s> \n
448 s> <title>redirected: log</title>\n
448 s> <title>redirected: log</title>\n
449 s> <link rel="alternate" type="application/atom+xml"\n
449 s> <link rel="alternate" type="application/atom+xml"\n
450 s> href="/redirected/atom-log" title="Atom feed for redirected" />\n
450 s> href="/redirected/atom-log" title="Atom feed for redirected" />\n
451 s> <link rel="alternate" type="application/rss+xml"\n
451 s> <link rel="alternate" type="application/rss+xml"\n
452 s> href="/redirected/rss-log" title="RSS feed for redirected" />\n
452 s> href="/redirected/rss-log" title="RSS feed for redirected" />\n
453 s> </head>\n
453 s> </head>\n
454 s> <body>\n
454 s> <body>\n
455 s> \n
455 s> \n
456 s> <div class="container">\n
456 s> <div class="container">\n
457 s> <div class="menu">\n
457 s> <div class="menu">\n
458 s> <div class="logo">\n
458 s> <div class="logo">\n
459 s> <a href="https://mercurial-scm.org/">\n
459 s> <a href="https://mercurial-scm.org/">\n
460 s> <img src="/redirected/static/hglogo.png" alt="mercurial" /></a>\n
460 s> <img src="/redirected/static/hglogo.png" alt="mercurial" /></a>\n
461 s> </div>\n
461 s> </div>\n
462 s> <ul>\n
462 s> <ul>\n
463 s> <li class="active">log</li>\n
463 s> <li class="active">log</li>\n
464 s> <li><a href="/redirected/graph/tip">graph</a></li>\n
464 s> <li><a href="/redirected/graph/tip">graph</a></li>\n
465 s> <li><a href="/redirected/tags">tags</a></li>\n
465 s> <li><a href="/redirected/tags">tags</a></li>\n
466 s> <li><a href="
466 s> <li><a href="
467 s> \r\n
467 s> \r\n
468 s> 810\r\n
468 s> 810\r\n
469 s> /redirected/bookmarks">bookmarks</a></li>\n
469 s> /redirected/bookmarks">bookmarks</a></li>\n
470 s> <li><a href="/redirected/branches">branches</a></li>\n
470 s> <li><a href="/redirected/branches">branches</a></li>\n
471 s> </ul>\n
471 s> </ul>\n
472 s> <ul>\n
472 s> <ul>\n
473 s> <li><a href="/redirected/rev/tip">changeset</a></li>\n
473 s> <li><a href="/redirected/rev/tip">changeset</a></li>\n
474 s> <li><a href="/redirected/file/tip">browse</a></li>\n
474 s> <li><a href="/redirected/file/tip">browse</a></li>\n
475 s> </ul>\n
475 s> </ul>\n
476 s> <ul>\n
476 s> <ul>\n
477 s> \n
477 s> \n
478 s> </ul>\n
478 s> </ul>\n
479 s> <ul>\n
479 s> <ul>\n
480 s> <li><a href="/redirected/help">help</a></li>\n
480 s> <li><a href="/redirected/help">help</a></li>\n
481 s> </ul>\n
481 s> </ul>\n
482 s> <div class="atom-logo">\n
482 s> <div class="atom-logo">\n
483 s> <a href="/redirected/atom-log" title="subscribe to atom feed">\n
483 s> <a href="/redirected/atom-log" title="subscribe to atom feed">\n
484 s> <img class="atom-logo" src="/redirected/static/feed-icon-14x14.png" alt="atom feed" />\n
484 s> <img class="atom-logo" src="/redirected/static/feed-icon-14x14.png" alt="atom feed" />\n
485 s> </a>\n
485 s> </a>\n
486 s> </div>\n
486 s> </div>\n
487 s> </div>\n
487 s> </div>\n
488 s> \n
488 s> \n
489 s> <div class="main">\n
489 s> <div class="main">\n
490 s> <h2 class="breadcrumb"><a href="/">Mercurial</a> &gt; <a href="/redirected">redirected</a> </h2>\n
490 s> <h2 class="breadcrumb"><a href="/">Mercurial</a> &gt; <a href="/redirected">redirected</a> </h2>\n
491 s> <h3>log</h3>\n
491 s> <h3>log</h3>\n
492 s> \n
492 s> \n
493 s> \n
493 s> \n
494 s> <form class="search" action="/redirected/log">\n
494 s> <form class="search" action="/redirected/log">\n
495 s> \n
495 s> \n
496 s> <p><input name="rev" id="search1" type="text" size="30" value="" /></p>\n
496 s> <p><input name="rev" id="search1" type="text" size="30" value="" /></p>\n
497 s> <div id="hint">Find changesets by keywords (author, files, the commit message), revision\n
497 s> <div id="hint">Find changesets by keywords (author, files, the commit message), revision\n
498 s> number or hash, or <a href="/redirected/help/revsets">revset expression</a>.</div>\n
498 s> number or hash, or <a href="/redirected/help/revsets">revset expression</a>.</div>\n
499 s> </form>\n
499 s> </form>\n
500 s> \n
500 s> \n
501 s> <div class="navigate">\n
501 s> <div class="navigate">\n
502 s> <a href="/redirected/shortlog/tip?revcount=30">less</a>\n
502 s> <a href="/redirected/shortlog/tip?revcount=30">less</a>\n
503 s> <a href="/redirected/shortlog/tip?revcount=120">more</a>\n
503 s> <a href="/redirected/shortlog/tip?revcount=120">more</a>\n
504 s> | rev 0: <a href="/redirected/shortlog/96ee1d7354c4">(0)</a> <a href="/redirected/shortlog/tip">tip</a> \n
504 s> | rev 0: <a href="/redirected/shortlog/96ee1d7354c4">(0)</a> <a href="/redirected/shortlog/tip">tip</a> \n
505 s> </div>\n
505 s> </div>\n
506 s> \n
506 s> \n
507 s> <table class="bigtable">\n
507 s> <table class="bigtable">\n
508 s> <thead>\n
508 s> <thead>\n
509 s> <tr>\n
509 s> <tr>\n
510 s> <th class="age">age</th>\n
510 s> <th class="age">age</th>\n
511 s> <th class="author">author</th>\n
511 s> <th class="author">author</th>\n
512 s> <th class="description">description</th>\n
512 s> <th class="description">description</th>\n
513 s> </tr>\n
513 s> </tr>\n
514 s> </thead>\n
514 s> </thead>\n
515 s> <tbody class="stripes2">\n
515 s> <tbody class="stripes2">\n
516 s> <tr>\n
516 s> <tr>\n
517 s> <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>\n
517 s> <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>\n
518 s> <td class="author">test</td>\n
518 s> <td class="author">test</td>\n
519 s> <td class="description">\n
519 s> <td class="description">\n
520 s> <a href="/redirected/rev/96ee1d7354c4">initial</a>\n
520 s> <a href="/redirected/rev/96ee1d7354c4">initial</a>\n
521 s> <span class="phase">draft</span> <span class="branchhead">default</span> <span class="tag">tip</span> \n
521 s> <span class="phase">draft</span> <span class="branchhead">default</span> <span class="tag">tip</span> \n
522 s> </td>\n
522 s> </td>\n
523 s> </tr>\n
523 s> </tr>\n
524 s> \n
524 s> \n
525 s> </tbody>\n
525 s> </tbody>\n
526 s> </table>\n
526 s> </table>\n
527 s> \n
527 s> \n
528 s> <div class="navigate">\n
528 s> <div class="navigate">\n
529 s> <a href="/redirected/shortlog/tip?revcount=30">less</a>\n
529 s> <a href="/redirected/shortlog/tip?revcount=30">less</a>\n
530 s> <a href="/redirected/shortlog/tip?revcount=120">more</a>\n
530 s> <a href="/redirected/shortlog/tip?revcount=120">more</a>\n
531 s> | rev 0: <a href="/redirected/shortlog/96ee1d7354c4">(0)</a> <a href="/redirected/shortlog/tip">tip</a> \n
531 s> | rev 0: <a href="/redirected/shortlog/96ee1d7354c4">(0)</a> <a href="/redirected/shortlog/tip">tip</a> \n
532 s> </div>\n
532 s> </div>\n
533 s> \n
533 s> \n
534 s> <script type="text/javascript">\n
534 s> <script type="text/javascript">\n
535 s> ajaxScrollInit(\n
535 s> ajaxScrollInit(\n
536 s> \'/redirected/shortlog/%next%\',\n
536 s> \'/redirected/shortlog/%next%\',\n
537 s> \'\', <!-- NEXTHASH\n
537 s> \'\', <!-- NEXTHASH\n
538 s> function (htmlText) {
538 s> function (htmlText) {
539 s> \r\n
539 s> \r\n
540 s> 14a\r\n
540 s> 14a\r\n
541 s> \n
541 s> \n
542 s> var m = htmlText.match(/\'(\\w+)\', <!-- NEXTHASH/);\n
542 s> var m = htmlText.match(/\'(\\w+)\', <!-- NEXTHASH/);\n
543 s> return m ? m[1] : null;\n
543 s> return m ? m[1] : null;\n
544 s> },\n
544 s> },\n
545 s> \'.bigtable > tbody\',\n
545 s> \'.bigtable > tbody\',\n
546 s> \'<tr class="%class%">\\\n
546 s> \'<tr class="%class%">\\\n
547 s> <td colspan="3" style="text-align: center;">%text%</td>\\\n
547 s> <td colspan="3" style="text-align: center;">%text%</td>\\\n
548 s> </tr>\'\n
548 s> </tr>\'\n
549 s> );\n
549 s> );\n
550 s> </script>\n
550 s> </script>\n
551 s> \n
551 s> \n
552 s> </div>\n
552 s> </div>\n
553 s> </div>\n
553 s> </div>\n
554 s> \n
554 s> \n
555 s> \n
555 s> \n
556 s> \n
556 s> \n
557 s> </body>\n
557 s> </body>\n
558 s> </html>\n
558 s> </html>\n
559 s> \n
559 s> \n
560 s> \r\n
560 s> \r\n
561 s> 0\r\n
561 s> 0\r\n
562 s> \r\n
562 s> \r\n
563
563
564 $ hg --verbose debugwireproto http://$LOCALIP:$HGPORT/redirector << EOF
564 $ hg --verbose debugwireproto http://$LOCALIP:$HGPORT/redirector << EOF
565 > command heads
565 > command heads
566 > EOF
566 > EOF
567 s> setsockopt(6, 1, 1) -> None (?)
567 s> setsockopt(6, 1, 1) -> None (?)
568 s> GET /redirector?cmd=capabilities HTTP/1.1\r\n
568 s> GET /redirector?cmd=capabilities HTTP/1.1\r\n
569 s> Accept-Encoding: identity\r\n
569 s> Accept-Encoding: identity\r\n
570 s> accept: application/mercurial-0.1\r\n
570 s> accept: application/mercurial-0.1\r\n
571 s> host: $LOCALIP:$HGPORT\r\n (glob)
571 s> host: $LOCALIP:$HGPORT\r\n (glob)
572 s> user-agent: Mercurial debugwireproto\r\n
572 s> user-agent: Mercurial debugwireproto\r\n
573 s> \r\n
573 s> \r\n
574 s> makefile('rb', None)
574 s> makefile('rb', None)
575 s> HTTP/1.1 301 Redirect\r\n
575 s> HTTP/1.1 301 Redirect\r\n
576 s> Server: testing stub value\r\n
576 s> Server: testing stub value\r\n
577 s> Date: $HTTP_DATE$\r\n
577 s> Date: $HTTP_DATE$\r\n
578 s> Location: http://$LOCALIP:$HGPORT/redirected\r\n (glob)
578 s> Location: http://$LOCALIP:$HGPORT/redirected\r\n (glob)
579 s> Content-Type: text/plain\r\n
579 s> Content-Type: text/plain\r\n
580 s> Content-Length: 10\r\n
580 s> Content-Length: 10\r\n
581 s> \r\n
581 s> \r\n
582 s> redirected
582 s> redirected
583 s> setsockopt(6, 1, 1) -> None (?)
583 s> setsockopt(6, 1, 1) -> None (?)
584 s> GET /redirected HTTP/1.1\r\n
584 s> GET /redirected HTTP/1.1\r\n
585 s> Accept-Encoding: identity\r\n
585 s> Accept-Encoding: identity\r\n
586 s> accept: application/mercurial-0.1\r\n
586 s> accept: application/mercurial-0.1\r\n
587 s> host: $LOCALIP:$HGPORT\r\n (glob)
587 s> host: $LOCALIP:$HGPORT\r\n (glob)
588 s> user-agent: Mercurial debugwireproto\r\n
588 s> user-agent: Mercurial debugwireproto\r\n
589 s> \r\n
589 s> \r\n
590 s> makefile('rb', None)
590 s> makefile('rb', None)
591 s> HTTP/1.1 200 Script output follows\r\n
591 s> HTTP/1.1 200 Script output follows\r\n
592 s> Server: testing stub value\r\n
592 s> Server: testing stub value\r\n
593 s> Date: $HTTP_DATE$\r\n
593 s> Date: $HTTP_DATE$\r\n
594 s> ETag: W/"*"\r\n (glob)
594 s> ETag: W/"*"\r\n (glob)
595 s> Content-Type: text/html; charset=ascii\r\n
595 s> Content-Type: text/html; charset=ascii\r\n
596 s> Transfer-Encoding: chunked\r\n
596 s> Transfer-Encoding: chunked\r\n
597 s> \r\n
597 s> \r\n
598 real URL is http://$LOCALIP:$HGPORT/redirected (glob)
598 real URL is http://$LOCALIP:$HGPORT/redirected (glob)
599 s> 414\r\n
599 s> 414\r\n
600 s> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\n
600 s> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\n
601 s> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">\n
601 s> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">\n
602 s> <head>\n
602 s> <head>\n
603 s> <link rel="icon" href="/redirected/static/hgicon.png" type="image/png" />\n
603 s> <link rel="icon" href="/redirected/static/hgicon.png" type="image/png" />\n
604 s> <meta name="robots" content="index, nofollow" />\n
604 s> <meta name="robots" content="index, nofollow" />\n
605 s> <link rel="stylesheet" href="/redirected/static/style-paper.css" type="text/css" />\n
605 s> <link rel="stylesheet" href="/redirected/static/style-paper.css" type="text/css" />\n
606 s> <script type="text/javascript" src="/redirected/static/mercurial.js"></script>\n
606 s> <script type="text/javascript" src="/redirected/static/mercurial.js"></script>\n
607 s> \n
607 s> \n
608 s> <title>redirected: log</title>\n
608 s> <title>redirected: log</title>\n
609 s> <link rel="alternate" type="application/atom+xml"\n
609 s> <link rel="alternate" type="application/atom+xml"\n
610 s> href="/redirected/atom-log" title="Atom feed for redirected" />\n
610 s> href="/redirected/atom-log" title="Atom feed for redirected" />\n
611 s> <link rel="alternate" type="application/rss+xml"\n
611 s> <link rel="alternate" type="application/rss+xml"\n
612 s> href="/redirected/rss-log" title="RSS feed for redirected" />\n
612 s> href="/redirected/rss-log" title="RSS feed for redirected" />\n
613 s> </head>\n
613 s> </head>\n
614 s> <body>\n
614 s> <body>\n
615 s> \n
615 s> \n
616 s> <div class="container">\n
616 s> <div class="container">\n
617 s> <div class="menu">\n
617 s> <div class="menu">\n
618 s> <div class="logo">\n
618 s> <div class="logo">\n
619 s> <a href="https://mercurial-scm.org/">\n
619 s> <a href="https://mercurial-scm.org/">\n
620 s> <img src="/redirected/static/hglogo.png" alt="mercurial" /></a>\n
620 s> <img src="/redirected/static/hglogo.png" alt="mercurial" /></a>\n
621 s> </div>\n
621 s> </div>\n
622 s> <ul>\n
622 s> <ul>\n
623 s> <li class="active">log</li>\n
623 s> <li class="active">log</li>\n
624 s> <li><a href="/redirected/graph/tip">graph</a></li>\n
624 s> <li><a href="/redirected/graph/tip">graph</a></li>\n
625 s> <li><a href="/redirected/tags">tags</a
625 s> <li><a href="/redirected/tags">tags</a
626 s> setsockopt(6, 1, 1) -> None (?)
626 s> setsockopt(6, 1, 1) -> None (?)
627 s> GET /redirected?cmd=capabilities HTTP/1.1\r\n
627 s> GET /redirected?cmd=capabilities HTTP/1.1\r\n
628 s> Accept-Encoding: identity\r\n
628 s> Accept-Encoding: identity\r\n
629 s> accept: application/mercurial-0.1\r\n
629 s> accept: application/mercurial-0.1\r\n
630 s> host: $LOCALIP:$HGPORT\r\n (glob)
630 s> host: $LOCALIP:$HGPORT\r\n (glob)
631 s> user-agent: Mercurial debugwireproto\r\n
631 s> user-agent: Mercurial debugwireproto\r\n
632 s> \r\n
632 s> \r\n
633 s> makefile('rb', None)
633 s> makefile('rb', None)
634 s> HTTP/1.1 200 Script output follows\r\n
634 s> HTTP/1.1 200 Script output follows\r\n
635 s> Server: testing stub value\r\n
635 s> Server: testing stub value\r\n
636 s> Date: $HTTP_DATE$\r\n
636 s> Date: $HTTP_DATE$\r\n
637 s> Content-Type: application/mercurial-0.1\r\n
637 s> Content-Type: application/mercurial-0.1\r\n
638 s> Content-Length: 484\r\n
638 s> Content-Length: \d+\\r\\n (re)
639 s> \r\n
639 s> \r\n
640 real URL is http://$LOCALIP:$HGPORT/redirected (glob)
640 real URL is http://$LOCALIP:$HGPORT/redirected (glob)
641 s> batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
641 s> batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset compression=\$BUNDLE2_COMPRESSIONS\$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (re)
642 sending heads command
642 sending heads command
643 s> setsockopt(6, 1, 1) -> None (?)
643 s> setsockopt(6, 1, 1) -> None (?)
644 s> GET /redirected?cmd=heads HTTP/1.1\r\n
644 s> GET /redirected?cmd=heads HTTP/1.1\r\n
645 s> Accept-Encoding: identity\r\n
645 s> Accept-Encoding: identity\r\n
646 s> vary: X-HgProto-1\r\n
646 s> vary: X-HgProto-1\r\n
647 s> x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n
647 s> x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n
648 s> accept: application/mercurial-0.1\r\n
648 s> accept: application/mercurial-0.1\r\n
649 s> host: $LOCALIP:$HGPORT\r\n (glob)
649 s> host: $LOCALIP:$HGPORT\r\n (glob)
650 s> user-agent: Mercurial debugwireproto\r\n
650 s> user-agent: Mercurial debugwireproto\r\n
651 s> \r\n
651 s> \r\n
652 s> makefile('rb', None)
652 s> makefile('rb', None)
653 s> HTTP/1.1 200 Script output follows\r\n
653 s> HTTP/1.1 200 Script output follows\r\n
654 s> Server: testing stub value\r\n
654 s> Server: testing stub value\r\n
655 s> Date: $HTTP_DATE$\r\n
655 s> Date: $HTTP_DATE$\r\n
656 s> Content-Type: application/mercurial-0.1\r\n
656 s> Content-Type: application/mercurial-0.1\r\n
657 s> Content-Length: 41\r\n
657 s> Content-Length: 41\r\n
658 s> \r\n
658 s> \r\n
659 s> 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n
659 s> 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n
660 response: [
660 response: [
661 b'\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL'
661 b'\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL'
662 ]
662 ]
663 (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)
663 (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)
General Comments 0
You need to be logged in to leave comments. Login now