##// END OF EJS Templates
tests: stabilize test-bundle.t on Windows...
Matt Harbison -
r42095:35e29a3a default
parent child Browse files
Show More
@@ -1,932 +1,933 b''
1 Setting up test
1 Setting up test
2
2
3 $ hg init test
3 $ hg init test
4 $ cd test
4 $ cd test
5 $ echo 0 > afile
5 $ echo 0 > afile
6 $ hg add afile
6 $ hg add afile
7 $ hg commit -m "0.0"
7 $ hg commit -m "0.0"
8 $ echo 1 >> afile
8 $ echo 1 >> afile
9 $ hg commit -m "0.1"
9 $ hg commit -m "0.1"
10 $ echo 2 >> afile
10 $ echo 2 >> afile
11 $ hg commit -m "0.2"
11 $ hg commit -m "0.2"
12 $ echo 3 >> afile
12 $ echo 3 >> afile
13 $ hg commit -m "0.3"
13 $ hg commit -m "0.3"
14 $ hg update -C 0
14 $ hg update -C 0
15 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
15 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
16 $ echo 1 >> afile
16 $ echo 1 >> afile
17 $ hg commit -m "1.1"
17 $ hg commit -m "1.1"
18 created new head
18 created new head
19 $ echo 2 >> afile
19 $ echo 2 >> afile
20 $ hg commit -m "1.2"
20 $ hg commit -m "1.2"
21 $ echo "a line" > fred
21 $ echo "a line" > fred
22 $ echo 3 >> afile
22 $ echo 3 >> afile
23 $ hg add fred
23 $ hg add fred
24 $ hg commit -m "1.3"
24 $ hg commit -m "1.3"
25 $ hg mv afile adifferentfile
25 $ hg mv afile adifferentfile
26 $ hg commit -m "1.3m"
26 $ hg commit -m "1.3m"
27 $ hg update -C 3
27 $ hg update -C 3
28 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
28 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
29 $ hg mv afile anotherfile
29 $ hg mv afile anotherfile
30 $ hg commit -m "0.3m"
30 $ hg commit -m "0.3m"
31 $ hg verify
31 $ hg verify
32 checking changesets
32 checking changesets
33 checking manifests
33 checking manifests
34 crosschecking files in changesets and manifests
34 crosschecking files in changesets and manifests
35 checking files
35 checking files
36 checked 9 changesets with 7 changes to 4 files
36 checked 9 changesets with 7 changes to 4 files
37 $ cd ..
37 $ cd ..
38 $ hg init empty
38 $ hg init empty
39
39
40 Bundle and phase
40 Bundle and phase
41
41
42 $ hg -R test phase --force --secret 0
42 $ hg -R test phase --force --secret 0
43 $ hg -R test bundle phase.hg empty
43 $ hg -R test bundle phase.hg empty
44 searching for changes
44 searching for changes
45 no changes found (ignored 9 secret changesets)
45 no changes found (ignored 9 secret changesets)
46 [1]
46 [1]
47 $ hg -R test phase --draft -r 'head()'
47 $ hg -R test phase --draft -r 'head()'
48
48
49 Bundle --all
49 Bundle --all
50
50
51 $ hg -R test bundle --all all.hg
51 $ hg -R test bundle --all all.hg
52 9 changesets found
52 9 changesets found
53
53
54 Bundle test to full.hg
54 Bundle test to full.hg
55
55
56 $ hg -R test bundle full.hg empty
56 $ hg -R test bundle full.hg empty
57 searching for changes
57 searching for changes
58 9 changesets found
58 9 changesets found
59
59
60 Unbundle full.hg in test
60 Unbundle full.hg in test
61
61
62 $ hg -R test unbundle full.hg
62 $ hg -R test unbundle full.hg
63 adding changesets
63 adding changesets
64 adding manifests
64 adding manifests
65 adding file changes
65 adding file changes
66 added 0 changesets with 0 changes to 4 files
66 added 0 changesets with 0 changes to 4 files
67 (run 'hg update' to get a working copy)
67 (run 'hg update' to get a working copy)
68
68
69 Verify empty
69 Verify empty
70
70
71 $ hg -R empty heads
71 $ hg -R empty heads
72 [1]
72 [1]
73 $ hg -R empty verify
73 $ hg -R empty verify
74 checking changesets
74 checking changesets
75 checking manifests
75 checking manifests
76 crosschecking files in changesets and manifests
76 crosschecking files in changesets and manifests
77 checking files
77 checking files
78 checked 0 changesets with 0 changes to 0 files
78 checked 0 changesets with 0 changes to 0 files
79
79
80 #if repobundlerepo
80 #if repobundlerepo
81
81
82 Pull full.hg into test (using --cwd)
82 Pull full.hg into test (using --cwd)
83
83
84 $ hg --cwd test pull ../full.hg
84 $ hg --cwd test pull ../full.hg
85 pulling from ../full.hg
85 pulling from ../full.hg
86 searching for changes
86 searching for changes
87 no changes found
87 no changes found
88
88
89 Verify that there are no leaked temporary files after pull (issue2797)
89 Verify that there are no leaked temporary files after pull (issue2797)
90
90
91 $ ls test/.hg | grep .hg10un
91 $ ls test/.hg | grep .hg10un
92 [1]
92 [1]
93
93
94 Pull full.hg into empty (using --cwd)
94 Pull full.hg into empty (using --cwd)
95
95
96 $ hg --cwd empty pull ../full.hg
96 $ hg --cwd empty pull ../full.hg
97 pulling from ../full.hg
97 pulling from ../full.hg
98 requesting all changes
98 requesting all changes
99 adding changesets
99 adding changesets
100 adding manifests
100 adding manifests
101 adding file changes
101 adding file changes
102 added 9 changesets with 7 changes to 4 files (+1 heads)
102 added 9 changesets with 7 changes to 4 files (+1 heads)
103 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
103 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
104 (run 'hg heads' to see heads, 'hg merge' to merge)
104 (run 'hg heads' to see heads, 'hg merge' to merge)
105
105
106 Rollback empty
106 Rollback empty
107
107
108 $ hg -R empty rollback
108 $ hg -R empty rollback
109 repository tip rolled back to revision -1 (undo pull)
109 repository tip rolled back to revision -1 (undo pull)
110
110
111 Pull full.hg into empty again (using --cwd)
111 Pull full.hg into empty again (using --cwd)
112
112
113 $ hg --cwd empty pull ../full.hg
113 $ hg --cwd empty pull ../full.hg
114 pulling from ../full.hg
114 pulling from ../full.hg
115 requesting all changes
115 requesting all changes
116 adding changesets
116 adding changesets
117 adding manifests
117 adding manifests
118 adding file changes
118 adding file changes
119 added 9 changesets with 7 changes to 4 files (+1 heads)
119 added 9 changesets with 7 changes to 4 files (+1 heads)
120 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
120 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
121 (run 'hg heads' to see heads, 'hg merge' to merge)
121 (run 'hg heads' to see heads, 'hg merge' to merge)
122
122
123 Pull full.hg into test (using -R)
123 Pull full.hg into test (using -R)
124
124
125 $ hg -R test pull full.hg
125 $ hg -R test pull full.hg
126 pulling from full.hg
126 pulling from full.hg
127 searching for changes
127 searching for changes
128 no changes found
128 no changes found
129
129
130 Pull full.hg into empty (using -R)
130 Pull full.hg into empty (using -R)
131
131
132 $ hg -R empty pull full.hg
132 $ hg -R empty pull full.hg
133 pulling from full.hg
133 pulling from full.hg
134 searching for changes
134 searching for changes
135 no changes found
135 no changes found
136
136
137 Rollback empty
137 Rollback empty
138
138
139 $ hg -R empty rollback
139 $ hg -R empty rollback
140 repository tip rolled back to revision -1 (undo pull)
140 repository tip rolled back to revision -1 (undo pull)
141
141
142 Pull full.hg into empty again (using -R)
142 Pull full.hg into empty again (using -R)
143
143
144 $ hg -R empty pull full.hg
144 $ hg -R empty pull full.hg
145 pulling from full.hg
145 pulling from full.hg
146 requesting all changes
146 requesting all changes
147 adding changesets
147 adding changesets
148 adding manifests
148 adding manifests
149 adding file changes
149 adding file changes
150 added 9 changesets with 7 changes to 4 files (+1 heads)
150 added 9 changesets with 7 changes to 4 files (+1 heads)
151 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
151 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
152 (run 'hg heads' to see heads, 'hg merge' to merge)
152 (run 'hg heads' to see heads, 'hg merge' to merge)
153
153
154 Log -R full.hg in fresh empty
154 Log -R full.hg in fresh empty
155
155
156 $ rm -r empty
156 $ rm -r empty
157 $ hg init empty
157 $ hg init empty
158 $ cd empty
158 $ cd empty
159 $ hg -R bundle://../full.hg log
159 $ hg -R bundle://../full.hg log
160 changeset: 8:aa35859c02ea
160 changeset: 8:aa35859c02ea
161 tag: tip
161 tag: tip
162 parent: 3:eebf5a27f8ca
162 parent: 3:eebf5a27f8ca
163 user: test
163 user: test
164 date: Thu Jan 01 00:00:00 1970 +0000
164 date: Thu Jan 01 00:00:00 1970 +0000
165 summary: 0.3m
165 summary: 0.3m
166
166
167 changeset: 7:a6a34bfa0076
167 changeset: 7:a6a34bfa0076
168 user: test
168 user: test
169 date: Thu Jan 01 00:00:00 1970 +0000
169 date: Thu Jan 01 00:00:00 1970 +0000
170 summary: 1.3m
170 summary: 1.3m
171
171
172 changeset: 6:7373c1169842
172 changeset: 6:7373c1169842
173 user: test
173 user: test
174 date: Thu Jan 01 00:00:00 1970 +0000
174 date: Thu Jan 01 00:00:00 1970 +0000
175 summary: 1.3
175 summary: 1.3
176
176
177 changeset: 5:1bb50a9436a7
177 changeset: 5:1bb50a9436a7
178 user: test
178 user: test
179 date: Thu Jan 01 00:00:00 1970 +0000
179 date: Thu Jan 01 00:00:00 1970 +0000
180 summary: 1.2
180 summary: 1.2
181
181
182 changeset: 4:095197eb4973
182 changeset: 4:095197eb4973
183 parent: 0:f9ee2f85a263
183 parent: 0:f9ee2f85a263
184 user: test
184 user: test
185 date: Thu Jan 01 00:00:00 1970 +0000
185 date: Thu Jan 01 00:00:00 1970 +0000
186 summary: 1.1
186 summary: 1.1
187
187
188 changeset: 3:eebf5a27f8ca
188 changeset: 3:eebf5a27f8ca
189 user: test
189 user: test
190 date: Thu Jan 01 00:00:00 1970 +0000
190 date: Thu Jan 01 00:00:00 1970 +0000
191 summary: 0.3
191 summary: 0.3
192
192
193 changeset: 2:e38ba6f5b7e0
193 changeset: 2:e38ba6f5b7e0
194 user: test
194 user: test
195 date: Thu Jan 01 00:00:00 1970 +0000
195 date: Thu Jan 01 00:00:00 1970 +0000
196 summary: 0.2
196 summary: 0.2
197
197
198 changeset: 1:34c2bf6b0626
198 changeset: 1:34c2bf6b0626
199 user: test
199 user: test
200 date: Thu Jan 01 00:00:00 1970 +0000
200 date: Thu Jan 01 00:00:00 1970 +0000
201 summary: 0.1
201 summary: 0.1
202
202
203 changeset: 0:f9ee2f85a263
203 changeset: 0:f9ee2f85a263
204 user: test
204 user: test
205 date: Thu Jan 01 00:00:00 1970 +0000
205 date: Thu Jan 01 00:00:00 1970 +0000
206 summary: 0.0
206 summary: 0.0
207
207
208 Make sure bundlerepo doesn't leak tempfiles (issue2491)
208 Make sure bundlerepo doesn't leak tempfiles (issue2491)
209
209
210 $ ls .hg
210 $ ls .hg
211 00changelog.i
211 00changelog.i
212 cache
212 cache
213 requires
213 requires
214 store
214 store
215 wcache
215 wcache
216
216
217 Pull ../full.hg into empty (with hook)
217 Pull ../full.hg into empty (with hook)
218
218
219 $ cat >> .hg/hgrc <<EOF
219 $ cat >> .hg/hgrc <<EOF
220 > [hooks]
220 > [hooks]
221 > changegroup = sh -c "printenv.py --line changegroup"
221 > changegroup = sh -c "printenv.py --line changegroup"
222 > EOF
222 > EOF
223
223
224 doesn't work (yet ?)
224 doesn't work (yet ?)
225 NOTE: msys is mangling the URL below
225 NOTE: msys is mangling the URL below
226
226
227 hg -R bundle://../full.hg verify
227 hg -R bundle://../full.hg verify
228
228
229 $ hg pull bundle://../full.hg
229 $ hg pull bundle://../full.hg
230 pulling from bundle:../full.hg
230 pulling from bundle:../full.hg
231 requesting all changes
231 requesting all changes
232 adding changesets
232 adding changesets
233 adding manifests
233 adding manifests
234 adding file changes
234 adding file changes
235 added 9 changesets with 7 changes to 4 files (+1 heads)
235 added 9 changesets with 7 changes to 4 files (+1 heads)
236 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
236 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
237 changegroup hook: HG_HOOKNAME=changegroup
237 changegroup hook: HG_HOOKNAME=changegroup
238 HG_HOOKTYPE=changegroup
238 HG_HOOKTYPE=changegroup
239 HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735
239 HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735
240 HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf
240 HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf
241 HG_SOURCE=pull
241 HG_SOURCE=pull
242 HG_TXNID=TXN:$ID$
242 HG_TXNID=TXN:$ID$
243 HG_TXNNAME=pull
243 HG_TXNNAME=pull
244 bundle:../full.hg
244 bundle:../full.hg (no-msys !)
245 bundle;../full.hg (msys !)
245 HG_URL=bundle:../full.hg (no-msys !)
246 HG_URL=bundle:../full.hg (no-msys !)
246 HG_URL=bundle;../full.hg (msys !)
247 HG_URL=bundle;../full.hg (msys !)
247
248
248 (run 'hg heads' to see heads, 'hg merge' to merge)
249 (run 'hg heads' to see heads, 'hg merge' to merge)
249
250
250 Rollback empty
251 Rollback empty
251
252
252 $ hg rollback
253 $ hg rollback
253 repository tip rolled back to revision -1 (undo pull)
254 repository tip rolled back to revision -1 (undo pull)
254 $ cd ..
255 $ cd ..
255
256
256 Log -R bundle:empty+full.hg
257 Log -R bundle:empty+full.hg
257
258
258 $ hg -R bundle:empty+full.hg log --template="{rev} "; echo ""
259 $ hg -R bundle:empty+full.hg log --template="{rev} "; echo ""
259 8 7 6 5 4 3 2 1 0
260 8 7 6 5 4 3 2 1 0
260
261
261 Pull full.hg into empty again (using -R; with hook)
262 Pull full.hg into empty again (using -R; with hook)
262
263
263 $ hg -R empty pull full.hg
264 $ hg -R empty pull full.hg
264 pulling from full.hg
265 pulling from full.hg
265 requesting all changes
266 requesting all changes
266 adding changesets
267 adding changesets
267 adding manifests
268 adding manifests
268 adding file changes
269 adding file changes
269 added 9 changesets with 7 changes to 4 files (+1 heads)
270 added 9 changesets with 7 changes to 4 files (+1 heads)
270 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
271 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
271 changegroup hook: HG_HOOKNAME=changegroup
272 changegroup hook: HG_HOOKNAME=changegroup
272 HG_HOOKTYPE=changegroup
273 HG_HOOKTYPE=changegroup
273 HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735
274 HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735
274 HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf
275 HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf
275 HG_SOURCE=pull
276 HG_SOURCE=pull
276 HG_TXNID=TXN:$ID$
277 HG_TXNID=TXN:$ID$
277 HG_TXNNAME=pull
278 HG_TXNNAME=pull
278 bundle:empty+full.hg
279 bundle:empty+full.hg
279 HG_URL=bundle:empty+full.hg
280 HG_URL=bundle:empty+full.hg
280
281
281 (run 'hg heads' to see heads, 'hg merge' to merge)
282 (run 'hg heads' to see heads, 'hg merge' to merge)
282
283
283 #endif
284 #endif
284
285
285 Cannot produce streaming clone bundles with "hg bundle"
286 Cannot produce streaming clone bundles with "hg bundle"
286
287
287 $ hg -R test bundle -t packed1 packed.hg
288 $ hg -R test bundle -t packed1 packed.hg
288 abort: packed bundles cannot be produced by "hg bundle"
289 abort: packed bundles cannot be produced by "hg bundle"
289 (use 'hg debugcreatestreamclonebundle')
290 (use 'hg debugcreatestreamclonebundle')
290 [255]
291 [255]
291
292
292 packed1 is produced properly
293 packed1 is produced properly
293
294
294 #if reporevlogstore
295 #if reporevlogstore
295
296
296 $ hg -R test debugcreatestreamclonebundle packed.hg
297 $ hg -R test debugcreatestreamclonebundle packed.hg
297 writing 2664 bytes for 6 files
298 writing 2664 bytes for 6 files
298 bundle requirements: generaldelta, revlogv1, sparserevlog
299 bundle requirements: generaldelta, revlogv1, sparserevlog
299
300
300 $ f -B 64 --size --sha1 --hexdump packed.hg
301 $ f -B 64 --size --sha1 --hexdump packed.hg
301 packed.hg: size=2840, sha1=12bf3eee3eb8a04c503ce2d29b48f0135c7edff5
302 packed.hg: size=2840, sha1=12bf3eee3eb8a04c503ce2d29b48f0135c7edff5
302 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 06 00 00 |HGS1UN..........|
303 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 06 00 00 |HGS1UN..........|
303 0010: 00 00 00 00 0a 68 00 23 67 65 6e 65 72 61 6c 64 |.....h.#generald|
304 0010: 00 00 00 00 0a 68 00 23 67 65 6e 65 72 61 6c 64 |.....h.#generald|
304 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 76 31 2c 73 70 |elta,revlogv1,sp|
305 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 76 31 2c 73 70 |elta,revlogv1,sp|
305 0030: 61 72 73 65 72 65 76 6c 6f 67 00 64 61 74 61 2f |arserevlog.data/|
306 0030: 61 72 73 65 72 65 76 6c 6f 67 00 64 61 74 61 2f |arserevlog.data/|
306
307
307 $ hg debugbundle --spec packed.hg
308 $ hg debugbundle --spec packed.hg
308 none-packed1;requirements%3Dgeneraldelta%2Crevlogv1%2Csparserevlog
309 none-packed1;requirements%3Dgeneraldelta%2Crevlogv1%2Csparserevlog
309
310
310 generaldelta requirement is not listed in stream clone bundles unless used
311 generaldelta requirement is not listed in stream clone bundles unless used
311
312
312 $ hg --config format.usegeneraldelta=false init testnongd
313 $ hg --config format.usegeneraldelta=false init testnongd
313 $ cd testnongd
314 $ cd testnongd
314 $ touch foo
315 $ touch foo
315 $ hg -q commit -A -m initial
316 $ hg -q commit -A -m initial
316 $ cd ..
317 $ cd ..
317 $ hg -R testnongd debugcreatestreamclonebundle packednongd.hg
318 $ hg -R testnongd debugcreatestreamclonebundle packednongd.hg
318 writing 301 bytes for 3 files
319 writing 301 bytes for 3 files
319 bundle requirements: revlogv1
320 bundle requirements: revlogv1
320
321
321 $ f -B 64 --size --sha1 --hexdump packednongd.hg
322 $ f -B 64 --size --sha1 --hexdump packednongd.hg
322 packednongd.hg: size=383, sha1=1d9c230238edd5d38907100b729ba72b1831fe6f
323 packednongd.hg: size=383, sha1=1d9c230238edd5d38907100b729ba72b1831fe6f
323 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 03 00 00 |HGS1UN..........|
324 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 03 00 00 |HGS1UN..........|
324 0010: 00 00 00 00 01 2d 00 09 72 65 76 6c 6f 67 76 31 |.....-..revlogv1|
325 0010: 00 00 00 00 01 2d 00 09 72 65 76 6c 6f 67 76 31 |.....-..revlogv1|
325 0020: 00 64 61 74 61 2f 66 6f 6f 2e 69 00 36 34 0a 00 |.data/foo.i.64..|
326 0020: 00 64 61 74 61 2f 66 6f 6f 2e 69 00 36 34 0a 00 |.data/foo.i.64..|
326 0030: 01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
327 0030: 01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
327
328
328 $ hg debugbundle --spec packednongd.hg
329 $ hg debugbundle --spec packednongd.hg
329 none-packed1;requirements%3Drevlogv1
330 none-packed1;requirements%3Drevlogv1
330
331
331 Warning emitted when packed bundles contain secret changesets
332 Warning emitted when packed bundles contain secret changesets
332
333
333 $ hg init testsecret
334 $ hg init testsecret
334 $ cd testsecret
335 $ cd testsecret
335 $ touch foo
336 $ touch foo
336 $ hg -q commit -A -m initial
337 $ hg -q commit -A -m initial
337 $ hg phase --force --secret -r .
338 $ hg phase --force --secret -r .
338 $ cd ..
339 $ cd ..
339
340
340 $ hg -R testsecret debugcreatestreamclonebundle packedsecret.hg
341 $ hg -R testsecret debugcreatestreamclonebundle packedsecret.hg
341 (warning: stream clone bundle will contain secret revisions)
342 (warning: stream clone bundle will contain secret revisions)
342 writing 301 bytes for 3 files
343 writing 301 bytes for 3 files
343 bundle requirements: generaldelta, revlogv1, sparserevlog
344 bundle requirements: generaldelta, revlogv1, sparserevlog
344
345
345 Unpacking packed1 bundles with "hg unbundle" isn't allowed
346 Unpacking packed1 bundles with "hg unbundle" isn't allowed
346
347
347 $ hg init packed
348 $ hg init packed
348 $ hg -R packed unbundle packed.hg
349 $ hg -R packed unbundle packed.hg
349 abort: packed bundles cannot be applied with "hg unbundle"
350 abort: packed bundles cannot be applied with "hg unbundle"
350 (use "hg debugapplystreamclonebundle")
351 (use "hg debugapplystreamclonebundle")
351 [255]
352 [255]
352
353
353 packed1 can be consumed from debug command
354 packed1 can be consumed from debug command
354
355
355 (this also confirms that streamclone-ed changes are visible via
356 (this also confirms that streamclone-ed changes are visible via
356 @filecache properties to in-process procedures before closing
357 @filecache properties to in-process procedures before closing
357 transaction)
358 transaction)
358
359
359 $ cat > $TESTTMP/showtip.py <<EOF
360 $ cat > $TESTTMP/showtip.py <<EOF
360 > from __future__ import absolute_import
361 > from __future__ import absolute_import
361 >
362 >
362 > def showtip(ui, repo, hooktype, **kwargs):
363 > def showtip(ui, repo, hooktype, **kwargs):
363 > ui.warn(b'%s: %s\n' % (hooktype, repo[b'tip'].hex()[:12]))
364 > ui.warn(b'%s: %s\n' % (hooktype, repo[b'tip'].hex()[:12]))
364 >
365 >
365 > def reposetup(ui, repo):
366 > def reposetup(ui, repo):
366 > # this confirms (and ensures) that (empty) 00changelog.i
367 > # this confirms (and ensures) that (empty) 00changelog.i
367 > # before streamclone is already cached as repo.changelog
368 > # before streamclone is already cached as repo.changelog
368 > ui.setconfig(b'hooks', b'pretxnopen.showtip', showtip)
369 > ui.setconfig(b'hooks', b'pretxnopen.showtip', showtip)
369 >
370 >
370 > # this confirms that streamclone-ed changes are visible to
371 > # this confirms that streamclone-ed changes are visible to
371 > # in-process procedures before closing transaction
372 > # in-process procedures before closing transaction
372 > ui.setconfig(b'hooks', b'pretxnclose.showtip', showtip)
373 > ui.setconfig(b'hooks', b'pretxnclose.showtip', showtip)
373 >
374 >
374 > # this confirms that streamclone-ed changes are still visible
375 > # this confirms that streamclone-ed changes are still visible
375 > # after closing transaction
376 > # after closing transaction
376 > ui.setconfig(b'hooks', b'txnclose.showtip', showtip)
377 > ui.setconfig(b'hooks', b'txnclose.showtip', showtip)
377 > EOF
378 > EOF
378 $ cat >> $HGRCPATH <<EOF
379 $ cat >> $HGRCPATH <<EOF
379 > [extensions]
380 > [extensions]
380 > showtip = $TESTTMP/showtip.py
381 > showtip = $TESTTMP/showtip.py
381 > EOF
382 > EOF
382
383
383 $ hg -R packed debugapplystreamclonebundle packed.hg
384 $ hg -R packed debugapplystreamclonebundle packed.hg
384 6 files to transfer, 2.60 KB of data
385 6 files to transfer, 2.60 KB of data
385 pretxnopen: 000000000000
386 pretxnopen: 000000000000
386 pretxnclose: aa35859c02ea
387 pretxnclose: aa35859c02ea
387 transferred 2.60 KB in *.* seconds (* */sec) (glob)
388 transferred 2.60 KB in *.* seconds (* */sec) (glob)
388 txnclose: aa35859c02ea
389 txnclose: aa35859c02ea
389
390
390 (for safety, confirm visibility of streamclone-ed changes by another
391 (for safety, confirm visibility of streamclone-ed changes by another
391 process, too)
392 process, too)
392
393
393 $ hg -R packed tip -T "{node|short}\n"
394 $ hg -R packed tip -T "{node|short}\n"
394 aa35859c02ea
395 aa35859c02ea
395
396
396 $ cat >> $HGRCPATH <<EOF
397 $ cat >> $HGRCPATH <<EOF
397 > [extensions]
398 > [extensions]
398 > showtip = !
399 > showtip = !
399 > EOF
400 > EOF
400
401
401 Does not work on non-empty repo
402 Does not work on non-empty repo
402
403
403 $ hg -R packed debugapplystreamclonebundle packed.hg
404 $ hg -R packed debugapplystreamclonebundle packed.hg
404 abort: cannot apply stream clone bundle on non-empty repo
405 abort: cannot apply stream clone bundle on non-empty repo
405 [255]
406 [255]
406
407
407 #endif
408 #endif
408
409
409 Create partial clones
410 Create partial clones
410
411
411 $ rm -r empty
412 $ rm -r empty
412 $ hg init empty
413 $ hg init empty
413 $ hg clone -r 3 test partial
414 $ hg clone -r 3 test partial
414 adding changesets
415 adding changesets
415 adding manifests
416 adding manifests
416 adding file changes
417 adding file changes
417 added 4 changesets with 4 changes to 1 files
418 added 4 changesets with 4 changes to 1 files
418 new changesets f9ee2f85a263:eebf5a27f8ca
419 new changesets f9ee2f85a263:eebf5a27f8ca
419 updating to branch default
420 updating to branch default
420 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
421 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
421 $ hg clone partial partial2
422 $ hg clone partial partial2
422 updating to branch default
423 updating to branch default
423 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
424 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
424 $ cd partial
425 $ cd partial
425
426
426 #if repobundlerepo
427 #if repobundlerepo
427
428
428 Log -R full.hg in partial
429 Log -R full.hg in partial
429
430
430 $ hg -R bundle://../full.hg log -T phases
431 $ hg -R bundle://../full.hg log -T phases
431 changeset: 8:aa35859c02ea
432 changeset: 8:aa35859c02ea
432 tag: tip
433 tag: tip
433 phase: draft
434 phase: draft
434 parent: 3:eebf5a27f8ca
435 parent: 3:eebf5a27f8ca
435 user: test
436 user: test
436 date: Thu Jan 01 00:00:00 1970 +0000
437 date: Thu Jan 01 00:00:00 1970 +0000
437 summary: 0.3m
438 summary: 0.3m
438
439
439 changeset: 7:a6a34bfa0076
440 changeset: 7:a6a34bfa0076
440 phase: draft
441 phase: draft
441 user: test
442 user: test
442 date: Thu Jan 01 00:00:00 1970 +0000
443 date: Thu Jan 01 00:00:00 1970 +0000
443 summary: 1.3m
444 summary: 1.3m
444
445
445 changeset: 6:7373c1169842
446 changeset: 6:7373c1169842
446 phase: draft
447 phase: draft
447 user: test
448 user: test
448 date: Thu Jan 01 00:00:00 1970 +0000
449 date: Thu Jan 01 00:00:00 1970 +0000
449 summary: 1.3
450 summary: 1.3
450
451
451 changeset: 5:1bb50a9436a7
452 changeset: 5:1bb50a9436a7
452 phase: draft
453 phase: draft
453 user: test
454 user: test
454 date: Thu Jan 01 00:00:00 1970 +0000
455 date: Thu Jan 01 00:00:00 1970 +0000
455 summary: 1.2
456 summary: 1.2
456
457
457 changeset: 4:095197eb4973
458 changeset: 4:095197eb4973
458 phase: draft
459 phase: draft
459 parent: 0:f9ee2f85a263
460 parent: 0:f9ee2f85a263
460 user: test
461 user: test
461 date: Thu Jan 01 00:00:00 1970 +0000
462 date: Thu Jan 01 00:00:00 1970 +0000
462 summary: 1.1
463 summary: 1.1
463
464
464 changeset: 3:eebf5a27f8ca
465 changeset: 3:eebf5a27f8ca
465 phase: public
466 phase: public
466 user: test
467 user: test
467 date: Thu Jan 01 00:00:00 1970 +0000
468 date: Thu Jan 01 00:00:00 1970 +0000
468 summary: 0.3
469 summary: 0.3
469
470
470 changeset: 2:e38ba6f5b7e0
471 changeset: 2:e38ba6f5b7e0
471 phase: public
472 phase: public
472 user: test
473 user: test
473 date: Thu Jan 01 00:00:00 1970 +0000
474 date: Thu Jan 01 00:00:00 1970 +0000
474 summary: 0.2
475 summary: 0.2
475
476
476 changeset: 1:34c2bf6b0626
477 changeset: 1:34c2bf6b0626
477 phase: public
478 phase: public
478 user: test
479 user: test
479 date: Thu Jan 01 00:00:00 1970 +0000
480 date: Thu Jan 01 00:00:00 1970 +0000
480 summary: 0.1
481 summary: 0.1
481
482
482 changeset: 0:f9ee2f85a263
483 changeset: 0:f9ee2f85a263
483 phase: public
484 phase: public
484 user: test
485 user: test
485 date: Thu Jan 01 00:00:00 1970 +0000
486 date: Thu Jan 01 00:00:00 1970 +0000
486 summary: 0.0
487 summary: 0.0
487
488
488
489
489 Incoming full.hg in partial
490 Incoming full.hg in partial
490
491
491 $ hg incoming bundle://../full.hg
492 $ hg incoming bundle://../full.hg
492 comparing with bundle:../full.hg
493 comparing with bundle:../full.hg
493 searching for changes
494 searching for changes
494 changeset: 4:095197eb4973
495 changeset: 4:095197eb4973
495 parent: 0:f9ee2f85a263
496 parent: 0:f9ee2f85a263
496 user: test
497 user: test
497 date: Thu Jan 01 00:00:00 1970 +0000
498 date: Thu Jan 01 00:00:00 1970 +0000
498 summary: 1.1
499 summary: 1.1
499
500
500 changeset: 5:1bb50a9436a7
501 changeset: 5:1bb50a9436a7
501 user: test
502 user: test
502 date: Thu Jan 01 00:00:00 1970 +0000
503 date: Thu Jan 01 00:00:00 1970 +0000
503 summary: 1.2
504 summary: 1.2
504
505
505 changeset: 6:7373c1169842
506 changeset: 6:7373c1169842
506 user: test
507 user: test
507 date: Thu Jan 01 00:00:00 1970 +0000
508 date: Thu Jan 01 00:00:00 1970 +0000
508 summary: 1.3
509 summary: 1.3
509
510
510 changeset: 7:a6a34bfa0076
511 changeset: 7:a6a34bfa0076
511 user: test
512 user: test
512 date: Thu Jan 01 00:00:00 1970 +0000
513 date: Thu Jan 01 00:00:00 1970 +0000
513 summary: 1.3m
514 summary: 1.3m
514
515
515 changeset: 8:aa35859c02ea
516 changeset: 8:aa35859c02ea
516 tag: tip
517 tag: tip
517 parent: 3:eebf5a27f8ca
518 parent: 3:eebf5a27f8ca
518 user: test
519 user: test
519 date: Thu Jan 01 00:00:00 1970 +0000
520 date: Thu Jan 01 00:00:00 1970 +0000
520 summary: 0.3m
521 summary: 0.3m
521
522
522
523
523 Outgoing -R full.hg vs partial2 in partial
524 Outgoing -R full.hg vs partial2 in partial
524
525
525 $ hg -R bundle://../full.hg outgoing ../partial2
526 $ hg -R bundle://../full.hg outgoing ../partial2
526 comparing with ../partial2
527 comparing with ../partial2
527 searching for changes
528 searching for changes
528 changeset: 4:095197eb4973
529 changeset: 4:095197eb4973
529 parent: 0:f9ee2f85a263
530 parent: 0:f9ee2f85a263
530 user: test
531 user: test
531 date: Thu Jan 01 00:00:00 1970 +0000
532 date: Thu Jan 01 00:00:00 1970 +0000
532 summary: 1.1
533 summary: 1.1
533
534
534 changeset: 5:1bb50a9436a7
535 changeset: 5:1bb50a9436a7
535 user: test
536 user: test
536 date: Thu Jan 01 00:00:00 1970 +0000
537 date: Thu Jan 01 00:00:00 1970 +0000
537 summary: 1.2
538 summary: 1.2
538
539
539 changeset: 6:7373c1169842
540 changeset: 6:7373c1169842
540 user: test
541 user: test
541 date: Thu Jan 01 00:00:00 1970 +0000
542 date: Thu Jan 01 00:00:00 1970 +0000
542 summary: 1.3
543 summary: 1.3
543
544
544 changeset: 7:a6a34bfa0076
545 changeset: 7:a6a34bfa0076
545 user: test
546 user: test
546 date: Thu Jan 01 00:00:00 1970 +0000
547 date: Thu Jan 01 00:00:00 1970 +0000
547 summary: 1.3m
548 summary: 1.3m
548
549
549 changeset: 8:aa35859c02ea
550 changeset: 8:aa35859c02ea
550 tag: tip
551 tag: tip
551 parent: 3:eebf5a27f8ca
552 parent: 3:eebf5a27f8ca
552 user: test
553 user: test
553 date: Thu Jan 01 00:00:00 1970 +0000
554 date: Thu Jan 01 00:00:00 1970 +0000
554 summary: 0.3m
555 summary: 0.3m
555
556
556
557
557 Outgoing -R does-not-exist.hg vs partial2 in partial
558 Outgoing -R does-not-exist.hg vs partial2 in partial
558
559
559 $ hg -R bundle://../does-not-exist.hg outgoing ../partial2
560 $ hg -R bundle://../does-not-exist.hg outgoing ../partial2
560 abort: *../does-not-exist.hg* (glob)
561 abort: *../does-not-exist.hg* (glob)
561 [255]
562 [255]
562
563
563 #endif
564 #endif
564
565
565 $ cd ..
566 $ cd ..
566
567
567 hide outer repo
568 hide outer repo
568 $ hg init
569 $ hg init
569
570
570 Direct clone from bundle (all-history)
571 Direct clone from bundle (all-history)
571
572
572 #if repobundlerepo
573 #if repobundlerepo
573
574
574 $ hg clone full.hg full-clone
575 $ hg clone full.hg full-clone
575 requesting all changes
576 requesting all changes
576 adding changesets
577 adding changesets
577 adding manifests
578 adding manifests
578 adding file changes
579 adding file changes
579 added 9 changesets with 7 changes to 4 files (+1 heads)
580 added 9 changesets with 7 changes to 4 files (+1 heads)
580 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
581 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
581 updating to branch default
582 updating to branch default
582 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
583 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
583 $ hg -R full-clone heads
584 $ hg -R full-clone heads
584 changeset: 8:aa35859c02ea
585 changeset: 8:aa35859c02ea
585 tag: tip
586 tag: tip
586 parent: 3:eebf5a27f8ca
587 parent: 3:eebf5a27f8ca
587 user: test
588 user: test
588 date: Thu Jan 01 00:00:00 1970 +0000
589 date: Thu Jan 01 00:00:00 1970 +0000
589 summary: 0.3m
590 summary: 0.3m
590
591
591 changeset: 7:a6a34bfa0076
592 changeset: 7:a6a34bfa0076
592 user: test
593 user: test
593 date: Thu Jan 01 00:00:00 1970 +0000
594 date: Thu Jan 01 00:00:00 1970 +0000
594 summary: 1.3m
595 summary: 1.3m
595
596
596 $ rm -r full-clone
597 $ rm -r full-clone
597
598
598 When cloning from a non-copiable repository into '', do not
599 When cloning from a non-copiable repository into '', do not
599 recurse infinitely (issue2528)
600 recurse infinitely (issue2528)
600
601
601 $ hg clone full.hg ''
602 $ hg clone full.hg ''
602 abort: empty destination path is not valid
603 abort: empty destination path is not valid
603 [255]
604 [255]
604
605
605 test for https://bz.mercurial-scm.org/216
606 test for https://bz.mercurial-scm.org/216
606
607
607 Unbundle incremental bundles into fresh empty in one go
608 Unbundle incremental bundles into fresh empty in one go
608
609
609 $ rm -r empty
610 $ rm -r empty
610 $ hg init empty
611 $ hg init empty
611 $ hg -R test bundle --base null -r 0 ../0.hg
612 $ hg -R test bundle --base null -r 0 ../0.hg
612 1 changesets found
613 1 changesets found
613 $ hg -R test bundle --base 0 -r 1 ../1.hg
614 $ hg -R test bundle --base 0 -r 1 ../1.hg
614 1 changesets found
615 1 changesets found
615 $ hg -R empty unbundle -u ../0.hg ../1.hg
616 $ hg -R empty unbundle -u ../0.hg ../1.hg
616 adding changesets
617 adding changesets
617 adding manifests
618 adding manifests
618 adding file changes
619 adding file changes
619 added 1 changesets with 1 changes to 1 files
620 added 1 changesets with 1 changes to 1 files
620 new changesets f9ee2f85a263 (1 drafts)
621 new changesets f9ee2f85a263 (1 drafts)
621 adding changesets
622 adding changesets
622 adding manifests
623 adding manifests
623 adding file changes
624 adding file changes
624 added 1 changesets with 1 changes to 1 files
625 added 1 changesets with 1 changes to 1 files
625 new changesets 34c2bf6b0626 (1 drafts)
626 new changesets 34c2bf6b0626 (1 drafts)
626 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
627 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
627
628
628 View full contents of the bundle
629 View full contents of the bundle
629 $ hg -R test bundle --base null -r 3 ../partial.hg
630 $ hg -R test bundle --base null -r 3 ../partial.hg
630 4 changesets found
631 4 changesets found
631 $ cd test
632 $ cd test
632 $ hg -R ../../partial.hg log -r "bundle()"
633 $ hg -R ../../partial.hg log -r "bundle()"
633 changeset: 0:f9ee2f85a263
634 changeset: 0:f9ee2f85a263
634 user: test
635 user: test
635 date: Thu Jan 01 00:00:00 1970 +0000
636 date: Thu Jan 01 00:00:00 1970 +0000
636 summary: 0.0
637 summary: 0.0
637
638
638 changeset: 1:34c2bf6b0626
639 changeset: 1:34c2bf6b0626
639 user: test
640 user: test
640 date: Thu Jan 01 00:00:00 1970 +0000
641 date: Thu Jan 01 00:00:00 1970 +0000
641 summary: 0.1
642 summary: 0.1
642
643
643 changeset: 2:e38ba6f5b7e0
644 changeset: 2:e38ba6f5b7e0
644 user: test
645 user: test
645 date: Thu Jan 01 00:00:00 1970 +0000
646 date: Thu Jan 01 00:00:00 1970 +0000
646 summary: 0.2
647 summary: 0.2
647
648
648 changeset: 3:eebf5a27f8ca
649 changeset: 3:eebf5a27f8ca
649 user: test
650 user: test
650 date: Thu Jan 01 00:00:00 1970 +0000
651 date: Thu Jan 01 00:00:00 1970 +0000
651 summary: 0.3
652 summary: 0.3
652
653
653 $ cd ..
654 $ cd ..
654
655
655 #endif
656 #endif
656
657
657 test for 540d1059c802
658 test for 540d1059c802
658
659
659 $ hg init orig
660 $ hg init orig
660 $ cd orig
661 $ cd orig
661 $ echo foo > foo
662 $ echo foo > foo
662 $ hg add foo
663 $ hg add foo
663 $ hg ci -m 'add foo'
664 $ hg ci -m 'add foo'
664
665
665 $ hg clone . ../copy
666 $ hg clone . ../copy
666 updating to branch default
667 updating to branch default
667 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
668 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
668 $ hg tag foo
669 $ hg tag foo
669
670
670 $ cd ../copy
671 $ cd ../copy
671 $ echo >> foo
672 $ echo >> foo
672 $ hg ci -m 'change foo'
673 $ hg ci -m 'change foo'
673 $ hg bundle ../bundle.hg ../orig
674 $ hg bundle ../bundle.hg ../orig
674 searching for changes
675 searching for changes
675 1 changesets found
676 1 changesets found
676
677
677 $ cd ..
678 $ cd ..
678
679
679 #if repobundlerepo
680 #if repobundlerepo
680 $ cd orig
681 $ cd orig
681 $ hg incoming ../bundle.hg
682 $ hg incoming ../bundle.hg
682 comparing with ../bundle.hg
683 comparing with ../bundle.hg
683 searching for changes
684 searching for changes
684 changeset: 2:ed1b79f46b9a
685 changeset: 2:ed1b79f46b9a
685 tag: tip
686 tag: tip
686 parent: 0:bbd179dfa0a7
687 parent: 0:bbd179dfa0a7
687 user: test
688 user: test
688 date: Thu Jan 01 00:00:00 1970 +0000
689 date: Thu Jan 01 00:00:00 1970 +0000
689 summary: change foo
690 summary: change foo
690
691
691 $ cd ..
692 $ cd ..
692
693
693 test bundle with # in the filename (issue2154):
694 test bundle with # in the filename (issue2154):
694
695
695 $ cp bundle.hg 'test#bundle.hg'
696 $ cp bundle.hg 'test#bundle.hg'
696 $ cd orig
697 $ cd orig
697 $ hg incoming '../test#bundle.hg'
698 $ hg incoming '../test#bundle.hg'
698 comparing with ../test
699 comparing with ../test
699 abort: unknown revision 'bundle.hg'!
700 abort: unknown revision 'bundle.hg'!
700 [255]
701 [255]
701
702
702 note that percent encoding is not handled:
703 note that percent encoding is not handled:
703
704
704 $ hg incoming ../test%23bundle.hg
705 $ hg incoming ../test%23bundle.hg
705 abort: repository ../test%23bundle.hg not found!
706 abort: repository ../test%23bundle.hg not found!
706 [255]
707 [255]
707 $ cd ..
708 $ cd ..
708
709
709 #endif
710 #endif
710
711
711 test to bundle revisions on the newly created branch (issue3828):
712 test to bundle revisions on the newly created branch (issue3828):
712
713
713 $ hg -q clone -U test test-clone
714 $ hg -q clone -U test test-clone
714 $ cd test
715 $ cd test
715
716
716 $ hg -q branch foo
717 $ hg -q branch foo
717 $ hg commit -m "create foo branch"
718 $ hg commit -m "create foo branch"
718 $ hg -q outgoing ../test-clone
719 $ hg -q outgoing ../test-clone
719 9:b4f5acb1ee27
720 9:b4f5acb1ee27
720 $ hg -q bundle --branch foo foo.hg ../test-clone
721 $ hg -q bundle --branch foo foo.hg ../test-clone
721 #if repobundlerepo
722 #if repobundlerepo
722 $ hg -R foo.hg -q log -r "bundle()"
723 $ hg -R foo.hg -q log -r "bundle()"
723 9:b4f5acb1ee27
724 9:b4f5acb1ee27
724 #endif
725 #endif
725
726
726 $ cd ..
727 $ cd ..
727
728
728 test for https://bz.mercurial-scm.org/1144
729 test for https://bz.mercurial-scm.org/1144
729
730
730 test that verify bundle does not traceback
731 test that verify bundle does not traceback
731
732
732 partial history bundle, fails w/ unknown parent
733 partial history bundle, fails w/ unknown parent
733
734
734 $ hg -R bundle.hg verify
735 $ hg -R bundle.hg verify
735 abort: 00changelog.i@bbd179dfa0a7: unknown parent!
736 abort: 00changelog.i@bbd179dfa0a7: unknown parent!
736 [255]
737 [255]
737
738
738 full history bundle, refuses to verify non-local repo
739 full history bundle, refuses to verify non-local repo
739
740
740 #if repobundlerepo
741 #if repobundlerepo
741 $ hg -R all.hg verify
742 $ hg -R all.hg verify
742 abort: cannot verify bundle or remote repos
743 abort: cannot verify bundle or remote repos
743 [255]
744 [255]
744 #endif
745 #endif
745
746
746 but, regular verify must continue to work
747 but, regular verify must continue to work
747
748
748 $ hg -R orig verify
749 $ hg -R orig verify
749 checking changesets
750 checking changesets
750 checking manifests
751 checking manifests
751 crosschecking files in changesets and manifests
752 crosschecking files in changesets and manifests
752 checking files
753 checking files
753 checked 2 changesets with 2 changes to 2 files
754 checked 2 changesets with 2 changes to 2 files
754
755
755 #if repobundlerepo
756 #if repobundlerepo
756 diff against bundle
757 diff against bundle
757
758
758 $ hg init b
759 $ hg init b
759 $ cd b
760 $ cd b
760 $ hg -R ../all.hg diff -r tip
761 $ hg -R ../all.hg diff -r tip
761 diff -r aa35859c02ea anotherfile
762 diff -r aa35859c02ea anotherfile
762 --- a/anotherfile Thu Jan 01 00:00:00 1970 +0000
763 --- a/anotherfile Thu Jan 01 00:00:00 1970 +0000
763 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
764 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
764 @@ -1,4 +0,0 @@
765 @@ -1,4 +0,0 @@
765 -0
766 -0
766 -1
767 -1
767 -2
768 -2
768 -3
769 -3
769 $ cd ..
770 $ cd ..
770 #endif
771 #endif
771
772
772 bundle single branch
773 bundle single branch
773
774
774 $ hg init branchy
775 $ hg init branchy
775 $ cd branchy
776 $ cd branchy
776 $ echo a >a
777 $ echo a >a
777 $ echo x >x
778 $ echo x >x
778 $ hg ci -Ama
779 $ hg ci -Ama
779 adding a
780 adding a
780 adding x
781 adding x
781 $ echo c >c
782 $ echo c >c
782 $ echo xx >x
783 $ echo xx >x
783 $ hg ci -Amc
784 $ hg ci -Amc
784 adding c
785 adding c
785 $ echo c1 >c1
786 $ echo c1 >c1
786 $ hg ci -Amc1
787 $ hg ci -Amc1
787 adding c1
788 adding c1
788 $ hg up 0
789 $ hg up 0
789 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
790 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
790 $ echo b >b
791 $ echo b >b
791 $ hg ci -Amb
792 $ hg ci -Amb
792 adding b
793 adding b
793 created new head
794 created new head
794 $ echo b1 >b1
795 $ echo b1 >b1
795 $ echo xx >x
796 $ echo xx >x
796 $ hg ci -Amb1
797 $ hg ci -Amb1
797 adding b1
798 adding b1
798 $ hg clone -q -r2 . part
799 $ hg clone -q -r2 . part
799
800
800 == bundling via incoming
801 == bundling via incoming
801
802
802 $ hg in -R part --bundle incoming.hg --template "{node}\n" .
803 $ hg in -R part --bundle incoming.hg --template "{node}\n" .
803 comparing with .
804 comparing with .
804 searching for changes
805 searching for changes
805 1a38c1b849e8b70c756d2d80b0b9a3ac0b7ea11a
806 1a38c1b849e8b70c756d2d80b0b9a3ac0b7ea11a
806 057f4db07f61970e1c11e83be79e9d08adc4dc31
807 057f4db07f61970e1c11e83be79e9d08adc4dc31
807
808
808 == bundling
809 == bundling
809
810
810 $ hg bundle bundle.hg part --debug --config progress.debug=true
811 $ hg bundle bundle.hg part --debug --config progress.debug=true
811 query 1; heads
812 query 1; heads
812 searching for changes
813 searching for changes
813 all remote heads known locally
814 all remote heads known locally
814 2 changesets found
815 2 changesets found
815 list of changesets:
816 list of changesets:
816 1a38c1b849e8b70c756d2d80b0b9a3ac0b7ea11a
817 1a38c1b849e8b70c756d2d80b0b9a3ac0b7ea11a
817 057f4db07f61970e1c11e83be79e9d08adc4dc31
818 057f4db07f61970e1c11e83be79e9d08adc4dc31
818 bundle2-output-bundle: "HG20", (1 params) 2 parts total
819 bundle2-output-bundle: "HG20", (1 params) 2 parts total
819 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
820 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
820 changesets: 1/2 chunks (50.00%)
821 changesets: 1/2 chunks (50.00%)
821 changesets: 2/2 chunks (100.00%)
822 changesets: 2/2 chunks (100.00%)
822 manifests: 1/2 chunks (50.00%)
823 manifests: 1/2 chunks (50.00%)
823 manifests: 2/2 chunks (100.00%)
824 manifests: 2/2 chunks (100.00%)
824 files: b 1/3 files (33.33%)
825 files: b 1/3 files (33.33%)
825 files: b1 2/3 files (66.67%)
826 files: b1 2/3 files (66.67%)
826 files: x 3/3 files (100.00%)
827 files: x 3/3 files (100.00%)
827 bundle2-output-part: "cache:rev-branch-cache" (advisory) streamed payload
828 bundle2-output-part: "cache:rev-branch-cache" (advisory) streamed payload
828
829
829 #if repobundlerepo
830 #if repobundlerepo
830 == Test for issue3441
831 == Test for issue3441
831
832
832 $ hg clone -q -r0 . part2
833 $ hg clone -q -r0 . part2
833 $ hg -q -R part2 pull bundle.hg
834 $ hg -q -R part2 pull bundle.hg
834 $ hg -R part2 verify
835 $ hg -R part2 verify
835 checking changesets
836 checking changesets
836 checking manifests
837 checking manifests
837 crosschecking files in changesets and manifests
838 crosschecking files in changesets and manifests
838 checking files
839 checking files
839 checked 3 changesets with 5 changes to 4 files
840 checked 3 changesets with 5 changes to 4 files
840 #endif
841 #endif
841
842
842 == Test bundling no commits
843 == Test bundling no commits
843
844
844 $ hg bundle -r 'public()' no-output.hg
845 $ hg bundle -r 'public()' no-output.hg
845 abort: no commits to bundle
846 abort: no commits to bundle
846 [255]
847 [255]
847
848
848 $ cd ..
849 $ cd ..
849
850
850 When user merges to the revision existing only in the bundle,
851 When user merges to the revision existing only in the bundle,
851 it should show warning that second parent of the working
852 it should show warning that second parent of the working
852 directory does not exist
853 directory does not exist
853
854
854 $ hg init update2bundled
855 $ hg init update2bundled
855 $ cd update2bundled
856 $ cd update2bundled
856 $ cat <<EOF >> .hg/hgrc
857 $ cat <<EOF >> .hg/hgrc
857 > [extensions]
858 > [extensions]
858 > strip =
859 > strip =
859 > EOF
860 > EOF
860 $ echo "aaa" >> a
861 $ echo "aaa" >> a
861 $ hg commit -A -m 0
862 $ hg commit -A -m 0
862 adding a
863 adding a
863 $ echo "bbb" >> b
864 $ echo "bbb" >> b
864 $ hg commit -A -m 1
865 $ hg commit -A -m 1
865 adding b
866 adding b
866 $ echo "ccc" >> c
867 $ echo "ccc" >> c
867 $ hg commit -A -m 2
868 $ hg commit -A -m 2
868 adding c
869 adding c
869 $ hg update -r 1
870 $ hg update -r 1
870 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
871 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
871 $ echo "ddd" >> d
872 $ echo "ddd" >> d
872 $ hg commit -A -m 3
873 $ hg commit -A -m 3
873 adding d
874 adding d
874 created new head
875 created new head
875 $ hg update -r 2
876 $ hg update -r 2
876 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
877 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
877 $ hg log -G
878 $ hg log -G
878 o changeset: 3:8bd3e1f196af
879 o changeset: 3:8bd3e1f196af
879 | tag: tip
880 | tag: tip
880 | parent: 1:a01eca7af26d
881 | parent: 1:a01eca7af26d
881 | user: test
882 | user: test
882 | date: Thu Jan 01 00:00:00 1970 +0000
883 | date: Thu Jan 01 00:00:00 1970 +0000
883 | summary: 3
884 | summary: 3
884 |
885 |
885 | @ changeset: 2:4652c276ac4f
886 | @ changeset: 2:4652c276ac4f
886 |/ user: test
887 |/ user: test
887 | date: Thu Jan 01 00:00:00 1970 +0000
888 | date: Thu Jan 01 00:00:00 1970 +0000
888 | summary: 2
889 | summary: 2
889 |
890 |
890 o changeset: 1:a01eca7af26d
891 o changeset: 1:a01eca7af26d
891 | user: test
892 | user: test
892 | date: Thu Jan 01 00:00:00 1970 +0000
893 | date: Thu Jan 01 00:00:00 1970 +0000
893 | summary: 1
894 | summary: 1
894 |
895 |
895 o changeset: 0:4fe08cd4693e
896 o changeset: 0:4fe08cd4693e
896 user: test
897 user: test
897 date: Thu Jan 01 00:00:00 1970 +0000
898 date: Thu Jan 01 00:00:00 1970 +0000
898 summary: 0
899 summary: 0
899
900
900
901
901 #if repobundlerepo
902 #if repobundlerepo
902 $ hg bundle --base 1 -r 3 ../update2bundled.hg
903 $ hg bundle --base 1 -r 3 ../update2bundled.hg
903 1 changesets found
904 1 changesets found
904 $ hg strip -r 3
905 $ hg strip -r 3
905 saved backup bundle to $TESTTMP/update2bundled/.hg/strip-backup/8bd3e1f196af-017e56d8-backup.hg
906 saved backup bundle to $TESTTMP/update2bundled/.hg/strip-backup/8bd3e1f196af-017e56d8-backup.hg
906 $ hg merge -R ../update2bundled.hg -r 3
907 $ hg merge -R ../update2bundled.hg -r 3
907 setting parent to node 8bd3e1f196af289b2b121be08031e76d7ae92098 that only exists in the bundle
908 setting parent to node 8bd3e1f196af289b2b121be08031e76d7ae92098 that only exists in the bundle
908 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
909 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
909 (branch merge, don't forget to commit)
910 (branch merge, don't forget to commit)
910
911
911 When user updates to the revision existing only in the bundle,
912 When user updates to the revision existing only in the bundle,
912 it should show warning
913 it should show warning
913
914
914 $ hg update -R ../update2bundled.hg --clean -r 3
915 $ hg update -R ../update2bundled.hg --clean -r 3
915 setting parent to node 8bd3e1f196af289b2b121be08031e76d7ae92098 that only exists in the bundle
916 setting parent to node 8bd3e1f196af289b2b121be08031e76d7ae92098 that only exists in the bundle
916 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
917 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
917
918
918 When user updates to the revision existing in the local repository
919 When user updates to the revision existing in the local repository
919 the warning shouldn't be emitted
920 the warning shouldn't be emitted
920
921
921 $ hg update -R ../update2bundled.hg -r 0
922 $ hg update -R ../update2bundled.hg -r 0
922 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
923 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
923 #endif
924 #endif
924
925
925 Test the option that create slim bundle
926 Test the option that create slim bundle
926
927
927 $ hg bundle -a --config devel.bundle.delta=p1 ./slim.hg
928 $ hg bundle -a --config devel.bundle.delta=p1 ./slim.hg
928 3 changesets found
929 3 changesets found
929
930
930 Test the option that create and no-delta's bundle
931 Test the option that create and no-delta's bundle
931 $ hg bundle -a --config devel.bundle.delta=full ./full.hg
932 $ hg bundle -a --config devel.bundle.delta=full ./full.hg
932 3 changesets found
933 3 changesets found
General Comments 0
You need to be logged in to leave comments. Login now