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