##// END OF EJS Templates
test-clone: fix directory level...
Adrian Buehlmann -
r17881:603d4fba stable
parent child Browse files
Show More
@@ -1,612 +1,613 b''
1 Prepare repo a:
1 Prepare repo a:
2
2
3 $ hg init a
3 $ hg init a
4 $ cd a
4 $ cd a
5 $ echo a > a
5 $ echo a > a
6 $ hg add a
6 $ hg add a
7 $ hg commit -m test
7 $ hg commit -m test
8 $ echo first line > b
8 $ echo first line > b
9 $ hg add b
9 $ hg add b
10
10
11 Create a non-inlined filelog:
11 Create a non-inlined filelog:
12
12
13 $ python -c 'file("data1", "wb").write("".join("%s\n" % x for x in range(10000)))'
13 $ python -c 'file("data1", "wb").write("".join("%s\n" % x for x in range(10000)))'
14 $ for j in 0 1 2 3 4 5 6 7 8 9; do
14 $ for j in 0 1 2 3 4 5 6 7 8 9; do
15 > cat data1 >> b
15 > cat data1 >> b
16 > hg commit -m test
16 > hg commit -m test
17 > done
17 > done
18
18
19 List files in store/data (should show a 'b.d'):
19 List files in store/data (should show a 'b.d'):
20
20
21 $ for i in .hg/store/data/*; do
21 $ for i in .hg/store/data/*; do
22 > echo $i
22 > echo $i
23 > done
23 > done
24 .hg/store/data/a.i
24 .hg/store/data/a.i
25 .hg/store/data/b.d
25 .hg/store/data/b.d
26 .hg/store/data/b.i
26 .hg/store/data/b.i
27
27
28 Default operation:
28 Default operation:
29
29
30 $ hg clone . ../b
30 $ hg clone . ../b
31 updating to branch default
31 updating to branch default
32 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
32 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
33 $ cd ../b
33 $ cd ../b
34 $ cat a
34 $ cat a
35 a
35 a
36 $ hg verify
36 $ hg verify
37 checking changesets
37 checking changesets
38 checking manifests
38 checking manifests
39 crosschecking files in changesets and manifests
39 crosschecking files in changesets and manifests
40 checking files
40 checking files
41 2 files, 11 changesets, 11 total revisions
41 2 files, 11 changesets, 11 total revisions
42
42
43 Invalid dest '' must abort:
43 Invalid dest '' must abort:
44
44
45 $ hg clone . ''
45 $ hg clone . ''
46 abort: empty destination path is not valid
46 abort: empty destination path is not valid
47 [255]
47 [255]
48
48
49 No update, with debug option:
49 No update, with debug option:
50
50
51 #if hardlink
51 #if hardlink
52 $ hg --debug clone -U . ../c
52 $ hg --debug clone -U . ../c
53 linked 8 files
53 linked 8 files
54 listing keys for "bookmarks"
54 listing keys for "bookmarks"
55 #else
55 #else
56 $ hg --debug clone -U . ../c
56 $ hg --debug clone -U . ../c
57 copied 8 files
57 copied 8 files
58 listing keys for "bookmarks"
58 listing keys for "bookmarks"
59 #endif
59 #endif
60 $ cd ../c
60 $ cd ../c
61 $ cat a 2>/dev/null || echo "a not present"
61 $ cat a 2>/dev/null || echo "a not present"
62 a not present
62 a not present
63 $ hg verify
63 $ hg verify
64 checking changesets
64 checking changesets
65 checking manifests
65 checking manifests
66 crosschecking files in changesets and manifests
66 crosschecking files in changesets and manifests
67 checking files
67 checking files
68 2 files, 11 changesets, 11 total revisions
68 2 files, 11 changesets, 11 total revisions
69
69
70 Default destination:
70 Default destination:
71
71
72 $ mkdir ../d
72 $ mkdir ../d
73 $ cd ../d
73 $ cd ../d
74 $ hg clone ../a
74 $ hg clone ../a
75 destination directory: a
75 destination directory: a
76 updating to branch default
76 updating to branch default
77 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
77 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
78 $ cd a
78 $ cd a
79 $ hg cat a
79 $ hg cat a
80 a
80 a
81 $ cd ../..
81 $ cd ../..
82
82
83 Check that we drop the 'file:' from the path before writing the .hgrc:
83 Check that we drop the 'file:' from the path before writing the .hgrc:
84
84
85 $ hg clone file:a e
85 $ hg clone file:a e
86 updating to branch default
86 updating to branch default
87 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
87 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
88 $ grep 'file:' e/.hg/hgrc
88 $ grep 'file:' e/.hg/hgrc
89 [1]
89 [1]
90
90
91 Check that path aliases are expanded:
91 Check that path aliases are expanded:
92
92
93 $ hg clone -q -U --config 'paths.foobar=a#0' foobar f
93 $ hg clone -q -U --config 'paths.foobar=a#0' foobar f
94 $ hg -R f showconfig paths.default
94 $ hg -R f showconfig paths.default
95 $TESTTMP/a#0 (glob)
95 $TESTTMP/a#0 (glob)
96
96
97 Use --pull:
97 Use --pull:
98
98
99 $ hg clone --pull a g
99 $ hg clone --pull a g
100 requesting all changes
100 requesting all changes
101 adding changesets
101 adding changesets
102 adding manifests
102 adding manifests
103 adding file changes
103 adding file changes
104 added 11 changesets with 11 changes to 2 files
104 added 11 changesets with 11 changes to 2 files
105 updating to branch default
105 updating to branch default
106 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
106 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
107 $ hg -R g verify
107 $ hg -R g verify
108 checking changesets
108 checking changesets
109 checking manifests
109 checking manifests
110 crosschecking files in changesets and manifests
110 crosschecking files in changesets and manifests
111 checking files
111 checking files
112 2 files, 11 changesets, 11 total revisions
112 2 files, 11 changesets, 11 total revisions
113
113
114 Invalid dest '' with --pull must abort (issue2528):
114 Invalid dest '' with --pull must abort (issue2528):
115
115
116 $ hg clone --pull a ''
116 $ hg clone --pull a ''
117 abort: empty destination path is not valid
117 abort: empty destination path is not valid
118 [255]
118 [255]
119
119
120 Clone to '.':
120 Clone to '.':
121
121
122 $ mkdir h
122 $ mkdir h
123 $ cd h
123 $ cd h
124 $ hg clone ../a .
124 $ hg clone ../a .
125 updating to branch default
125 updating to branch default
126 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
126 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
127 $ cd ..
127 $ cd ..
128
128
129
129
130 *** Tests for option -u ***
130 *** Tests for option -u ***
131
131
132 Adding some more history to repo a:
132 Adding some more history to repo a:
133
133
134 $ cd a
134 $ cd a
135 $ hg tag ref1
135 $ hg tag ref1
136 $ echo the quick brown fox >a
136 $ echo the quick brown fox >a
137 $ hg ci -m "hacked default"
137 $ hg ci -m "hacked default"
138 $ hg up ref1
138 $ hg up ref1
139 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
139 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
140 $ hg branch stable
140 $ hg branch stable
141 marked working directory as branch stable
141 marked working directory as branch stable
142 (branches are permanent and global, did you want a bookmark?)
142 (branches are permanent and global, did you want a bookmark?)
143 $ echo some text >a
143 $ echo some text >a
144 $ hg ci -m "starting branch stable"
144 $ hg ci -m "starting branch stable"
145 $ hg tag ref2
145 $ hg tag ref2
146 $ echo some more text >a
146 $ echo some more text >a
147 $ hg ci -m "another change for branch stable"
147 $ hg ci -m "another change for branch stable"
148 $ hg up ref2
148 $ hg up ref2
149 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
149 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
150 $ hg parents
150 $ hg parents
151 changeset: 13:e8ece76546a6
151 changeset: 13:e8ece76546a6
152 branch: stable
152 branch: stable
153 tag: ref2
153 tag: ref2
154 parent: 10:a7949464abda
154 parent: 10:a7949464abda
155 user: test
155 user: test
156 date: Thu Jan 01 00:00:00 1970 +0000
156 date: Thu Jan 01 00:00:00 1970 +0000
157 summary: starting branch stable
157 summary: starting branch stable
158
158
159
159
160 Repo a has two heads:
160 Repo a has two heads:
161
161
162 $ hg heads
162 $ hg heads
163 changeset: 15:0aae7cf88f0d
163 changeset: 15:0aae7cf88f0d
164 branch: stable
164 branch: stable
165 tag: tip
165 tag: tip
166 user: test
166 user: test
167 date: Thu Jan 01 00:00:00 1970 +0000
167 date: Thu Jan 01 00:00:00 1970 +0000
168 summary: another change for branch stable
168 summary: another change for branch stable
169
169
170 changeset: 12:f21241060d6a
170 changeset: 12:f21241060d6a
171 user: test
171 user: test
172 date: Thu Jan 01 00:00:00 1970 +0000
172 date: Thu Jan 01 00:00:00 1970 +0000
173 summary: hacked default
173 summary: hacked default
174
174
175
175
176 $ cd ..
176 $ cd ..
177
177
178
178
179 Testing --noupdate with --updaterev (must abort):
179 Testing --noupdate with --updaterev (must abort):
180
180
181 $ hg clone --noupdate --updaterev 1 a ua
181 $ hg clone --noupdate --updaterev 1 a ua
182 abort: cannot specify both --noupdate and --updaterev
182 abort: cannot specify both --noupdate and --updaterev
183 [255]
183 [255]
184
184
185
185
186 Testing clone -u:
186 Testing clone -u:
187
187
188 $ hg clone -u . a ua
188 $ hg clone -u . a ua
189 updating to branch stable
189 updating to branch stable
190 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
190 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
191
191
192 Repo ua has both heads:
192 Repo ua has both heads:
193
193
194 $ hg -R ua heads
194 $ hg -R ua heads
195 changeset: 15:0aae7cf88f0d
195 changeset: 15:0aae7cf88f0d
196 branch: stable
196 branch: stable
197 tag: tip
197 tag: tip
198 user: test
198 user: test
199 date: Thu Jan 01 00:00:00 1970 +0000
199 date: Thu Jan 01 00:00:00 1970 +0000
200 summary: another change for branch stable
200 summary: another change for branch stable
201
201
202 changeset: 12:f21241060d6a
202 changeset: 12:f21241060d6a
203 user: test
203 user: test
204 date: Thu Jan 01 00:00:00 1970 +0000
204 date: Thu Jan 01 00:00:00 1970 +0000
205 summary: hacked default
205 summary: hacked default
206
206
207
207
208 Same revision checked out in repo a and ua:
208 Same revision checked out in repo a and ua:
209
209
210 $ hg -R a parents --template "{node|short}\n"
210 $ hg -R a parents --template "{node|short}\n"
211 e8ece76546a6
211 e8ece76546a6
212 $ hg -R ua parents --template "{node|short}\n"
212 $ hg -R ua parents --template "{node|short}\n"
213 e8ece76546a6
213 e8ece76546a6
214
214
215 $ rm -r ua
215 $ rm -r ua
216
216
217
217
218 Testing clone --pull -u:
218 Testing clone --pull -u:
219
219
220 $ hg clone --pull -u . a ua
220 $ hg clone --pull -u . a ua
221 requesting all changes
221 requesting all changes
222 adding changesets
222 adding changesets
223 adding manifests
223 adding manifests
224 adding file changes
224 adding file changes
225 added 16 changesets with 16 changes to 3 files (+1 heads)
225 added 16 changesets with 16 changes to 3 files (+1 heads)
226 updating to branch stable
226 updating to branch stable
227 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
227 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
228
228
229 Repo ua has both heads:
229 Repo ua has both heads:
230
230
231 $ hg -R ua heads
231 $ hg -R ua heads
232 changeset: 15:0aae7cf88f0d
232 changeset: 15:0aae7cf88f0d
233 branch: stable
233 branch: stable
234 tag: tip
234 tag: tip
235 user: test
235 user: test
236 date: Thu Jan 01 00:00:00 1970 +0000
236 date: Thu Jan 01 00:00:00 1970 +0000
237 summary: another change for branch stable
237 summary: another change for branch stable
238
238
239 changeset: 12:f21241060d6a
239 changeset: 12:f21241060d6a
240 user: test
240 user: test
241 date: Thu Jan 01 00:00:00 1970 +0000
241 date: Thu Jan 01 00:00:00 1970 +0000
242 summary: hacked default
242 summary: hacked default
243
243
244
244
245 Same revision checked out in repo a and ua:
245 Same revision checked out in repo a and ua:
246
246
247 $ hg -R a parents --template "{node|short}\n"
247 $ hg -R a parents --template "{node|short}\n"
248 e8ece76546a6
248 e8ece76546a6
249 $ hg -R ua parents --template "{node|short}\n"
249 $ hg -R ua parents --template "{node|short}\n"
250 e8ece76546a6
250 e8ece76546a6
251
251
252 $ rm -r ua
252 $ rm -r ua
253
253
254
254
255 Testing clone -u <branch>:
255 Testing clone -u <branch>:
256
256
257 $ hg clone -u stable a ua
257 $ hg clone -u stable a ua
258 updating to branch stable
258 updating to branch stable
259 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
259 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
260
260
261 Repo ua has both heads:
261 Repo ua has both heads:
262
262
263 $ hg -R ua heads
263 $ hg -R ua heads
264 changeset: 15:0aae7cf88f0d
264 changeset: 15:0aae7cf88f0d
265 branch: stable
265 branch: stable
266 tag: tip
266 tag: tip
267 user: test
267 user: test
268 date: Thu Jan 01 00:00:00 1970 +0000
268 date: Thu Jan 01 00:00:00 1970 +0000
269 summary: another change for branch stable
269 summary: another change for branch stable
270
270
271 changeset: 12:f21241060d6a
271 changeset: 12:f21241060d6a
272 user: test
272 user: test
273 date: Thu Jan 01 00:00:00 1970 +0000
273 date: Thu Jan 01 00:00:00 1970 +0000
274 summary: hacked default
274 summary: hacked default
275
275
276
276
277 Branch 'stable' is checked out:
277 Branch 'stable' is checked out:
278
278
279 $ hg -R ua parents
279 $ hg -R ua parents
280 changeset: 15:0aae7cf88f0d
280 changeset: 15:0aae7cf88f0d
281 branch: stable
281 branch: stable
282 tag: tip
282 tag: tip
283 user: test
283 user: test
284 date: Thu Jan 01 00:00:00 1970 +0000
284 date: Thu Jan 01 00:00:00 1970 +0000
285 summary: another change for branch stable
285 summary: another change for branch stable
286
286
287
287
288 $ rm -r ua
288 $ rm -r ua
289
289
290
290
291 Testing default checkout:
291 Testing default checkout:
292
292
293 $ hg clone a ua
293 $ hg clone a ua
294 updating to branch default
294 updating to branch default
295 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
295 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
296
296
297 Repo ua has both heads:
297 Repo ua has both heads:
298
298
299 $ hg -R ua heads
299 $ hg -R ua heads
300 changeset: 15:0aae7cf88f0d
300 changeset: 15:0aae7cf88f0d
301 branch: stable
301 branch: stable
302 tag: tip
302 tag: tip
303 user: test
303 user: test
304 date: Thu Jan 01 00:00:00 1970 +0000
304 date: Thu Jan 01 00:00:00 1970 +0000
305 summary: another change for branch stable
305 summary: another change for branch stable
306
306
307 changeset: 12:f21241060d6a
307 changeset: 12:f21241060d6a
308 user: test
308 user: test
309 date: Thu Jan 01 00:00:00 1970 +0000
309 date: Thu Jan 01 00:00:00 1970 +0000
310 summary: hacked default
310 summary: hacked default
311
311
312
312
313 Branch 'default' is checked out:
313 Branch 'default' is checked out:
314
314
315 $ hg -R ua parents
315 $ hg -R ua parents
316 changeset: 12:f21241060d6a
316 changeset: 12:f21241060d6a
317 user: test
317 user: test
318 date: Thu Jan 01 00:00:00 1970 +0000
318 date: Thu Jan 01 00:00:00 1970 +0000
319 summary: hacked default
319 summary: hacked default
320
320
321 Test clone with a branch named "@" (issue3677)
321 Test clone with a branch named "@" (issue3677)
322
322
323 $ hg -R ua branch @
323 $ hg -R ua branch @
324 marked working directory as branch @
324 marked working directory as branch @
325 (branches are permanent and global, did you want a bookmark?)
325 (branches are permanent and global, did you want a bookmark?)
326 $ hg -R ua commit -m 'created branch @'
326 $ hg -R ua commit -m 'created branch @'
327 $ hg clone ua atbranch
327 $ hg clone ua atbranch
328 updating to branch default
328 updating to branch default
329 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
329 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
330 $ hg -R atbranch heads
330 $ hg -R atbranch heads
331 changeset: 16:798b6d97153e
331 changeset: 16:798b6d97153e
332 branch: @
332 branch: @
333 tag: tip
333 tag: tip
334 parent: 12:f21241060d6a
334 parent: 12:f21241060d6a
335 user: test
335 user: test
336 date: Thu Jan 01 00:00:00 1970 +0000
336 date: Thu Jan 01 00:00:00 1970 +0000
337 summary: created branch @
337 summary: created branch @
338
338
339 changeset: 15:0aae7cf88f0d
339 changeset: 15:0aae7cf88f0d
340 branch: stable
340 branch: stable
341 user: test
341 user: test
342 date: Thu Jan 01 00:00:00 1970 +0000
342 date: Thu Jan 01 00:00:00 1970 +0000
343 summary: another change for branch stable
343 summary: another change for branch stable
344
344
345 changeset: 12:f21241060d6a
345 changeset: 12:f21241060d6a
346 user: test
346 user: test
347 date: Thu Jan 01 00:00:00 1970 +0000
347 date: Thu Jan 01 00:00:00 1970 +0000
348 summary: hacked default
348 summary: hacked default
349
349
350 $ hg -R atbranch parents
350 $ hg -R atbranch parents
351 changeset: 12:f21241060d6a
351 changeset: 12:f21241060d6a
352 user: test
352 user: test
353 date: Thu Jan 01 00:00:00 1970 +0000
353 date: Thu Jan 01 00:00:00 1970 +0000
354 summary: hacked default
354 summary: hacked default
355
355
356
356
357 $ rm -r ua atbranch
357 $ rm -r ua atbranch
358
358
359
359
360 Testing #<branch>:
360 Testing #<branch>:
361
361
362 $ hg clone -u . a#stable ua
362 $ hg clone -u . a#stable ua
363 adding changesets
363 adding changesets
364 adding manifests
364 adding manifests
365 adding file changes
365 adding file changes
366 added 14 changesets with 14 changes to 3 files
366 added 14 changesets with 14 changes to 3 files
367 updating to branch stable
367 updating to branch stable
368 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
368 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
369
369
370 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
370 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
371
371
372 $ hg -R ua heads
372 $ hg -R ua heads
373 changeset: 13:0aae7cf88f0d
373 changeset: 13:0aae7cf88f0d
374 branch: stable
374 branch: stable
375 tag: tip
375 tag: tip
376 user: test
376 user: test
377 date: Thu Jan 01 00:00:00 1970 +0000
377 date: Thu Jan 01 00:00:00 1970 +0000
378 summary: another change for branch stable
378 summary: another change for branch stable
379
379
380 changeset: 10:a7949464abda
380 changeset: 10:a7949464abda
381 user: test
381 user: test
382 date: Thu Jan 01 00:00:00 1970 +0000
382 date: Thu Jan 01 00:00:00 1970 +0000
383 summary: test
383 summary: test
384
384
385
385
386 Same revision checked out in repo a and ua:
386 Same revision checked out in repo a and ua:
387
387
388 $ hg -R a parents --template "{node|short}\n"
388 $ hg -R a parents --template "{node|short}\n"
389 e8ece76546a6
389 e8ece76546a6
390 $ hg -R ua parents --template "{node|short}\n"
390 $ hg -R ua parents --template "{node|short}\n"
391 e8ece76546a6
391 e8ece76546a6
392
392
393 $ rm -r ua
393 $ rm -r ua
394
394
395
395
396 Testing -u -r <branch>:
396 Testing -u -r <branch>:
397
397
398 $ hg clone -u . -r stable a ua
398 $ hg clone -u . -r stable a ua
399 adding changesets
399 adding changesets
400 adding manifests
400 adding manifests
401 adding file changes
401 adding file changes
402 added 14 changesets with 14 changes to 3 files
402 added 14 changesets with 14 changes to 3 files
403 updating to branch stable
403 updating to branch stable
404 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
404 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
405
405
406 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
406 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
407
407
408 $ hg -R ua heads
408 $ hg -R ua heads
409 changeset: 13:0aae7cf88f0d
409 changeset: 13:0aae7cf88f0d
410 branch: stable
410 branch: stable
411 tag: tip
411 tag: tip
412 user: test
412 user: test
413 date: Thu Jan 01 00:00:00 1970 +0000
413 date: Thu Jan 01 00:00:00 1970 +0000
414 summary: another change for branch stable
414 summary: another change for branch stable
415
415
416 changeset: 10:a7949464abda
416 changeset: 10:a7949464abda
417 user: test
417 user: test
418 date: Thu Jan 01 00:00:00 1970 +0000
418 date: Thu Jan 01 00:00:00 1970 +0000
419 summary: test
419 summary: test
420
420
421
421
422 Same revision checked out in repo a and ua:
422 Same revision checked out in repo a and ua:
423
423
424 $ hg -R a parents --template "{node|short}\n"
424 $ hg -R a parents --template "{node|short}\n"
425 e8ece76546a6
425 e8ece76546a6
426 $ hg -R ua parents --template "{node|short}\n"
426 $ hg -R ua parents --template "{node|short}\n"
427 e8ece76546a6
427 e8ece76546a6
428
428
429 $ rm -r ua
429 $ rm -r ua
430
430
431
431
432 Testing -r <branch>:
432 Testing -r <branch>:
433
433
434 $ hg clone -r stable a ua
434 $ hg clone -r stable a ua
435 adding changesets
435 adding changesets
436 adding manifests
436 adding manifests
437 adding file changes
437 adding file changes
438 added 14 changesets with 14 changes to 3 files
438 added 14 changesets with 14 changes to 3 files
439 updating to branch stable
439 updating to branch stable
440 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
440 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
441
441
442 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
442 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
443
443
444 $ hg -R ua heads
444 $ hg -R ua heads
445 changeset: 13:0aae7cf88f0d
445 changeset: 13:0aae7cf88f0d
446 branch: stable
446 branch: stable
447 tag: tip
447 tag: tip
448 user: test
448 user: test
449 date: Thu Jan 01 00:00:00 1970 +0000
449 date: Thu Jan 01 00:00:00 1970 +0000
450 summary: another change for branch stable
450 summary: another change for branch stable
451
451
452 changeset: 10:a7949464abda
452 changeset: 10:a7949464abda
453 user: test
453 user: test
454 date: Thu Jan 01 00:00:00 1970 +0000
454 date: Thu Jan 01 00:00:00 1970 +0000
455 summary: test
455 summary: test
456
456
457
457
458 Branch 'stable' is checked out:
458 Branch 'stable' is checked out:
459
459
460 $ hg -R ua parents
460 $ hg -R ua parents
461 changeset: 13:0aae7cf88f0d
461 changeset: 13:0aae7cf88f0d
462 branch: stable
462 branch: stable
463 tag: tip
463 tag: tip
464 user: test
464 user: test
465 date: Thu Jan 01 00:00:00 1970 +0000
465 date: Thu Jan 01 00:00:00 1970 +0000
466 summary: another change for branch stable
466 summary: another change for branch stable
467
467
468
468
469 $ rm -r ua
469 $ rm -r ua
470
470
471
471
472 Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not
472 Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not
473 iterable in addbranchrevs()
473 iterable in addbranchrevs()
474
474
475 $ cat <<EOF > simpleclone.py
475 $ cat <<EOF > simpleclone.py
476 > from mercurial import ui, hg
476 > from mercurial import ui, hg
477 > myui = ui.ui()
477 > myui = ui.ui()
478 > repo = hg.repository(myui, 'a')
478 > repo = hg.repository(myui, 'a')
479 > hg.clone(myui, {}, repo, dest="ua")
479 > hg.clone(myui, {}, repo, dest="ua")
480 > EOF
480 > EOF
481
481
482 $ python simpleclone.py
482 $ python simpleclone.py
483 updating to branch default
483 updating to branch default
484 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
484 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
485
485
486 $ rm -r ua
486 $ rm -r ua
487
487
488 $ cat <<EOF > branchclone.py
488 $ cat <<EOF > branchclone.py
489 > from mercurial import ui, hg, extensions
489 > from mercurial import ui, hg, extensions
490 > myui = ui.ui()
490 > myui = ui.ui()
491 > extensions.loadall(myui)
491 > extensions.loadall(myui)
492 > repo = hg.repository(myui, 'a')
492 > repo = hg.repository(myui, 'a')
493 > hg.clone(myui, {}, repo, dest="ua", branch=["stable",])
493 > hg.clone(myui, {}, repo, dest="ua", branch=["stable",])
494 > EOF
494 > EOF
495
495
496 $ python branchclone.py
496 $ python branchclone.py
497 adding changesets
497 adding changesets
498 adding manifests
498 adding manifests
499 adding file changes
499 adding file changes
500 added 14 changesets with 14 changes to 3 files
500 added 14 changesets with 14 changes to 3 files
501 updating to branch stable
501 updating to branch stable
502 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
502 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
503 $ rm -r ua
503 $ rm -r ua
504
504
505
505
506 Test clone with special '@' bookmark:
506 Test clone with special '@' bookmark:
507 $ cd a
507 $ cd a
508 $ hg bookmark -r a7949464abda @ # branch point of stable from default
508 $ hg bookmark -r a7949464abda @ # branch point of stable from default
509 $ hg clone . ../i
509 $ hg clone . ../i
510 updating to branch default
510 updating to branch default
511 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
511 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
512 $ hg id -i ../i
512 $ hg id -i ../i
513 a7949464abda
513 a7949464abda
514 $ cd "$TESTTMP"
514
515
515
516
516 Testing failures:
517 Testing failures:
517
518
518 $ mkdir fail
519 $ mkdir fail
519 $ cd fail
520 $ cd fail
520
521
521 No local source
522 No local source
522
523
523 $ hg clone a b
524 $ hg clone a b
524 abort: repository a not found!
525 abort: repository a not found!
525 [255]
526 [255]
526
527
527 No remote source
528 No remote source
528
529
529 $ hg clone http://127.0.0.1:3121/a b
530 $ hg clone http://127.0.0.1:3121/a b
530 abort: error: *refused* (glob)
531 abort: error: *refused* (glob)
531 [255]
532 [255]
532 $ rm -rf b # work around bug with http clone
533 $ rm -rf b # work around bug with http clone
533
534
534
535
535 #if unix-permissions
536 #if unix-permissions
536
537
537 Inaccessible source
538 Inaccessible source
538
539
539 $ mkdir a
540 $ mkdir a
540 $ chmod 000 a
541 $ chmod 000 a
541 $ hg clone a b
542 $ hg clone a b
542 abort: repository a not found!
543 abort: repository a not found!
543 [255]
544 [255]
544
545
545 Inaccessible destination
546 Inaccessible destination
546
547
547 $ hg init b
548 $ hg init b
548 $ cd b
549 $ cd b
549 $ hg clone . ../a
550 $ hg clone . ../a
550 abort: Permission denied: ../a
551 abort: Permission denied: ../a
551 [255]
552 [255]
552 $ cd ..
553 $ cd ..
553 $ chmod 700 a
554 $ chmod 700 a
554 $ rm -r a b
555 $ rm -r a b
555
556
556 #endif
557 #endif
557
558
558
559
559 #if fifo
560 #if fifo
560
561
561 Source of wrong type
562 Source of wrong type
562
563
563 $ mkfifo a
564 $ mkfifo a
564 $ hg clone a b
565 $ hg clone a b
565 abort: repository a not found!
566 abort: repository a not found!
566 [255]
567 [255]
567 $ rm a
568 $ rm a
568
569
569 #endif
570 #endif
570
571
571 Default destination, same directory
572 Default destination, same directory
572
573
573 $ hg init q
574 $ hg init q
574 $ hg clone q
575 $ hg clone q
575 destination directory: q
576 destination directory: q
576 abort: destination 'q' is not empty
577 abort: destination 'q' is not empty
577 [255]
578 [255]
578
579
579 destination directory not empty
580 destination directory not empty
580
581
581 $ mkdir a
582 $ mkdir a
582 $ echo stuff > a/a
583 $ echo stuff > a/a
583 $ hg clone q a
584 $ hg clone q a
584 abort: destination 'a' is not empty
585 abort: destination 'a' is not empty
585 [255]
586 [255]
586
587
587
588
588 #if unix-permissions
589 #if unix-permissions
589
590
590 leave existing directory in place after clone failure
591 leave existing directory in place after clone failure
591
592
592 $ hg init c
593 $ hg init c
593 $ cd c
594 $ cd c
594 $ echo c > c
595 $ echo c > c
595 $ hg commit -A -m test
596 $ hg commit -A -m test
596 adding c
597 adding c
597 $ chmod -rx .hg/store/data
598 $ chmod -rx .hg/store/data
598 $ cd ..
599 $ cd ..
599 $ mkdir d
600 $ mkdir d
600 $ hg clone c d 2> err
601 $ hg clone c d 2> err
601 [255]
602 [255]
602 $ test -d d
603 $ test -d d
603 $ test -d d/.hg
604 $ test -d d/.hg
604 [1]
605 [1]
605
606
606 re-enable perm to allow deletion
607 re-enable perm to allow deletion
607
608
608 $ chmod +rx c/.hg/store/data
609 $ chmod +rx c/.hg/store/data
609
610
610 #endif
611 #endif
611
612
612 $ cd ..
613 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now