##// END OF EJS Templates
test-clone-uncompressed: use config to silence the lock warning...
marmoute -
r45636:23119371 default
parent child Browse files
Show More
@@ -1,572 +1,572
1 #require serve no-reposimplestore no-chg
1 #require serve no-reposimplestore no-chg
2
2
3 #testcases stream-legacy stream-bundle2
3 #testcases stream-legacy stream-bundle2
4
4
5 #if stream-legacy
5 #if stream-legacy
6 $ cat << EOF >> $HGRCPATH
6 $ cat << EOF >> $HGRCPATH
7 > [server]
7 > [server]
8 > bundle2.stream = no
8 > bundle2.stream = no
9 > EOF
9 > EOF
10 #endif
10 #endif
11
11
12 Initialize repository
12 Initialize repository
13 the status call is to check for issue5130
13 the status call is to check for issue5130
14
14
15 $ hg init server
15 $ hg init server
16 $ cd server
16 $ cd server
17 $ touch foo
17 $ touch foo
18 $ hg -q commit -A -m initial
18 $ hg -q commit -A -m initial
19 >>> for i in range(1024):
19 >>> for i in range(1024):
20 ... with open(str(i), 'wb') as fh:
20 ... with open(str(i), 'wb') as fh:
21 ... fh.write(b"%d" % i) and None
21 ... fh.write(b"%d" % i) and None
22 $ hg -q commit -A -m 'add a lot of files'
22 $ hg -q commit -A -m 'add a lot of files'
23 $ hg st
23 $ hg st
24 $ hg --config server.uncompressed=false serve -p $HGPORT -d --pid-file=hg.pid
24 $ hg --config server.uncompressed=false serve -p $HGPORT -d --pid-file=hg.pid
25 $ cat hg.pid > $DAEMON_PIDS
25 $ cat hg.pid > $DAEMON_PIDS
26 $ cd ..
26 $ cd ..
27
27
28 Cannot stream clone when server.uncompressed is set
28 Cannot stream clone when server.uncompressed is set
29
29
30 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=stream_out'
30 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=stream_out'
31 200 Script output follows
31 200 Script output follows
32
32
33 1
33 1
34
34
35 #if stream-legacy
35 #if stream-legacy
36 $ hg debugcapabilities http://localhost:$HGPORT
36 $ hg debugcapabilities http://localhost:$HGPORT
37 Main capabilities:
37 Main capabilities:
38 batch
38 batch
39 branchmap
39 branchmap
40 $USUAL_BUNDLE2_CAPS_SERVER$
40 $USUAL_BUNDLE2_CAPS_SERVER$
41 changegroupsubset
41 changegroupsubset
42 compression=$BUNDLE2_COMPRESSIONS$
42 compression=$BUNDLE2_COMPRESSIONS$
43 getbundle
43 getbundle
44 httpheader=1024
44 httpheader=1024
45 httpmediatype=0.1rx,0.1tx,0.2tx
45 httpmediatype=0.1rx,0.1tx,0.2tx
46 known
46 known
47 lookup
47 lookup
48 pushkey
48 pushkey
49 unbundle=HG10GZ,HG10BZ,HG10UN
49 unbundle=HG10GZ,HG10BZ,HG10UN
50 unbundlehash
50 unbundlehash
51 Bundle2 capabilities:
51 Bundle2 capabilities:
52 HG20
52 HG20
53 bookmarks
53 bookmarks
54 changegroup
54 changegroup
55 01
55 01
56 02
56 02
57 checkheads
57 checkheads
58 related
58 related
59 digests
59 digests
60 md5
60 md5
61 sha1
61 sha1
62 sha512
62 sha512
63 error
63 error
64 abort
64 abort
65 unsupportedcontent
65 unsupportedcontent
66 pushraced
66 pushraced
67 pushkey
67 pushkey
68 hgtagsfnodes
68 hgtagsfnodes
69 listkeys
69 listkeys
70 phases
70 phases
71 heads
71 heads
72 pushkey
72 pushkey
73 remote-changegroup
73 remote-changegroup
74 http
74 http
75 https
75 https
76 rev-branch-cache
76 rev-branch-cache
77
77
78 $ hg clone --stream -U http://localhost:$HGPORT server-disabled
78 $ hg clone --stream -U http://localhost:$HGPORT server-disabled
79 warning: stream clone requested but server has them disabled
79 warning: stream clone requested but server has them disabled
80 requesting all changes
80 requesting all changes
81 adding changesets
81 adding changesets
82 adding manifests
82 adding manifests
83 adding file changes
83 adding file changes
84 added 2 changesets with 1025 changes to 1025 files
84 added 2 changesets with 1025 changes to 1025 files
85 new changesets 96ee1d7354c4:c17445101a72
85 new changesets 96ee1d7354c4:c17445101a72
86
86
87 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto 0.2 --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
87 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto 0.2 --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
88 200 Script output follows
88 200 Script output follows
89 content-type: application/mercurial-0.2
89 content-type: application/mercurial-0.2
90
90
91
91
92 $ f --size body --hexdump --bytes 100
92 $ f --size body --hexdump --bytes 100
93 body: size=232
93 body: size=232
94 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
94 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
95 0010: cf 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |..ERROR:ABORT...|
95 0010: cf 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |..ERROR:ABORT...|
96 0020: 00 01 01 07 3c 04 72 6d 65 73 73 61 67 65 73 74 |....<.rmessagest|
96 0020: 00 01 01 07 3c 04 72 6d 65 73 73 61 67 65 73 74 |....<.rmessagest|
97 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques|
97 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques|
98 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d|
98 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d|
99 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th|
99 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th|
100 0060: 69 73 20 66 |is f|
100 0060: 69 73 20 66 |is f|
101
101
102 #endif
102 #endif
103 #if stream-bundle2
103 #if stream-bundle2
104 $ hg debugcapabilities http://localhost:$HGPORT
104 $ hg debugcapabilities http://localhost:$HGPORT
105 Main capabilities:
105 Main capabilities:
106 batch
106 batch
107 branchmap
107 branchmap
108 $USUAL_BUNDLE2_CAPS_SERVER$
108 $USUAL_BUNDLE2_CAPS_SERVER$
109 changegroupsubset
109 changegroupsubset
110 compression=$BUNDLE2_COMPRESSIONS$
110 compression=$BUNDLE2_COMPRESSIONS$
111 getbundle
111 getbundle
112 httpheader=1024
112 httpheader=1024
113 httpmediatype=0.1rx,0.1tx,0.2tx
113 httpmediatype=0.1rx,0.1tx,0.2tx
114 known
114 known
115 lookup
115 lookup
116 pushkey
116 pushkey
117 unbundle=HG10GZ,HG10BZ,HG10UN
117 unbundle=HG10GZ,HG10BZ,HG10UN
118 unbundlehash
118 unbundlehash
119 Bundle2 capabilities:
119 Bundle2 capabilities:
120 HG20
120 HG20
121 bookmarks
121 bookmarks
122 changegroup
122 changegroup
123 01
123 01
124 02
124 02
125 checkheads
125 checkheads
126 related
126 related
127 digests
127 digests
128 md5
128 md5
129 sha1
129 sha1
130 sha512
130 sha512
131 error
131 error
132 abort
132 abort
133 unsupportedcontent
133 unsupportedcontent
134 pushraced
134 pushraced
135 pushkey
135 pushkey
136 hgtagsfnodes
136 hgtagsfnodes
137 listkeys
137 listkeys
138 phases
138 phases
139 heads
139 heads
140 pushkey
140 pushkey
141 remote-changegroup
141 remote-changegroup
142 http
142 http
143 https
143 https
144 rev-branch-cache
144 rev-branch-cache
145
145
146 $ hg clone --stream -U http://localhost:$HGPORT server-disabled
146 $ hg clone --stream -U http://localhost:$HGPORT server-disabled
147 warning: stream clone requested but server has them disabled
147 warning: stream clone requested but server has them disabled
148 requesting all changes
148 requesting all changes
149 adding changesets
149 adding changesets
150 adding manifests
150 adding manifests
151 adding file changes
151 adding file changes
152 added 2 changesets with 1025 changes to 1025 files
152 added 2 changesets with 1025 changes to 1025 files
153 new changesets 96ee1d7354c4:c17445101a72
153 new changesets 96ee1d7354c4:c17445101a72
154
154
155 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto 0.2 --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
155 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto 0.2 --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
156 200 Script output follows
156 200 Script output follows
157 content-type: application/mercurial-0.2
157 content-type: application/mercurial-0.2
158
158
159
159
160 $ f --size body --hexdump --bytes 100
160 $ f --size body --hexdump --bytes 100
161 body: size=232
161 body: size=232
162 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
162 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
163 0010: cf 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |..ERROR:ABORT...|
163 0010: cf 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |..ERROR:ABORT...|
164 0020: 00 01 01 07 3c 04 72 6d 65 73 73 61 67 65 73 74 |....<.rmessagest|
164 0020: 00 01 01 07 3c 04 72 6d 65 73 73 61 67 65 73 74 |....<.rmessagest|
165 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques|
165 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques|
166 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d|
166 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d|
167 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th|
167 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th|
168 0060: 69 73 20 66 |is f|
168 0060: 69 73 20 66 |is f|
169
169
170 #endif
170 #endif
171
171
172 $ killdaemons.py
172 $ killdaemons.py
173 $ cd server
173 $ cd server
174 $ hg serve -p $HGPORT -d --pid-file=hg.pid
174 $ hg serve -p $HGPORT -d --pid-file=hg.pid
175 $ cat hg.pid > $DAEMON_PIDS
175 $ cat hg.pid > $DAEMON_PIDS
176 $ cd ..
176 $ cd ..
177
177
178 Basic clone
178 Basic clone
179
179
180 #if stream-legacy
180 #if stream-legacy
181 $ hg clone --stream -U http://localhost:$HGPORT clone1
181 $ hg clone --stream -U http://localhost:$HGPORT clone1
182 streaming all changes
182 streaming all changes
183 1027 files to transfer, 96.3 KB of data
183 1027 files to transfer, 96.3 KB of data
184 transferred 96.3 KB in * seconds (*/sec) (glob)
184 transferred 96.3 KB in * seconds (*/sec) (glob)
185 searching for changes
185 searching for changes
186 no changes found
186 no changes found
187 #endif
187 #endif
188 #if stream-bundle2
188 #if stream-bundle2
189 $ hg clone --stream -U http://localhost:$HGPORT clone1
189 $ hg clone --stream -U http://localhost:$HGPORT clone1
190 streaming all changes
190 streaming all changes
191 1030 files to transfer, 96.5 KB of data
191 1030 files to transfer, 96.5 KB of data
192 transferred 96.5 KB in * seconds (* */sec) (glob)
192 transferred 96.5 KB in * seconds (* */sec) (glob)
193
193
194 $ ls -1 clone1/.hg/cache
194 $ ls -1 clone1/.hg/cache
195 branch2-served
195 branch2-served
196 rbc-names-v1
196 rbc-names-v1
197 rbc-revs-v1
197 rbc-revs-v1
198 #endif
198 #endif
199
199
200 getbundle requests with stream=1 are uncompressed
200 getbundle requests with stream=1 are uncompressed
201
201
202 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto '0.1 0.2 comp=zlib,none' --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
202 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto '0.1 0.2 comp=zlib,none' --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
203 200 Script output follows
203 200 Script output follows
204 content-type: application/mercurial-0.2
204 content-type: application/mercurial-0.2
205
205
206
206
207 $ f --size --hex --bytes 256 body
207 $ f --size --hex --bytes 256 body
208 body: size=112262
208 body: size=112262
209 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
209 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
210 0010: 7f 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |..STREAM2.......|
210 0010: 7f 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |..STREAM2.......|
211 0020: 05 09 04 0c 44 62 79 74 65 63 6f 75 6e 74 39 38 |....Dbytecount98|
211 0020: 05 09 04 0c 44 62 79 74 65 63 6f 75 6e 74 39 38 |....Dbytecount98|
212 0030: 37 37 35 66 69 6c 65 63 6f 75 6e 74 31 30 33 30 |775filecount1030|
212 0030: 37 37 35 66 69 6c 65 63 6f 75 6e 74 31 30 33 30 |775filecount1030|
213 0040: 72 65 71 75 69 72 65 6d 65 6e 74 73 64 6f 74 65 |requirementsdote|
213 0040: 72 65 71 75 69 72 65 6d 65 6e 74 73 64 6f 74 65 |requirementsdote|
214 0050: 6e 63 6f 64 65 25 32 43 66 6e 63 61 63 68 65 25 |ncode%2Cfncache%|
214 0050: 6e 63 6f 64 65 25 32 43 66 6e 63 61 63 68 65 25 |ncode%2Cfncache%|
215 0060: 32 43 67 65 6e 65 72 61 6c 64 65 6c 74 61 25 32 |2Cgeneraldelta%2|
215 0060: 32 43 67 65 6e 65 72 61 6c 64 65 6c 74 61 25 32 |2Cgeneraldelta%2|
216 0070: 43 72 65 76 6c 6f 67 76 31 25 32 43 73 70 61 72 |Crevlogv1%2Cspar|
216 0070: 43 72 65 76 6c 6f 67 76 31 25 32 43 73 70 61 72 |Crevlogv1%2Cspar|
217 0080: 73 65 72 65 76 6c 6f 67 25 32 43 73 74 6f 72 65 |serevlog%2Cstore|
217 0080: 73 65 72 65 76 6c 6f 67 25 32 43 73 74 6f 72 65 |serevlog%2Cstore|
218 0090: 00 00 80 00 73 08 42 64 61 74 61 2f 30 2e 69 00 |....s.Bdata/0.i.|
218 0090: 00 00 80 00 73 08 42 64 61 74 61 2f 30 2e 69 00 |....s.Bdata/0.i.|
219 00a0: 03 00 01 00 00 00 00 00 00 00 02 00 00 00 01 00 |................|
219 00a0: 03 00 01 00 00 00 00 00 00 00 02 00 00 00 01 00 |................|
220 00b0: 00 00 00 00 00 00 01 ff ff ff ff ff ff ff ff 80 |................|
220 00b0: 00 00 00 00 00 00 01 ff ff ff ff ff ff ff ff 80 |................|
221 00c0: 29 63 a0 49 d3 23 87 bf ce fe 56 67 92 67 2c 69 |)c.I.#....Vg.g,i|
221 00c0: 29 63 a0 49 d3 23 87 bf ce fe 56 67 92 67 2c 69 |)c.I.#....Vg.g,i|
222 00d0: d1 ec 39 00 00 00 00 00 00 00 00 00 00 00 00 75 |..9............u|
222 00d0: d1 ec 39 00 00 00 00 00 00 00 00 00 00 00 00 75 |..9............u|
223 00e0: 30 73 08 42 64 61 74 61 2f 31 2e 69 00 03 00 01 |0s.Bdata/1.i....|
223 00e0: 30 73 08 42 64 61 74 61 2f 31 2e 69 00 03 00 01 |0s.Bdata/1.i....|
224 00f0: 00 00 00 00 00 00 00 02 00 00 00 01 00 00 00 00 |................|
224 00f0: 00 00 00 00 00 00 00 02 00 00 00 01 00 00 00 00 |................|
225
225
226 --uncompressed is an alias to --stream
226 --uncompressed is an alias to --stream
227
227
228 #if stream-legacy
228 #if stream-legacy
229 $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed
229 $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed
230 streaming all changes
230 streaming all changes
231 1027 files to transfer, 96.3 KB of data
231 1027 files to transfer, 96.3 KB of data
232 transferred 96.3 KB in * seconds (*/sec) (glob)
232 transferred 96.3 KB in * seconds (*/sec) (glob)
233 searching for changes
233 searching for changes
234 no changes found
234 no changes found
235 #endif
235 #endif
236 #if stream-bundle2
236 #if stream-bundle2
237 $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed
237 $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed
238 streaming all changes
238 streaming all changes
239 1030 files to transfer, 96.5 KB of data
239 1030 files to transfer, 96.5 KB of data
240 transferred 96.5 KB in * seconds (* */sec) (glob)
240 transferred 96.5 KB in * seconds (* */sec) (glob)
241 #endif
241 #endif
242
242
243 Clone with background file closing enabled
243 Clone with background file closing enabled
244
244
245 #if stream-legacy
245 #if stream-legacy
246 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding
246 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding
247 using http://localhost:$HGPORT/
247 using http://localhost:$HGPORT/
248 sending capabilities command
248 sending capabilities command
249 sending branchmap command
249 sending branchmap command
250 streaming all changes
250 streaming all changes
251 sending stream_out command
251 sending stream_out command
252 1027 files to transfer, 96.3 KB of data
252 1027 files to transfer, 96.3 KB of data
253 starting 4 threads for background file closing
253 starting 4 threads for background file closing
254 updating the branch cache
254 updating the branch cache
255 transferred 96.3 KB in * seconds (*/sec) (glob)
255 transferred 96.3 KB in * seconds (*/sec) (glob)
256 query 1; heads
256 query 1; heads
257 sending batch command
257 sending batch command
258 searching for changes
258 searching for changes
259 all remote heads known locally
259 all remote heads known locally
260 no changes found
260 no changes found
261 sending getbundle command
261 sending getbundle command
262 bundle2-input-bundle: with-transaction
262 bundle2-input-bundle: with-transaction
263 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
263 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
264 bundle2-input-part: "phase-heads" supported
264 bundle2-input-part: "phase-heads" supported
265 bundle2-input-part: total payload size 24
265 bundle2-input-part: total payload size 24
266 bundle2-input-bundle: 2 parts total
266 bundle2-input-bundle: 2 parts total
267 checking for updated bookmarks
267 checking for updated bookmarks
268 (sent 5 HTTP requests and * bytes; received * bytes in responses) (glob)
268 (sent 5 HTTP requests and * bytes; received * bytes in responses) (glob)
269 #endif
269 #endif
270 #if stream-bundle2
270 #if stream-bundle2
271 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding
271 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding
272 using http://localhost:$HGPORT/
272 using http://localhost:$HGPORT/
273 sending capabilities command
273 sending capabilities command
274 query 1; heads
274 query 1; heads
275 sending batch command
275 sending batch command
276 streaming all changes
276 streaming all changes
277 sending getbundle command
277 sending getbundle command
278 bundle2-input-bundle: with-transaction
278 bundle2-input-bundle: with-transaction
279 bundle2-input-part: "stream2" (params: 3 mandatory) supported
279 bundle2-input-part: "stream2" (params: 3 mandatory) supported
280 applying stream bundle
280 applying stream bundle
281 1030 files to transfer, 96.5 KB of data
281 1030 files to transfer, 96.5 KB of data
282 starting 4 threads for background file closing
282 starting 4 threads for background file closing
283 starting 4 threads for background file closing
283 starting 4 threads for background file closing
284 updating the branch cache
284 updating the branch cache
285 transferred 96.5 KB in * seconds (* */sec) (glob)
285 transferred 96.5 KB in * seconds (* */sec) (glob)
286 bundle2-input-part: total payload size 112094
286 bundle2-input-part: total payload size 112094
287 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
287 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
288 bundle2-input-bundle: 2 parts total
288 bundle2-input-bundle: 2 parts total
289 checking for updated bookmarks
289 checking for updated bookmarks
290 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
290 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
291 #endif
291 #endif
292
292
293 Cannot stream clone when there are secret changesets
293 Cannot stream clone when there are secret changesets
294
294
295 $ hg -R server phase --force --secret -r tip
295 $ hg -R server phase --force --secret -r tip
296 $ hg clone --stream -U http://localhost:$HGPORT secret-denied
296 $ hg clone --stream -U http://localhost:$HGPORT secret-denied
297 warning: stream clone requested but server has them disabled
297 warning: stream clone requested but server has them disabled
298 requesting all changes
298 requesting all changes
299 adding changesets
299 adding changesets
300 adding manifests
300 adding manifests
301 adding file changes
301 adding file changes
302 added 1 changesets with 1 changes to 1 files
302 added 1 changesets with 1 changes to 1 files
303 new changesets 96ee1d7354c4
303 new changesets 96ee1d7354c4
304
304
305 $ killdaemons.py
305 $ killdaemons.py
306
306
307 Streaming of secrets can be overridden by server config
307 Streaming of secrets can be overridden by server config
308
308
309 $ cd server
309 $ cd server
310 $ hg serve --config server.uncompressedallowsecret=true -p $HGPORT -d --pid-file=hg.pid
310 $ hg serve --config server.uncompressedallowsecret=true -p $HGPORT -d --pid-file=hg.pid
311 $ cat hg.pid > $DAEMON_PIDS
311 $ cat hg.pid > $DAEMON_PIDS
312 $ cd ..
312 $ cd ..
313
313
314 #if stream-legacy
314 #if stream-legacy
315 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
315 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
316 streaming all changes
316 streaming all changes
317 1027 files to transfer, 96.3 KB of data
317 1027 files to transfer, 96.3 KB of data
318 transferred 96.3 KB in * seconds (*/sec) (glob)
318 transferred 96.3 KB in * seconds (*/sec) (glob)
319 searching for changes
319 searching for changes
320 no changes found
320 no changes found
321 #endif
321 #endif
322 #if stream-bundle2
322 #if stream-bundle2
323 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
323 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
324 streaming all changes
324 streaming all changes
325 1030 files to transfer, 96.5 KB of data
325 1030 files to transfer, 96.5 KB of data
326 transferred 96.5 KB in * seconds (* */sec) (glob)
326 transferred 96.5 KB in * seconds (* */sec) (glob)
327 #endif
327 #endif
328
328
329 $ killdaemons.py
329 $ killdaemons.py
330
330
331 Verify interaction between preferuncompressed and secret presence
331 Verify interaction between preferuncompressed and secret presence
332
332
333 $ cd server
333 $ cd server
334 $ hg serve --config server.preferuncompressed=true -p $HGPORT -d --pid-file=hg.pid
334 $ hg serve --config server.preferuncompressed=true -p $HGPORT -d --pid-file=hg.pid
335 $ cat hg.pid > $DAEMON_PIDS
335 $ cat hg.pid > $DAEMON_PIDS
336 $ cd ..
336 $ cd ..
337
337
338 $ hg clone -U http://localhost:$HGPORT preferuncompressed-secret
338 $ hg clone -U http://localhost:$HGPORT preferuncompressed-secret
339 requesting all changes
339 requesting all changes
340 adding changesets
340 adding changesets
341 adding manifests
341 adding manifests
342 adding file changes
342 adding file changes
343 added 1 changesets with 1 changes to 1 files
343 added 1 changesets with 1 changes to 1 files
344 new changesets 96ee1d7354c4
344 new changesets 96ee1d7354c4
345
345
346 $ killdaemons.py
346 $ killdaemons.py
347
347
348 Clone not allowed when full bundles disabled and can't serve secrets
348 Clone not allowed when full bundles disabled and can't serve secrets
349
349
350 $ cd server
350 $ cd server
351 $ hg serve --config server.disablefullbundle=true -p $HGPORT -d --pid-file=hg.pid
351 $ hg serve --config server.disablefullbundle=true -p $HGPORT -d --pid-file=hg.pid
352 $ cat hg.pid > $DAEMON_PIDS
352 $ cat hg.pid > $DAEMON_PIDS
353 $ cd ..
353 $ cd ..
354
354
355 $ hg clone --stream http://localhost:$HGPORT secret-full-disabled
355 $ hg clone --stream http://localhost:$HGPORT secret-full-disabled
356 warning: stream clone requested but server has them disabled
356 warning: stream clone requested but server has them disabled
357 requesting all changes
357 requesting all changes
358 remote: abort: server has pull-based clones disabled
358 remote: abort: server has pull-based clones disabled
359 abort: pull failed on remote
359 abort: pull failed on remote
360 (remove --pull if specified or upgrade Mercurial)
360 (remove --pull if specified or upgrade Mercurial)
361 [255]
361 [255]
362
362
363 Local stream clone with secrets involved
363 Local stream clone with secrets involved
364 (This is just a test over behavior: if you have access to the repo's files,
364 (This is just a test over behavior: if you have access to the repo's files,
365 there is no security so it isn't important to prevent a clone here.)
365 there is no security so it isn't important to prevent a clone here.)
366
366
367 $ hg clone -U --stream server local-secret
367 $ hg clone -U --stream server local-secret
368 warning: stream clone requested but server has them disabled
368 warning: stream clone requested but server has them disabled
369 requesting all changes
369 requesting all changes
370 adding changesets
370 adding changesets
371 adding manifests
371 adding manifests
372 adding file changes
372 adding file changes
373 added 1 changesets with 1 changes to 1 files
373 added 1 changesets with 1 changes to 1 files
374 new changesets 96ee1d7354c4
374 new changesets 96ee1d7354c4
375
375
376 Stream clone while repo is changing:
376 Stream clone while repo is changing:
377
377
378 $ mkdir changing
378 $ mkdir changing
379 $ cd changing
379 $ cd changing
380
380
381 extension for delaying the server process so we reliably can modify the repo
381 extension for delaying the server process so we reliably can modify the repo
382 while cloning
382 while cloning
383
383
384 $ cat > delayer.py <<EOF
384 $ cat > delayer.py <<EOF
385 > import time
385 > import time
386 > from mercurial import extensions, vfs
386 > from mercurial import extensions, vfs
387 > def __call__(orig, self, path, *args, **kwargs):
387 > def __call__(orig, self, path, *args, **kwargs):
388 > if path == 'data/f1.i':
388 > if path == 'data/f1.i':
389 > time.sleep(2)
389 > time.sleep(2)
390 > return orig(self, path, *args, **kwargs)
390 > return orig(self, path, *args, **kwargs)
391 > extensions.wrapfunction(vfs.vfs, '__call__', __call__)
391 > extensions.wrapfunction(vfs.vfs, '__call__', __call__)
392 > EOF
392 > EOF
393
393
394 prepare repo with small and big file to cover both code paths in emitrevlogdata
394 prepare repo with small and big file to cover both code paths in emitrevlogdata
395
395
396 $ hg init repo
396 $ hg init repo
397 $ touch repo/f1
397 $ touch repo/f1
398 $ $TESTDIR/seq.py 50000 > repo/f2
398 $ $TESTDIR/seq.py 50000 > repo/f2
399 $ hg -R repo ci -Aqm "0"
399 $ hg -R repo ci -Aqm "0"
400 $ hg serve -R repo -p $HGPORT1 -d --pid-file=hg.pid --config extensions.delayer=delayer.py
400 $ hg serve -R repo -p $HGPORT1 -d --pid-file=hg.pid --config extensions.delayer=delayer.py
401 $ cat hg.pid >> $DAEMON_PIDS
401 $ cat hg.pid >> $DAEMON_PIDS
402
402
403 clone while modifying the repo between stating file with write lock and
403 clone while modifying the repo between stating file with write lock and
404 actually serving file content
404 actually serving file content
405
405
406 $ hg clone -q --stream -U http://localhost:$HGPORT1 clone &
406 $ hg clone -q --stream -U http://localhost:$HGPORT1 clone &
407 $ sleep 1
407 $ sleep 1
408 $ echo >> repo/f1
408 $ echo >> repo/f1
409 $ echo >> repo/f2
409 $ echo >> repo/f2
410 $ hg -R repo ci -m "1" 2>/dev/null
410 $ hg -R repo ci -m "1" --config ui.timeout.warn=-1
411 $ wait
411 $ wait
412 $ hg -R clone id
412 $ hg -R clone id
413 000000000000
413 000000000000
414 $ cd ..
414 $ cd ..
415
415
416 Stream repository with bookmarks
416 Stream repository with bookmarks
417 --------------------------------
417 --------------------------------
418
418
419 (revert introduction of secret changeset)
419 (revert introduction of secret changeset)
420
420
421 $ hg -R server phase --draft 'secret()'
421 $ hg -R server phase --draft 'secret()'
422
422
423 add a bookmark
423 add a bookmark
424
424
425 $ hg -R server bookmark -r tip some-bookmark
425 $ hg -R server bookmark -r tip some-bookmark
426
426
427 clone it
427 clone it
428
428
429 #if stream-legacy
429 #if stream-legacy
430 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
430 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
431 streaming all changes
431 streaming all changes
432 1027 files to transfer, 96.3 KB of data
432 1027 files to transfer, 96.3 KB of data
433 transferred 96.3 KB in * seconds (*) (glob)
433 transferred 96.3 KB in * seconds (*) (glob)
434 searching for changes
434 searching for changes
435 no changes found
435 no changes found
436 updating to branch default
436 updating to branch default
437 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved
437 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved
438 #endif
438 #endif
439 #if stream-bundle2
439 #if stream-bundle2
440 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
440 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
441 streaming all changes
441 streaming all changes
442 1033 files to transfer, 96.6 KB of data
442 1033 files to transfer, 96.6 KB of data
443 transferred 96.6 KB in * seconds (* */sec) (glob)
443 transferred 96.6 KB in * seconds (* */sec) (glob)
444 updating to branch default
444 updating to branch default
445 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved
445 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved
446 #endif
446 #endif
447 $ hg -R with-bookmarks bookmarks
447 $ hg -R with-bookmarks bookmarks
448 some-bookmark 1:c17445101a72
448 some-bookmark 1:c17445101a72
449
449
450 Stream repository with phases
450 Stream repository with phases
451 -----------------------------
451 -----------------------------
452
452
453 Clone as publishing
453 Clone as publishing
454
454
455 $ hg -R server phase -r 'all()'
455 $ hg -R server phase -r 'all()'
456 0: draft
456 0: draft
457 1: draft
457 1: draft
458
458
459 #if stream-legacy
459 #if stream-legacy
460 $ hg clone --stream http://localhost:$HGPORT phase-publish
460 $ hg clone --stream http://localhost:$HGPORT phase-publish
461 streaming all changes
461 streaming all changes
462 1027 files to transfer, 96.3 KB of data
462 1027 files to transfer, 96.3 KB of data
463 transferred 96.3 KB in * seconds (*) (glob)
463 transferred 96.3 KB in * seconds (*) (glob)
464 searching for changes
464 searching for changes
465 no changes found
465 no changes found
466 updating to branch default
466 updating to branch default
467 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved
467 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved
468 #endif
468 #endif
469 #if stream-bundle2
469 #if stream-bundle2
470 $ hg clone --stream http://localhost:$HGPORT phase-publish
470 $ hg clone --stream http://localhost:$HGPORT phase-publish
471 streaming all changes
471 streaming all changes
472 1033 files to transfer, 96.6 KB of data
472 1033 files to transfer, 96.6 KB of data
473 transferred 96.6 KB in * seconds (* */sec) (glob)
473 transferred 96.6 KB in * seconds (* */sec) (glob)
474 updating to branch default
474 updating to branch default
475 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved
475 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved
476 #endif
476 #endif
477 $ hg -R phase-publish phase -r 'all()'
477 $ hg -R phase-publish phase -r 'all()'
478 0: public
478 0: public
479 1: public
479 1: public
480
480
481 Clone as non publishing
481 Clone as non publishing
482
482
483 $ cat << EOF >> server/.hg/hgrc
483 $ cat << EOF >> server/.hg/hgrc
484 > [phases]
484 > [phases]
485 > publish = False
485 > publish = False
486 > EOF
486 > EOF
487 $ killdaemons.py
487 $ killdaemons.py
488 $ hg -R server serve -p $HGPORT -d --pid-file=hg.pid
488 $ hg -R server serve -p $HGPORT -d --pid-file=hg.pid
489 $ cat hg.pid > $DAEMON_PIDS
489 $ cat hg.pid > $DAEMON_PIDS
490
490
491 #if stream-legacy
491 #if stream-legacy
492
492
493 With v1 of the stream protocol, changeset are always cloned as public. It make
493 With v1 of the stream protocol, changeset are always cloned as public. It make
494 stream v1 unsuitable for non-publishing repository.
494 stream v1 unsuitable for non-publishing repository.
495
495
496 $ hg clone --stream http://localhost:$HGPORT phase-no-publish
496 $ hg clone --stream http://localhost:$HGPORT phase-no-publish
497 streaming all changes
497 streaming all changes
498 1027 files to transfer, 96.3 KB of data
498 1027 files to transfer, 96.3 KB of data
499 transferred 96.3 KB in * seconds (*) (glob)
499 transferred 96.3 KB in * seconds (*) (glob)
500 searching for changes
500 searching for changes
501 no changes found
501 no changes found
502 updating to branch default
502 updating to branch default
503 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved
503 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved
504 $ hg -R phase-no-publish phase -r 'all()'
504 $ hg -R phase-no-publish phase -r 'all()'
505 0: public
505 0: public
506 1: public
506 1: public
507 #endif
507 #endif
508 #if stream-bundle2
508 #if stream-bundle2
509 $ hg clone --stream http://localhost:$HGPORT phase-no-publish
509 $ hg clone --stream http://localhost:$HGPORT phase-no-publish
510 streaming all changes
510 streaming all changes
511 1034 files to transfer, 96.7 KB of data
511 1034 files to transfer, 96.7 KB of data
512 transferred 96.7 KB in * seconds (* */sec) (glob)
512 transferred 96.7 KB in * seconds (* */sec) (glob)
513 updating to branch default
513 updating to branch default
514 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved
514 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved
515 $ hg -R phase-no-publish phase -r 'all()'
515 $ hg -R phase-no-publish phase -r 'all()'
516 0: draft
516 0: draft
517 1: draft
517 1: draft
518 #endif
518 #endif
519
519
520 $ killdaemons.py
520 $ killdaemons.py
521
521
522 #if stream-legacy
522 #if stream-legacy
523
523
524 With v1 of the stream protocol, changeset are always cloned as public. There's
524 With v1 of the stream protocol, changeset are always cloned as public. There's
525 no obsolescence markers exchange in stream v1.
525 no obsolescence markers exchange in stream v1.
526
526
527 #endif
527 #endif
528 #if stream-bundle2
528 #if stream-bundle2
529
529
530 Stream repository with obsolescence
530 Stream repository with obsolescence
531 -----------------------------------
531 -----------------------------------
532
532
533 Clone non-publishing with obsolescence
533 Clone non-publishing with obsolescence
534
534
535 $ cat >> $HGRCPATH << EOF
535 $ cat >> $HGRCPATH << EOF
536 > [experimental]
536 > [experimental]
537 > evolution=all
537 > evolution=all
538 > EOF
538 > EOF
539
539
540 $ cd server
540 $ cd server
541 $ echo foo > foo
541 $ echo foo > foo
542 $ hg -q commit -m 'about to be pruned'
542 $ hg -q commit -m 'about to be pruned'
543 $ hg debugobsolete `hg log -r . -T '{node}'` -d '0 0' -u test --record-parents
543 $ hg debugobsolete `hg log -r . -T '{node}'` -d '0 0' -u test --record-parents
544 1 new obsolescence markers
544 1 new obsolescence markers
545 obsoleted 1 changesets
545 obsoleted 1 changesets
546 $ hg up null -q
546 $ hg up null -q
547 $ hg log -T '{rev}: {phase}\n'
547 $ hg log -T '{rev}: {phase}\n'
548 1: draft
548 1: draft
549 0: draft
549 0: draft
550 $ hg serve -p $HGPORT -d --pid-file=hg.pid
550 $ hg serve -p $HGPORT -d --pid-file=hg.pid
551 $ cat hg.pid > $DAEMON_PIDS
551 $ cat hg.pid > $DAEMON_PIDS
552 $ cd ..
552 $ cd ..
553
553
554 $ hg clone -U --stream http://localhost:$HGPORT with-obsolescence
554 $ hg clone -U --stream http://localhost:$HGPORT with-obsolescence
555 streaming all changes
555 streaming all changes
556 1035 files to transfer, 97.1 KB of data
556 1035 files to transfer, 97.1 KB of data
557 transferred 97.1 KB in * seconds (* */sec) (glob)
557 transferred 97.1 KB in * seconds (* */sec) (glob)
558 $ hg -R with-obsolescence log -T '{rev}: {phase}\n'
558 $ hg -R with-obsolescence log -T '{rev}: {phase}\n'
559 1: draft
559 1: draft
560 0: draft
560 0: draft
561 $ hg debugobsolete -R with-obsolescence
561 $ hg debugobsolete -R with-obsolescence
562 50382b884f66690b7045cac93a540cba4d4c906f 0 {c17445101a72edac06facd130d14808dfbd5c7c2} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
562 50382b884f66690b7045cac93a540cba4d4c906f 0 {c17445101a72edac06facd130d14808dfbd5c7c2} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
563
563
564 $ hg clone -U --stream --config experimental.evolution=0 http://localhost:$HGPORT with-obsolescence-no-evolution
564 $ hg clone -U --stream --config experimental.evolution=0 http://localhost:$HGPORT with-obsolescence-no-evolution
565 streaming all changes
565 streaming all changes
566 remote: abort: server has obsolescence markers, but client cannot receive them via stream clone
566 remote: abort: server has obsolescence markers, but client cannot receive them via stream clone
567 abort: pull failed on remote
567 abort: pull failed on remote
568 [255]
568 [255]
569
569
570 $ killdaemons.py
570 $ killdaemons.py
571
571
572 #endif
572 #endif
General Comments 0
You need to be logged in to leave comments. Login now