##// END OF EJS Templates
clone: add tests for unsafe ssh url (SEC)
Sean Farley -
r33726:0bcceb58 stable
parent child Browse files
Show More
@@ -1,1099 +1,1121 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 Trigger branchcache creation:
28 Trigger branchcache creation:
29
29
30 $ hg branches
30 $ hg branches
31 default 10:a7949464abda
31 default 10:a7949464abda
32 $ ls .hg/cache
32 $ ls .hg/cache
33 branch2-served
33 branch2-served
34 checkisexec (execbit !)
34 checkisexec (execbit !)
35 checklink (symlink !)
35 checklink (symlink !)
36 checklink-target (symlink !)
36 checklink-target (symlink !)
37 checknoexec (execbit !)
37 checknoexec (execbit !)
38 rbc-names-v1
38 rbc-names-v1
39 rbc-revs-v1
39 rbc-revs-v1
40
40
41 Default operation:
41 Default operation:
42
42
43 $ hg clone . ../b
43 $ hg clone . ../b
44 updating to branch default
44 updating to branch default
45 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
45 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 $ cd ../b
46 $ cd ../b
47
47
48 Ensure branchcache got copied over:
48 Ensure branchcache got copied over:
49
49
50 $ ls .hg/cache
50 $ ls .hg/cache
51 branch2-served
51 branch2-served
52 checkisexec (execbit !)
52 checkisexec (execbit !)
53 checklink (symlink !)
53 checklink (symlink !)
54 checklink-target (symlink !)
54 checklink-target (symlink !)
55 rbc-names-v1
55 rbc-names-v1
56 rbc-revs-v1
56 rbc-revs-v1
57
57
58 $ cat a
58 $ cat a
59 a
59 a
60 $ hg verify
60 $ hg verify
61 checking changesets
61 checking changesets
62 checking manifests
62 checking manifests
63 crosschecking files in changesets and manifests
63 crosschecking files in changesets and manifests
64 checking files
64 checking files
65 2 files, 11 changesets, 11 total revisions
65 2 files, 11 changesets, 11 total revisions
66
66
67 Invalid dest '' must abort:
67 Invalid dest '' must abort:
68
68
69 $ hg clone . ''
69 $ hg clone . ''
70 abort: empty destination path is not valid
70 abort: empty destination path is not valid
71 [255]
71 [255]
72
72
73 No update, with debug option:
73 No update, with debug option:
74
74
75 #if hardlink
75 #if hardlink
76 $ hg --debug clone -U . ../c --config progress.debug=true
76 $ hg --debug clone -U . ../c --config progress.debug=true
77 linking: 1
77 linking: 1
78 linking: 2
78 linking: 2
79 linking: 3
79 linking: 3
80 linking: 4
80 linking: 4
81 linking: 5
81 linking: 5
82 linking: 6
82 linking: 6
83 linking: 7
83 linking: 7
84 linking: 8
84 linking: 8
85 linked 8 files
85 linked 8 files
86 #else
86 #else
87 $ hg --debug clone -U . ../c --config progress.debug=true
87 $ hg --debug clone -U . ../c --config progress.debug=true
88 linking: 1
88 linking: 1
89 copying: 2
89 copying: 2
90 copying: 3
90 copying: 3
91 copying: 4
91 copying: 4
92 copying: 5
92 copying: 5
93 copying: 6
93 copying: 6
94 copying: 7
94 copying: 7
95 copying: 8
95 copying: 8
96 copied 8 files
96 copied 8 files
97 #endif
97 #endif
98 $ cd ../c
98 $ cd ../c
99
99
100 Ensure branchcache got copied over:
100 Ensure branchcache got copied over:
101
101
102 $ ls .hg/cache
102 $ ls .hg/cache
103 branch2-served
103 branch2-served
104 rbc-names-v1
104 rbc-names-v1
105 rbc-revs-v1
105 rbc-revs-v1
106
106
107 $ cat a 2>/dev/null || echo "a not present"
107 $ cat a 2>/dev/null || echo "a not present"
108 a not present
108 a not present
109 $ hg verify
109 $ hg verify
110 checking changesets
110 checking changesets
111 checking manifests
111 checking manifests
112 crosschecking files in changesets and manifests
112 crosschecking files in changesets and manifests
113 checking files
113 checking files
114 2 files, 11 changesets, 11 total revisions
114 2 files, 11 changesets, 11 total revisions
115
115
116 Default destination:
116 Default destination:
117
117
118 $ mkdir ../d
118 $ mkdir ../d
119 $ cd ../d
119 $ cd ../d
120 $ hg clone ../a
120 $ hg clone ../a
121 destination directory: a
121 destination directory: a
122 updating to branch default
122 updating to branch default
123 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
123 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
124 $ cd a
124 $ cd a
125 $ hg cat a
125 $ hg cat a
126 a
126 a
127 $ cd ../..
127 $ cd ../..
128
128
129 Check that we drop the 'file:' from the path before writing the .hgrc:
129 Check that we drop the 'file:' from the path before writing the .hgrc:
130
130
131 $ hg clone file:a e
131 $ hg clone file:a e
132 updating to branch default
132 updating to branch default
133 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
133 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
134 $ grep 'file:' e/.hg/hgrc
134 $ grep 'file:' e/.hg/hgrc
135 [1]
135 [1]
136
136
137 Check that path aliases are expanded:
137 Check that path aliases are expanded:
138
138
139 $ hg clone -q -U --config 'paths.foobar=a#0' foobar f
139 $ hg clone -q -U --config 'paths.foobar=a#0' foobar f
140 $ hg -R f showconfig paths.default
140 $ hg -R f showconfig paths.default
141 $TESTTMP/a#0 (glob)
141 $TESTTMP/a#0 (glob)
142
142
143 Use --pull:
143 Use --pull:
144
144
145 $ hg clone --pull a g
145 $ hg clone --pull a g
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 11 changesets with 11 changes to 2 files
150 added 11 changesets with 11 changes to 2 files
151 updating to branch default
151 updating to branch default
152 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
152 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
153 $ hg -R g verify
153 $ hg -R g verify
154 checking changesets
154 checking changesets
155 checking manifests
155 checking manifests
156 crosschecking files in changesets and manifests
156 crosschecking files in changesets and manifests
157 checking files
157 checking files
158 2 files, 11 changesets, 11 total revisions
158 2 files, 11 changesets, 11 total revisions
159
159
160 Invalid dest '' with --pull must abort (issue2528):
160 Invalid dest '' with --pull must abort (issue2528):
161
161
162 $ hg clone --pull a ''
162 $ hg clone --pull a ''
163 abort: empty destination path is not valid
163 abort: empty destination path is not valid
164 [255]
164 [255]
165
165
166 Clone to '.':
166 Clone to '.':
167
167
168 $ mkdir h
168 $ mkdir h
169 $ cd h
169 $ cd h
170 $ hg clone ../a .
170 $ hg clone ../a .
171 updating to branch default
171 updating to branch default
172 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
172 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
173 $ cd ..
173 $ cd ..
174
174
175
175
176 *** Tests for option -u ***
176 *** Tests for option -u ***
177
177
178 Adding some more history to repo a:
178 Adding some more history to repo a:
179
179
180 $ cd a
180 $ cd a
181 $ hg tag ref1
181 $ hg tag ref1
182 $ echo the quick brown fox >a
182 $ echo the quick brown fox >a
183 $ hg ci -m "hacked default"
183 $ hg ci -m "hacked default"
184 $ hg up ref1
184 $ hg up ref1
185 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
185 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
186 $ hg branch stable
186 $ hg branch stable
187 marked working directory as branch stable
187 marked working directory as branch stable
188 (branches are permanent and global, did you want a bookmark?)
188 (branches are permanent and global, did you want a bookmark?)
189 $ echo some text >a
189 $ echo some text >a
190 $ hg ci -m "starting branch stable"
190 $ hg ci -m "starting branch stable"
191 $ hg tag ref2
191 $ hg tag ref2
192 $ echo some more text >a
192 $ echo some more text >a
193 $ hg ci -m "another change for branch stable"
193 $ hg ci -m "another change for branch stable"
194 $ hg up ref2
194 $ hg up ref2
195 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
195 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
196 $ hg parents
196 $ hg parents
197 changeset: 13:e8ece76546a6
197 changeset: 13:e8ece76546a6
198 branch: stable
198 branch: stable
199 tag: ref2
199 tag: ref2
200 parent: 10:a7949464abda
200 parent: 10:a7949464abda
201 user: test
201 user: test
202 date: Thu Jan 01 00:00:00 1970 +0000
202 date: Thu Jan 01 00:00:00 1970 +0000
203 summary: starting branch stable
203 summary: starting branch stable
204
204
205
205
206 Repo a has two heads:
206 Repo a has two heads:
207
207
208 $ hg heads
208 $ hg heads
209 changeset: 15:0aae7cf88f0d
209 changeset: 15:0aae7cf88f0d
210 branch: stable
210 branch: stable
211 tag: tip
211 tag: tip
212 user: test
212 user: test
213 date: Thu Jan 01 00:00:00 1970 +0000
213 date: Thu Jan 01 00:00:00 1970 +0000
214 summary: another change for branch stable
214 summary: another change for branch stable
215
215
216 changeset: 12:f21241060d6a
216 changeset: 12:f21241060d6a
217 user: test
217 user: test
218 date: Thu Jan 01 00:00:00 1970 +0000
218 date: Thu Jan 01 00:00:00 1970 +0000
219 summary: hacked default
219 summary: hacked default
220
220
221
221
222 $ cd ..
222 $ cd ..
223
223
224
224
225 Testing --noupdate with --updaterev (must abort):
225 Testing --noupdate with --updaterev (must abort):
226
226
227 $ hg clone --noupdate --updaterev 1 a ua
227 $ hg clone --noupdate --updaterev 1 a ua
228 abort: cannot specify both --noupdate and --updaterev
228 abort: cannot specify both --noupdate and --updaterev
229 [255]
229 [255]
230
230
231
231
232 Testing clone -u:
232 Testing clone -u:
233
233
234 $ hg clone -u . a ua
234 $ hg clone -u . a ua
235 updating to branch stable
235 updating to branch stable
236 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
236 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
237
237
238 Repo ua has both heads:
238 Repo ua has both heads:
239
239
240 $ hg -R ua heads
240 $ hg -R ua heads
241 changeset: 15:0aae7cf88f0d
241 changeset: 15:0aae7cf88f0d
242 branch: stable
242 branch: stable
243 tag: tip
243 tag: tip
244 user: test
244 user: test
245 date: Thu Jan 01 00:00:00 1970 +0000
245 date: Thu Jan 01 00:00:00 1970 +0000
246 summary: another change for branch stable
246 summary: another change for branch stable
247
247
248 changeset: 12:f21241060d6a
248 changeset: 12:f21241060d6a
249 user: test
249 user: test
250 date: Thu Jan 01 00:00:00 1970 +0000
250 date: Thu Jan 01 00:00:00 1970 +0000
251 summary: hacked default
251 summary: hacked default
252
252
253
253
254 Same revision checked out in repo a and ua:
254 Same revision checked out in repo a and ua:
255
255
256 $ hg -R a parents --template "{node|short}\n"
256 $ hg -R a parents --template "{node|short}\n"
257 e8ece76546a6
257 e8ece76546a6
258 $ hg -R ua parents --template "{node|short}\n"
258 $ hg -R ua parents --template "{node|short}\n"
259 e8ece76546a6
259 e8ece76546a6
260
260
261 $ rm -r ua
261 $ rm -r ua
262
262
263
263
264 Testing clone --pull -u:
264 Testing clone --pull -u:
265
265
266 $ hg clone --pull -u . a ua
266 $ hg clone --pull -u . a ua
267 requesting all changes
267 requesting all changes
268 adding changesets
268 adding changesets
269 adding manifests
269 adding manifests
270 adding file changes
270 adding file changes
271 added 16 changesets with 16 changes to 3 files (+1 heads)
271 added 16 changesets with 16 changes to 3 files (+1 heads)
272 updating to branch stable
272 updating to branch stable
273 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
273 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
274
274
275 Repo ua has both heads:
275 Repo ua has both heads:
276
276
277 $ hg -R ua heads
277 $ hg -R ua heads
278 changeset: 15:0aae7cf88f0d
278 changeset: 15:0aae7cf88f0d
279 branch: stable
279 branch: stable
280 tag: tip
280 tag: tip
281 user: test
281 user: test
282 date: Thu Jan 01 00:00:00 1970 +0000
282 date: Thu Jan 01 00:00:00 1970 +0000
283 summary: another change for branch stable
283 summary: another change for branch stable
284
284
285 changeset: 12:f21241060d6a
285 changeset: 12:f21241060d6a
286 user: test
286 user: test
287 date: Thu Jan 01 00:00:00 1970 +0000
287 date: Thu Jan 01 00:00:00 1970 +0000
288 summary: hacked default
288 summary: hacked default
289
289
290
290
291 Same revision checked out in repo a and ua:
291 Same revision checked out in repo a and ua:
292
292
293 $ hg -R a parents --template "{node|short}\n"
293 $ hg -R a parents --template "{node|short}\n"
294 e8ece76546a6
294 e8ece76546a6
295 $ hg -R ua parents --template "{node|short}\n"
295 $ hg -R ua parents --template "{node|short}\n"
296 e8ece76546a6
296 e8ece76546a6
297
297
298 $ rm -r ua
298 $ rm -r ua
299
299
300
300
301 Testing clone -u <branch>:
301 Testing clone -u <branch>:
302
302
303 $ hg clone -u stable a ua
303 $ hg clone -u stable a ua
304 updating to branch stable
304 updating to branch stable
305 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
305 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
306
306
307 Repo ua has both heads:
307 Repo ua has both heads:
308
308
309 $ hg -R ua heads
309 $ hg -R ua heads
310 changeset: 15:0aae7cf88f0d
310 changeset: 15:0aae7cf88f0d
311 branch: stable
311 branch: stable
312 tag: tip
312 tag: tip
313 user: test
313 user: test
314 date: Thu Jan 01 00:00:00 1970 +0000
314 date: Thu Jan 01 00:00:00 1970 +0000
315 summary: another change for branch stable
315 summary: another change for branch stable
316
316
317 changeset: 12:f21241060d6a
317 changeset: 12:f21241060d6a
318 user: test
318 user: test
319 date: Thu Jan 01 00:00:00 1970 +0000
319 date: Thu Jan 01 00:00:00 1970 +0000
320 summary: hacked default
320 summary: hacked default
321
321
322
322
323 Branch 'stable' is checked out:
323 Branch 'stable' is checked out:
324
324
325 $ hg -R ua parents
325 $ hg -R ua parents
326 changeset: 15:0aae7cf88f0d
326 changeset: 15:0aae7cf88f0d
327 branch: stable
327 branch: stable
328 tag: tip
328 tag: tip
329 user: test
329 user: test
330 date: Thu Jan 01 00:00:00 1970 +0000
330 date: Thu Jan 01 00:00:00 1970 +0000
331 summary: another change for branch stable
331 summary: another change for branch stable
332
332
333
333
334 $ rm -r ua
334 $ rm -r ua
335
335
336
336
337 Testing default checkout:
337 Testing default checkout:
338
338
339 $ hg clone a ua
339 $ hg clone a ua
340 updating to branch default
340 updating to branch default
341 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
341 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
342
342
343 Repo ua has both heads:
343 Repo ua has both heads:
344
344
345 $ hg -R ua heads
345 $ hg -R ua heads
346 changeset: 15:0aae7cf88f0d
346 changeset: 15:0aae7cf88f0d
347 branch: stable
347 branch: stable
348 tag: tip
348 tag: tip
349 user: test
349 user: test
350 date: Thu Jan 01 00:00:00 1970 +0000
350 date: Thu Jan 01 00:00:00 1970 +0000
351 summary: another change for branch stable
351 summary: another change for branch stable
352
352
353 changeset: 12:f21241060d6a
353 changeset: 12:f21241060d6a
354 user: test
354 user: test
355 date: Thu Jan 01 00:00:00 1970 +0000
355 date: Thu Jan 01 00:00:00 1970 +0000
356 summary: hacked default
356 summary: hacked default
357
357
358
358
359 Branch 'default' is checked out:
359 Branch 'default' is checked out:
360
360
361 $ hg -R ua parents
361 $ hg -R ua parents
362 changeset: 12:f21241060d6a
362 changeset: 12:f21241060d6a
363 user: test
363 user: test
364 date: Thu Jan 01 00:00:00 1970 +0000
364 date: Thu Jan 01 00:00:00 1970 +0000
365 summary: hacked default
365 summary: hacked default
366
366
367 Test clone with a branch named "@" (issue3677)
367 Test clone with a branch named "@" (issue3677)
368
368
369 $ hg -R ua branch @
369 $ hg -R ua branch @
370 marked working directory as branch @
370 marked working directory as branch @
371 $ hg -R ua commit -m 'created branch @'
371 $ hg -R ua commit -m 'created branch @'
372 $ hg clone ua atbranch
372 $ hg clone ua atbranch
373 updating to branch default
373 updating to branch default
374 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
374 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
375 $ hg -R atbranch heads
375 $ hg -R atbranch heads
376 changeset: 16:798b6d97153e
376 changeset: 16:798b6d97153e
377 branch: @
377 branch: @
378 tag: tip
378 tag: tip
379 parent: 12:f21241060d6a
379 parent: 12:f21241060d6a
380 user: test
380 user: test
381 date: Thu Jan 01 00:00:00 1970 +0000
381 date: Thu Jan 01 00:00:00 1970 +0000
382 summary: created branch @
382 summary: created branch @
383
383
384 changeset: 15:0aae7cf88f0d
384 changeset: 15:0aae7cf88f0d
385 branch: stable
385 branch: stable
386 user: test
386 user: test
387 date: Thu Jan 01 00:00:00 1970 +0000
387 date: Thu Jan 01 00:00:00 1970 +0000
388 summary: another change for branch stable
388 summary: another change for branch stable
389
389
390 changeset: 12:f21241060d6a
390 changeset: 12:f21241060d6a
391 user: test
391 user: test
392 date: Thu Jan 01 00:00:00 1970 +0000
392 date: Thu Jan 01 00:00:00 1970 +0000
393 summary: hacked default
393 summary: hacked default
394
394
395 $ hg -R atbranch parents
395 $ hg -R atbranch parents
396 changeset: 12:f21241060d6a
396 changeset: 12:f21241060d6a
397 user: test
397 user: test
398 date: Thu Jan 01 00:00:00 1970 +0000
398 date: Thu Jan 01 00:00:00 1970 +0000
399 summary: hacked default
399 summary: hacked default
400
400
401
401
402 $ rm -r ua atbranch
402 $ rm -r ua atbranch
403
403
404
404
405 Testing #<branch>:
405 Testing #<branch>:
406
406
407 $ hg clone -u . a#stable ua
407 $ hg clone -u . a#stable ua
408 adding changesets
408 adding changesets
409 adding manifests
409 adding manifests
410 adding file changes
410 adding file changes
411 added 14 changesets with 14 changes to 3 files
411 added 14 changesets with 14 changes to 3 files
412 updating to branch stable
412 updating to branch stable
413 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
413 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
414
414
415 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
415 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
416
416
417 $ hg -R ua heads
417 $ hg -R ua heads
418 changeset: 13:0aae7cf88f0d
418 changeset: 13:0aae7cf88f0d
419 branch: stable
419 branch: stable
420 tag: tip
420 tag: tip
421 user: test
421 user: test
422 date: Thu Jan 01 00:00:00 1970 +0000
422 date: Thu Jan 01 00:00:00 1970 +0000
423 summary: another change for branch stable
423 summary: another change for branch stable
424
424
425 changeset: 10:a7949464abda
425 changeset: 10:a7949464abda
426 user: test
426 user: test
427 date: Thu Jan 01 00:00:00 1970 +0000
427 date: Thu Jan 01 00:00:00 1970 +0000
428 summary: test
428 summary: test
429
429
430
430
431 Same revision checked out in repo a and ua:
431 Same revision checked out in repo a and ua:
432
432
433 $ hg -R a parents --template "{node|short}\n"
433 $ hg -R a parents --template "{node|short}\n"
434 e8ece76546a6
434 e8ece76546a6
435 $ hg -R ua parents --template "{node|short}\n"
435 $ hg -R ua parents --template "{node|short}\n"
436 e8ece76546a6
436 e8ece76546a6
437
437
438 $ rm -r ua
438 $ rm -r ua
439
439
440
440
441 Testing -u -r <branch>:
441 Testing -u -r <branch>:
442
442
443 $ hg clone -u . -r stable a ua
443 $ hg clone -u . -r stable a ua
444 adding changesets
444 adding changesets
445 adding manifests
445 adding manifests
446 adding file changes
446 adding file changes
447 added 14 changesets with 14 changes to 3 files
447 added 14 changesets with 14 changes to 3 files
448 updating to branch stable
448 updating to branch stable
449 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
449 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
450
450
451 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
451 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
452
452
453 $ hg -R ua heads
453 $ hg -R ua heads
454 changeset: 13:0aae7cf88f0d
454 changeset: 13:0aae7cf88f0d
455 branch: stable
455 branch: stable
456 tag: tip
456 tag: tip
457 user: test
457 user: test
458 date: Thu Jan 01 00:00:00 1970 +0000
458 date: Thu Jan 01 00:00:00 1970 +0000
459 summary: another change for branch stable
459 summary: another change for branch stable
460
460
461 changeset: 10:a7949464abda
461 changeset: 10:a7949464abda
462 user: test
462 user: test
463 date: Thu Jan 01 00:00:00 1970 +0000
463 date: Thu Jan 01 00:00:00 1970 +0000
464 summary: test
464 summary: test
465
465
466
466
467 Same revision checked out in repo a and ua:
467 Same revision checked out in repo a and ua:
468
468
469 $ hg -R a parents --template "{node|short}\n"
469 $ hg -R a parents --template "{node|short}\n"
470 e8ece76546a6
470 e8ece76546a6
471 $ hg -R ua parents --template "{node|short}\n"
471 $ hg -R ua parents --template "{node|short}\n"
472 e8ece76546a6
472 e8ece76546a6
473
473
474 $ rm -r ua
474 $ rm -r ua
475
475
476
476
477 Testing -r <branch>:
477 Testing -r <branch>:
478
478
479 $ hg clone -r stable a ua
479 $ hg clone -r stable a ua
480 adding changesets
480 adding changesets
481 adding manifests
481 adding manifests
482 adding file changes
482 adding file changes
483 added 14 changesets with 14 changes to 3 files
483 added 14 changesets with 14 changes to 3 files
484 updating to branch stable
484 updating to branch stable
485 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
485 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
486
486
487 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
487 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
488
488
489 $ hg -R ua heads
489 $ hg -R ua heads
490 changeset: 13:0aae7cf88f0d
490 changeset: 13:0aae7cf88f0d
491 branch: stable
491 branch: stable
492 tag: tip
492 tag: tip
493 user: test
493 user: test
494 date: Thu Jan 01 00:00:00 1970 +0000
494 date: Thu Jan 01 00:00:00 1970 +0000
495 summary: another change for branch stable
495 summary: another change for branch stable
496
496
497 changeset: 10:a7949464abda
497 changeset: 10:a7949464abda
498 user: test
498 user: test
499 date: Thu Jan 01 00:00:00 1970 +0000
499 date: Thu Jan 01 00:00:00 1970 +0000
500 summary: test
500 summary: test
501
501
502
502
503 Branch 'stable' is checked out:
503 Branch 'stable' is checked out:
504
504
505 $ hg -R ua parents
505 $ hg -R ua parents
506 changeset: 13:0aae7cf88f0d
506 changeset: 13:0aae7cf88f0d
507 branch: stable
507 branch: stable
508 tag: tip
508 tag: tip
509 user: test
509 user: test
510 date: Thu Jan 01 00:00:00 1970 +0000
510 date: Thu Jan 01 00:00:00 1970 +0000
511 summary: another change for branch stable
511 summary: another change for branch stable
512
512
513
513
514 $ rm -r ua
514 $ rm -r ua
515
515
516
516
517 Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not
517 Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not
518 iterable in addbranchrevs()
518 iterable in addbranchrevs()
519
519
520 $ cat <<EOF > simpleclone.py
520 $ cat <<EOF > simpleclone.py
521 > from mercurial import ui, hg
521 > from mercurial import ui, hg
522 > myui = ui.ui.load()
522 > myui = ui.ui.load()
523 > repo = hg.repository(myui, 'a')
523 > repo = hg.repository(myui, 'a')
524 > hg.clone(myui, {}, repo, dest="ua")
524 > hg.clone(myui, {}, repo, dest="ua")
525 > EOF
525 > EOF
526
526
527 $ $PYTHON simpleclone.py
527 $ $PYTHON simpleclone.py
528 updating to branch default
528 updating to branch default
529 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
529 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
530
530
531 $ rm -r ua
531 $ rm -r ua
532
532
533 $ cat <<EOF > branchclone.py
533 $ cat <<EOF > branchclone.py
534 > from mercurial import ui, hg, extensions
534 > from mercurial import ui, hg, extensions
535 > myui = ui.ui.load()
535 > myui = ui.ui.load()
536 > extensions.loadall(myui)
536 > extensions.loadall(myui)
537 > repo = hg.repository(myui, 'a')
537 > repo = hg.repository(myui, 'a')
538 > hg.clone(myui, {}, repo, dest="ua", branch=["stable",])
538 > hg.clone(myui, {}, repo, dest="ua", branch=["stable",])
539 > EOF
539 > EOF
540
540
541 $ $PYTHON branchclone.py
541 $ $PYTHON branchclone.py
542 adding changesets
542 adding changesets
543 adding manifests
543 adding manifests
544 adding file changes
544 adding file changes
545 added 14 changesets with 14 changes to 3 files
545 added 14 changesets with 14 changes to 3 files
546 updating to branch stable
546 updating to branch stable
547 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
547 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
548 $ rm -r ua
548 $ rm -r ua
549
549
550
550
551 Test clone with special '@' bookmark:
551 Test clone with special '@' bookmark:
552 $ cd a
552 $ cd a
553 $ hg bookmark -r a7949464abda @ # branch point of stable from default
553 $ hg bookmark -r a7949464abda @ # branch point of stable from default
554 $ hg clone . ../i
554 $ hg clone . ../i
555 updating to bookmark @
555 updating to bookmark @
556 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
556 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
557 $ hg id -i ../i
557 $ hg id -i ../i
558 a7949464abda
558 a7949464abda
559 $ rm -r ../i
559 $ rm -r ../i
560
560
561 $ hg bookmark -f -r stable @
561 $ hg bookmark -f -r stable @
562 $ hg bookmarks
562 $ hg bookmarks
563 @ 15:0aae7cf88f0d
563 @ 15:0aae7cf88f0d
564 $ hg clone . ../i
564 $ hg clone . ../i
565 updating to bookmark @ on branch stable
565 updating to bookmark @ on branch stable
566 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
566 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
567 $ hg id -i ../i
567 $ hg id -i ../i
568 0aae7cf88f0d
568 0aae7cf88f0d
569 $ cd "$TESTTMP"
569 $ cd "$TESTTMP"
570
570
571
571
572 Testing failures:
572 Testing failures:
573
573
574 $ mkdir fail
574 $ mkdir fail
575 $ cd fail
575 $ cd fail
576
576
577 No local source
577 No local source
578
578
579 $ hg clone a b
579 $ hg clone a b
580 abort: repository a not found!
580 abort: repository a not found!
581 [255]
581 [255]
582
582
583 No remote source
583 No remote source
584
584
585 #if windows
585 #if windows
586 $ hg clone http://$LOCALIP:3121/a b
586 $ hg clone http://$LOCALIP:3121/a b
587 abort: error: * (glob)
587 abort: error: * (glob)
588 [255]
588 [255]
589 #else
589 #else
590 $ hg clone http://$LOCALIP:3121/a b
590 $ hg clone http://$LOCALIP:3121/a b
591 abort: error: *refused* (glob)
591 abort: error: *refused* (glob)
592 [255]
592 [255]
593 #endif
593 #endif
594 $ rm -rf b # work around bug with http clone
594 $ rm -rf b # work around bug with http clone
595
595
596
596
597 #if unix-permissions no-root
597 #if unix-permissions no-root
598
598
599 Inaccessible source
599 Inaccessible source
600
600
601 $ mkdir a
601 $ mkdir a
602 $ chmod 000 a
602 $ chmod 000 a
603 $ hg clone a b
603 $ hg clone a b
604 abort: repository a not found!
604 abort: repository a not found!
605 [255]
605 [255]
606
606
607 Inaccessible destination
607 Inaccessible destination
608
608
609 $ hg init b
609 $ hg init b
610 $ cd b
610 $ cd b
611 $ hg clone . ../a
611 $ hg clone . ../a
612 abort: Permission denied: '../a'
612 abort: Permission denied: '../a'
613 [255]
613 [255]
614 $ cd ..
614 $ cd ..
615 $ chmod 700 a
615 $ chmod 700 a
616 $ rm -r a b
616 $ rm -r a b
617
617
618 #endif
618 #endif
619
619
620
620
621 #if fifo
621 #if fifo
622
622
623 Source of wrong type
623 Source of wrong type
624
624
625 $ mkfifo a
625 $ mkfifo a
626 $ hg clone a b
626 $ hg clone a b
627 abort: repository a not found!
627 abort: repository a not found!
628 [255]
628 [255]
629 $ rm a
629 $ rm a
630
630
631 #endif
631 #endif
632
632
633 Default destination, same directory
633 Default destination, same directory
634
634
635 $ hg init q
635 $ hg init q
636 $ hg clone q
636 $ hg clone q
637 destination directory: q
637 destination directory: q
638 abort: destination 'q' is not empty
638 abort: destination 'q' is not empty
639 [255]
639 [255]
640
640
641 destination directory not empty
641 destination directory not empty
642
642
643 $ mkdir a
643 $ mkdir a
644 $ echo stuff > a/a
644 $ echo stuff > a/a
645 $ hg clone q a
645 $ hg clone q a
646 abort: destination 'a' is not empty
646 abort: destination 'a' is not empty
647 [255]
647 [255]
648
648
649
649
650 #if unix-permissions no-root
650 #if unix-permissions no-root
651
651
652 leave existing directory in place after clone failure
652 leave existing directory in place after clone failure
653
653
654 $ hg init c
654 $ hg init c
655 $ cd c
655 $ cd c
656 $ echo c > c
656 $ echo c > c
657 $ hg commit -A -m test
657 $ hg commit -A -m test
658 adding c
658 adding c
659 $ chmod -rx .hg/store/data
659 $ chmod -rx .hg/store/data
660 $ cd ..
660 $ cd ..
661 $ mkdir d
661 $ mkdir d
662 $ hg clone c d 2> err
662 $ hg clone c d 2> err
663 [255]
663 [255]
664 $ test -d d
664 $ test -d d
665 $ test -d d/.hg
665 $ test -d d/.hg
666 [1]
666 [1]
667
667
668 re-enable perm to allow deletion
668 re-enable perm to allow deletion
669
669
670 $ chmod +rx c/.hg/store/data
670 $ chmod +rx c/.hg/store/data
671
671
672 #endif
672 #endif
673
673
674 $ cd ..
674 $ cd ..
675
675
676 Test clone from the repository in (emulated) revlog format 0 (issue4203):
676 Test clone from the repository in (emulated) revlog format 0 (issue4203):
677
677
678 $ mkdir issue4203
678 $ mkdir issue4203
679 $ mkdir -p src/.hg
679 $ mkdir -p src/.hg
680 $ echo foo > src/foo
680 $ echo foo > src/foo
681 $ hg -R src add src/foo
681 $ hg -R src add src/foo
682 $ hg -R src commit -m '#0'
682 $ hg -R src commit -m '#0'
683 $ hg -R src log -q
683 $ hg -R src log -q
684 0:e1bab28bca43
684 0:e1bab28bca43
685 $ hg clone -U -q src dst
685 $ hg clone -U -q src dst
686 $ hg -R dst log -q
686 $ hg -R dst log -q
687 0:e1bab28bca43
687 0:e1bab28bca43
688
688
689 Create repositories to test auto sharing functionality
689 Create repositories to test auto sharing functionality
690
690
691 $ cat >> $HGRCPATH << EOF
691 $ cat >> $HGRCPATH << EOF
692 > [extensions]
692 > [extensions]
693 > share=
693 > share=
694 > EOF
694 > EOF
695
695
696 $ hg init empty
696 $ hg init empty
697 $ hg init source1a
697 $ hg init source1a
698 $ cd source1a
698 $ cd source1a
699 $ echo initial1 > foo
699 $ echo initial1 > foo
700 $ hg -q commit -A -m initial
700 $ hg -q commit -A -m initial
701 $ echo second > foo
701 $ echo second > foo
702 $ hg commit -m second
702 $ hg commit -m second
703 $ cd ..
703 $ cd ..
704
704
705 $ hg init filteredrev0
705 $ hg init filteredrev0
706 $ cd filteredrev0
706 $ cd filteredrev0
707 $ cat >> .hg/hgrc << EOF
707 $ cat >> .hg/hgrc << EOF
708 > [experimental]
708 > [experimental]
709 > evolution=createmarkers
709 > evolution=createmarkers
710 > EOF
710 > EOF
711 $ echo initial1 > foo
711 $ echo initial1 > foo
712 $ hg -q commit -A -m initial0
712 $ hg -q commit -A -m initial0
713 $ hg -q up -r null
713 $ hg -q up -r null
714 $ echo initial2 > foo
714 $ echo initial2 > foo
715 $ hg -q commit -A -m initial1
715 $ hg -q commit -A -m initial1
716 $ hg debugobsolete c05d5c47a5cf81401869999f3d05f7d699d2b29a e082c1832e09a7d1e78b7fd49a592d372de854c8
716 $ hg debugobsolete c05d5c47a5cf81401869999f3d05f7d699d2b29a e082c1832e09a7d1e78b7fd49a592d372de854c8
717 obsoleted 1 changesets
717 obsoleted 1 changesets
718 $ cd ..
718 $ cd ..
719
719
720 $ hg -q clone --pull source1a source1b
720 $ hg -q clone --pull source1a source1b
721 $ cd source1a
721 $ cd source1a
722 $ hg bookmark bookA
722 $ hg bookmark bookA
723 $ echo 1a > foo
723 $ echo 1a > foo
724 $ hg commit -m 1a
724 $ hg commit -m 1a
725 $ cd ../source1b
725 $ cd ../source1b
726 $ hg -q up -r 0
726 $ hg -q up -r 0
727 $ echo head1 > foo
727 $ echo head1 > foo
728 $ hg commit -m head1
728 $ hg commit -m head1
729 created new head
729 created new head
730 $ hg bookmark head1
730 $ hg bookmark head1
731 $ hg -q up -r 0
731 $ hg -q up -r 0
732 $ echo head2 > foo
732 $ echo head2 > foo
733 $ hg commit -m head2
733 $ hg commit -m head2
734 created new head
734 created new head
735 $ hg bookmark head2
735 $ hg bookmark head2
736 $ hg -q up -r 0
736 $ hg -q up -r 0
737 $ hg branch branch1
737 $ hg branch branch1
738 marked working directory as branch branch1
738 marked working directory as branch branch1
739 (branches are permanent and global, did you want a bookmark?)
739 (branches are permanent and global, did you want a bookmark?)
740 $ echo branch1 > foo
740 $ echo branch1 > foo
741 $ hg commit -m branch1
741 $ hg commit -m branch1
742 $ hg -q up -r 0
742 $ hg -q up -r 0
743 $ hg branch branch2
743 $ hg branch branch2
744 marked working directory as branch branch2
744 marked working directory as branch branch2
745 $ echo branch2 > foo
745 $ echo branch2 > foo
746 $ hg commit -m branch2
746 $ hg commit -m branch2
747 $ cd ..
747 $ cd ..
748 $ hg init source2
748 $ hg init source2
749 $ cd source2
749 $ cd source2
750 $ echo initial2 > foo
750 $ echo initial2 > foo
751 $ hg -q commit -A -m initial2
751 $ hg -q commit -A -m initial2
752 $ echo second > foo
752 $ echo second > foo
753 $ hg commit -m second
753 $ hg commit -m second
754 $ cd ..
754 $ cd ..
755
755
756 Clone with auto share from an empty repo should not result in share
756 Clone with auto share from an empty repo should not result in share
757
757
758 $ mkdir share
758 $ mkdir share
759 $ hg --config share.pool=share clone empty share-empty
759 $ hg --config share.pool=share clone empty share-empty
760 (not using pooled storage: remote appears to be empty)
760 (not using pooled storage: remote appears to be empty)
761 updating to branch default
761 updating to branch default
762 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
762 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
763 $ ls share
763 $ ls share
764 $ test -d share-empty/.hg/store
764 $ test -d share-empty/.hg/store
765 $ test -f share-empty/.hg/sharedpath
765 $ test -f share-empty/.hg/sharedpath
766 [1]
766 [1]
767
767
768 Clone with auto share from a repo with filtered revision 0 should not result in share
768 Clone with auto share from a repo with filtered revision 0 should not result in share
769
769
770 $ hg --config share.pool=share clone filteredrev0 share-filtered
770 $ hg --config share.pool=share clone filteredrev0 share-filtered
771 (not using pooled storage: unable to resolve identity of remote)
771 (not using pooled storage: unable to resolve identity of remote)
772 requesting all changes
772 requesting all changes
773 adding changesets
773 adding changesets
774 adding manifests
774 adding manifests
775 adding file changes
775 adding file changes
776 added 1 changesets with 1 changes to 1 files
776 added 1 changesets with 1 changes to 1 files
777 updating to branch default
777 updating to branch default
778 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
778 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
779
779
780 Clone from repo with content should result in shared store being created
780 Clone from repo with content should result in shared store being created
781
781
782 $ hg --config share.pool=share clone source1a share-dest1a
782 $ hg --config share.pool=share clone source1a share-dest1a
783 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
783 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
784 requesting all changes
784 requesting all changes
785 adding changesets
785 adding changesets
786 adding manifests
786 adding manifests
787 adding file changes
787 adding file changes
788 added 3 changesets with 3 changes to 1 files
788 added 3 changesets with 3 changes to 1 files
789 searching for changes
789 searching for changes
790 no changes found
790 no changes found
791 adding remote bookmark bookA
791 adding remote bookmark bookA
792 updating working directory
792 updating working directory
793 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
793 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
794
794
795 The shared repo should have been created
795 The shared repo should have been created
796
796
797 $ ls share
797 $ ls share
798 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
798 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
799
799
800 The destination should point to it
800 The destination should point to it
801
801
802 $ cat share-dest1a/.hg/sharedpath; echo
802 $ cat share-dest1a/.hg/sharedpath; echo
803 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg (glob)
803 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg (glob)
804
804
805 The destination should have bookmarks
805 The destination should have bookmarks
806
806
807 $ hg -R share-dest1a bookmarks
807 $ hg -R share-dest1a bookmarks
808 bookA 2:e5bfe23c0b47
808 bookA 2:e5bfe23c0b47
809
809
810 The default path should be the remote, not the share
810 The default path should be the remote, not the share
811
811
812 $ hg -R share-dest1a config paths.default
812 $ hg -R share-dest1a config paths.default
813 $TESTTMP/source1a (glob)
813 $TESTTMP/source1a (glob)
814
814
815 Clone with existing share dir should result in pull + share
815 Clone with existing share dir should result in pull + share
816
816
817 $ hg --config share.pool=share clone source1b share-dest1b
817 $ hg --config share.pool=share clone source1b share-dest1b
818 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
818 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
819 searching for changes
819 searching for changes
820 adding changesets
820 adding changesets
821 adding manifests
821 adding manifests
822 adding file changes
822 adding file changes
823 added 4 changesets with 4 changes to 1 files (+4 heads)
823 added 4 changesets with 4 changes to 1 files (+4 heads)
824 adding remote bookmark head1
824 adding remote bookmark head1
825 adding remote bookmark head2
825 adding remote bookmark head2
826 updating working directory
826 updating working directory
827 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
827 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
828
828
829 $ ls share
829 $ ls share
830 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
830 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
831
831
832 $ cat share-dest1b/.hg/sharedpath; echo
832 $ cat share-dest1b/.hg/sharedpath; echo
833 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg (glob)
833 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg (glob)
834
834
835 We only get bookmarks from the remote, not everything in the share
835 We only get bookmarks from the remote, not everything in the share
836
836
837 $ hg -R share-dest1b bookmarks
837 $ hg -R share-dest1b bookmarks
838 head1 3:4a8dc1ab4c13
838 head1 3:4a8dc1ab4c13
839 head2 4:99f71071f117
839 head2 4:99f71071f117
840
840
841 Default path should be source, not share.
841 Default path should be source, not share.
842
842
843 $ hg -R share-dest1b config paths.default
843 $ hg -R share-dest1b config paths.default
844 $TESTTMP/source1b (glob)
844 $TESTTMP/source1b (glob)
845
845
846 Checked out revision should be head of default branch
846 Checked out revision should be head of default branch
847
847
848 $ hg -R share-dest1b log -r .
848 $ hg -R share-dest1b log -r .
849 changeset: 4:99f71071f117
849 changeset: 4:99f71071f117
850 bookmark: head2
850 bookmark: head2
851 parent: 0:b5f04eac9d8f
851 parent: 0:b5f04eac9d8f
852 user: test
852 user: test
853 date: Thu Jan 01 00:00:00 1970 +0000
853 date: Thu Jan 01 00:00:00 1970 +0000
854 summary: head2
854 summary: head2
855
855
856
856
857 Clone from unrelated repo should result in new share
857 Clone from unrelated repo should result in new share
858
858
859 $ hg --config share.pool=share clone source2 share-dest2
859 $ hg --config share.pool=share clone source2 share-dest2
860 (sharing from new pooled repository 22aeff664783fd44c6d9b435618173c118c3448e)
860 (sharing from new pooled repository 22aeff664783fd44c6d9b435618173c118c3448e)
861 requesting all changes
861 requesting all changes
862 adding changesets
862 adding changesets
863 adding manifests
863 adding manifests
864 adding file changes
864 adding file changes
865 added 2 changesets with 2 changes to 1 files
865 added 2 changesets with 2 changes to 1 files
866 searching for changes
866 searching for changes
867 no changes found
867 no changes found
868 updating working directory
868 updating working directory
869 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
869 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
870
870
871 $ ls share
871 $ ls share
872 22aeff664783fd44c6d9b435618173c118c3448e
872 22aeff664783fd44c6d9b435618173c118c3448e
873 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
873 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
874
874
875 remote naming mode works as advertised
875 remote naming mode works as advertised
876
876
877 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1a share-remote1a
877 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1a share-remote1a
878 (sharing from new pooled repository 195bb1fcdb595c14a6c13e0269129ed78f6debde)
878 (sharing from new pooled repository 195bb1fcdb595c14a6c13e0269129ed78f6debde)
879 requesting all changes
879 requesting all changes
880 adding changesets
880 adding changesets
881 adding manifests
881 adding manifests
882 adding file changes
882 adding file changes
883 added 3 changesets with 3 changes to 1 files
883 added 3 changesets with 3 changes to 1 files
884 searching for changes
884 searching for changes
885 no changes found
885 no changes found
886 adding remote bookmark bookA
886 adding remote bookmark bookA
887 updating working directory
887 updating working directory
888 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
888 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
889
889
890 $ ls shareremote
890 $ ls shareremote
891 195bb1fcdb595c14a6c13e0269129ed78f6debde
891 195bb1fcdb595c14a6c13e0269129ed78f6debde
892
892
893 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1b share-remote1b
893 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1b share-remote1b
894 (sharing from new pooled repository c0d4f83847ca2a873741feb7048a45085fd47c46)
894 (sharing from new pooled repository c0d4f83847ca2a873741feb7048a45085fd47c46)
895 requesting all changes
895 requesting all changes
896 adding changesets
896 adding changesets
897 adding manifests
897 adding manifests
898 adding file changes
898 adding file changes
899 added 6 changesets with 6 changes to 1 files (+4 heads)
899 added 6 changesets with 6 changes to 1 files (+4 heads)
900 searching for changes
900 searching for changes
901 no changes found
901 no changes found
902 adding remote bookmark head1
902 adding remote bookmark head1
903 adding remote bookmark head2
903 adding remote bookmark head2
904 updating working directory
904 updating working directory
905 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
905 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
906
906
907 $ ls shareremote
907 $ ls shareremote
908 195bb1fcdb595c14a6c13e0269129ed78f6debde
908 195bb1fcdb595c14a6c13e0269129ed78f6debde
909 c0d4f83847ca2a873741feb7048a45085fd47c46
909 c0d4f83847ca2a873741feb7048a45085fd47c46
910
910
911 request to clone a single revision is respected in sharing mode
911 request to clone a single revision is respected in sharing mode
912
912
913 $ hg --config share.pool=sharerevs clone -r 4a8dc1ab4c13 source1b share-1arev
913 $ hg --config share.pool=sharerevs clone -r 4a8dc1ab4c13 source1b share-1arev
914 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
914 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
915 adding changesets
915 adding changesets
916 adding manifests
916 adding manifests
917 adding file changes
917 adding file changes
918 added 2 changesets with 2 changes to 1 files
918 added 2 changesets with 2 changes to 1 files
919 no changes found
919 no changes found
920 adding remote bookmark head1
920 adding remote bookmark head1
921 updating working directory
921 updating working directory
922 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
922 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
923
923
924 $ hg -R share-1arev log -G
924 $ hg -R share-1arev log -G
925 @ changeset: 1:4a8dc1ab4c13
925 @ changeset: 1:4a8dc1ab4c13
926 | bookmark: head1
926 | bookmark: head1
927 | tag: tip
927 | tag: tip
928 | user: test
928 | user: test
929 | date: Thu Jan 01 00:00:00 1970 +0000
929 | date: Thu Jan 01 00:00:00 1970 +0000
930 | summary: head1
930 | summary: head1
931 |
931 |
932 o changeset: 0:b5f04eac9d8f
932 o changeset: 0:b5f04eac9d8f
933 user: test
933 user: test
934 date: Thu Jan 01 00:00:00 1970 +0000
934 date: Thu Jan 01 00:00:00 1970 +0000
935 summary: initial
935 summary: initial
936
936
937
937
938 making another clone should only pull down requested rev
938 making another clone should only pull down requested rev
939
939
940 $ hg --config share.pool=sharerevs clone -r 99f71071f117 source1b share-1brev
940 $ hg --config share.pool=sharerevs clone -r 99f71071f117 source1b share-1brev
941 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
941 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
942 searching for changes
942 searching for changes
943 adding changesets
943 adding changesets
944 adding manifests
944 adding manifests
945 adding file changes
945 adding file changes
946 added 1 changesets with 1 changes to 1 files (+1 heads)
946 added 1 changesets with 1 changes to 1 files (+1 heads)
947 adding remote bookmark head1
947 adding remote bookmark head1
948 adding remote bookmark head2
948 adding remote bookmark head2
949 updating working directory
949 updating working directory
950 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
950 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
951
951
952 $ hg -R share-1brev log -G
952 $ hg -R share-1brev log -G
953 @ changeset: 2:99f71071f117
953 @ changeset: 2:99f71071f117
954 | bookmark: head2
954 | bookmark: head2
955 | tag: tip
955 | tag: tip
956 | parent: 0:b5f04eac9d8f
956 | parent: 0:b5f04eac9d8f
957 | user: test
957 | user: test
958 | date: Thu Jan 01 00:00:00 1970 +0000
958 | date: Thu Jan 01 00:00:00 1970 +0000
959 | summary: head2
959 | summary: head2
960 |
960 |
961 | o changeset: 1:4a8dc1ab4c13
961 | o changeset: 1:4a8dc1ab4c13
962 |/ bookmark: head1
962 |/ bookmark: head1
963 | user: test
963 | user: test
964 | date: Thu Jan 01 00:00:00 1970 +0000
964 | date: Thu Jan 01 00:00:00 1970 +0000
965 | summary: head1
965 | summary: head1
966 |
966 |
967 o changeset: 0:b5f04eac9d8f
967 o changeset: 0:b5f04eac9d8f
968 user: test
968 user: test
969 date: Thu Jan 01 00:00:00 1970 +0000
969 date: Thu Jan 01 00:00:00 1970 +0000
970 summary: initial
970 summary: initial
971
971
972
972
973 Request to clone a single branch is respected in sharing mode
973 Request to clone a single branch is respected in sharing mode
974
974
975 $ hg --config share.pool=sharebranch clone -b branch1 source1b share-1bbranch1
975 $ hg --config share.pool=sharebranch clone -b branch1 source1b share-1bbranch1
976 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
976 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
977 adding changesets
977 adding changesets
978 adding manifests
978 adding manifests
979 adding file changes
979 adding file changes
980 added 2 changesets with 2 changes to 1 files
980 added 2 changesets with 2 changes to 1 files
981 no changes found
981 no changes found
982 updating working directory
982 updating working directory
983 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
983 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
984
984
985 $ hg -R share-1bbranch1 log -G
985 $ hg -R share-1bbranch1 log -G
986 o changeset: 1:5f92a6c1a1b1
986 o changeset: 1:5f92a6c1a1b1
987 | branch: branch1
987 | branch: branch1
988 | tag: tip
988 | tag: tip
989 | user: test
989 | user: test
990 | date: Thu Jan 01 00:00:00 1970 +0000
990 | date: Thu Jan 01 00:00:00 1970 +0000
991 | summary: branch1
991 | summary: branch1
992 |
992 |
993 @ changeset: 0:b5f04eac9d8f
993 @ changeset: 0:b5f04eac9d8f
994 user: test
994 user: test
995 date: Thu Jan 01 00:00:00 1970 +0000
995 date: Thu Jan 01 00:00:00 1970 +0000
996 summary: initial
996 summary: initial
997
997
998
998
999 $ hg --config share.pool=sharebranch clone -b branch2 source1b share-1bbranch2
999 $ hg --config share.pool=sharebranch clone -b branch2 source1b share-1bbranch2
1000 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1000 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1001 searching for changes
1001 searching for changes
1002 adding changesets
1002 adding changesets
1003 adding manifests
1003 adding manifests
1004 adding file changes
1004 adding file changes
1005 added 1 changesets with 1 changes to 1 files (+1 heads)
1005 added 1 changesets with 1 changes to 1 files (+1 heads)
1006 updating working directory
1006 updating working directory
1007 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1007 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1008
1008
1009 $ hg -R share-1bbranch2 log -G
1009 $ hg -R share-1bbranch2 log -G
1010 o changeset: 2:6bacf4683960
1010 o changeset: 2:6bacf4683960
1011 | branch: branch2
1011 | branch: branch2
1012 | tag: tip
1012 | tag: tip
1013 | parent: 0:b5f04eac9d8f
1013 | parent: 0:b5f04eac9d8f
1014 | user: test
1014 | user: test
1015 | date: Thu Jan 01 00:00:00 1970 +0000
1015 | date: Thu Jan 01 00:00:00 1970 +0000
1016 | summary: branch2
1016 | summary: branch2
1017 |
1017 |
1018 | o changeset: 1:5f92a6c1a1b1
1018 | o changeset: 1:5f92a6c1a1b1
1019 |/ branch: branch1
1019 |/ branch: branch1
1020 | user: test
1020 | user: test
1021 | date: Thu Jan 01 00:00:00 1970 +0000
1021 | date: Thu Jan 01 00:00:00 1970 +0000
1022 | summary: branch1
1022 | summary: branch1
1023 |
1023 |
1024 @ changeset: 0:b5f04eac9d8f
1024 @ changeset: 0:b5f04eac9d8f
1025 user: test
1025 user: test
1026 date: Thu Jan 01 00:00:00 1970 +0000
1026 date: Thu Jan 01 00:00:00 1970 +0000
1027 summary: initial
1027 summary: initial
1028
1028
1029
1029
1030 -U is respected in share clone mode
1030 -U is respected in share clone mode
1031
1031
1032 $ hg --config share.pool=share clone -U source1a share-1anowc
1032 $ hg --config share.pool=share clone -U source1a share-1anowc
1033 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1033 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1034 searching for changes
1034 searching for changes
1035 no changes found
1035 no changes found
1036 adding remote bookmark bookA
1036 adding remote bookmark bookA
1037
1037
1038 $ ls share-1anowc
1038 $ ls share-1anowc
1039
1039
1040 Test that auto sharing doesn't cause failure of "hg clone local remote"
1040 Test that auto sharing doesn't cause failure of "hg clone local remote"
1041
1041
1042 $ cd $TESTTMP
1042 $ cd $TESTTMP
1043 $ hg -R a id -r 0
1043 $ hg -R a id -r 0
1044 acb14030fe0a
1044 acb14030fe0a
1045 $ hg id -R remote -r 0
1045 $ hg id -R remote -r 0
1046 abort: repository remote not found!
1046 abort: repository remote not found!
1047 [255]
1047 [255]
1048 $ hg --config share.pool=share -q clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" a ssh://user@dummy/remote
1048 $ hg --config share.pool=share -q clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" a ssh://user@dummy/remote
1049 $ hg -R remote id -r 0
1049 $ hg -R remote id -r 0
1050 acb14030fe0a
1050 acb14030fe0a
1051
1051
1052 Cloning into pooled storage doesn't race (issue5104)
1052 Cloning into pooled storage doesn't race (issue5104)
1053
1053
1054 $ HGPOSTLOCKDELAY=2.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace1 > race1.log 2>&1 &
1054 $ HGPOSTLOCKDELAY=2.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace1 > race1.log 2>&1 &
1055 $ HGPRELOCKDELAY=1.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace2 > race2.log 2>&1
1055 $ HGPRELOCKDELAY=1.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace2 > race2.log 2>&1
1056 $ wait
1056 $ wait
1057
1057
1058 $ hg -R share-destrace1 log -r tip
1058 $ hg -R share-destrace1 log -r tip
1059 changeset: 2:e5bfe23c0b47
1059 changeset: 2:e5bfe23c0b47
1060 bookmark: bookA
1060 bookmark: bookA
1061 tag: tip
1061 tag: tip
1062 user: test
1062 user: test
1063 date: Thu Jan 01 00:00:00 1970 +0000
1063 date: Thu Jan 01 00:00:00 1970 +0000
1064 summary: 1a
1064 summary: 1a
1065
1065
1066
1066
1067 $ hg -R share-destrace2 log -r tip
1067 $ hg -R share-destrace2 log -r tip
1068 changeset: 2:e5bfe23c0b47
1068 changeset: 2:e5bfe23c0b47
1069 bookmark: bookA
1069 bookmark: bookA
1070 tag: tip
1070 tag: tip
1071 user: test
1071 user: test
1072 date: Thu Jan 01 00:00:00 1970 +0000
1072 date: Thu Jan 01 00:00:00 1970 +0000
1073 summary: 1a
1073 summary: 1a
1074
1074
1075 One repo should be new, the other should be shared from the pool. We
1075 One repo should be new, the other should be shared from the pool. We
1076 don't care which is which, so we just make sure we always print the
1076 don't care which is which, so we just make sure we always print the
1077 one containing "new pooled" first, then one one containing "existing
1077 one containing "new pooled" first, then one one containing "existing
1078 pooled".
1078 pooled".
1079
1079
1080 $ (grep 'new pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1080 $ (grep 'new pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1081 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1081 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1082 requesting all changes
1082 requesting all changes
1083 adding changesets
1083 adding changesets
1084 adding manifests
1084 adding manifests
1085 adding file changes
1085 adding file changes
1086 added 3 changesets with 3 changes to 1 files
1086 added 3 changesets with 3 changes to 1 files
1087 searching for changes
1087 searching for changes
1088 no changes found
1088 no changes found
1089 adding remote bookmark bookA
1089 adding remote bookmark bookA
1090 updating working directory
1090 updating working directory
1091 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1091 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1092
1092
1093 $ (grep 'existing pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1093 $ (grep 'existing pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1094 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1094 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1095 searching for changes
1095 searching for changes
1096 no changes found
1096 no changes found
1097 adding remote bookmark bookA
1097 adding remote bookmark bookA
1098 updating working directory
1098 updating working directory
1099 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1099 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1100
1101 SEC: check for unsafe ssh url
1102
1103 $ hg clone 'ssh://-oProxyCommand=touch${IFS}owned/path'
1104 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1105 [255]
1106 $ hg clone 'ssh://%2DoProxyCommand=touch${IFS}owned/path'
1107 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1108 [255]
1109 $ hg clone 'ssh://fakehost|shellcommand/path'
1110 abort: potentially unsafe url: 'ssh://fakehost|shellcommand/path'
1111 [255]
1112 $ hg clone 'ssh://fakehost%7Cshellcommand/path'
1113 abort: potentially unsafe url: 'ssh://fakehost|shellcommand/path'
1114 [255]
1115
1116 $ hg clone 'ssh://-oProxyCommand=touch owned%20foo@example.com/nonexistent/path'
1117 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned foo@example.com/nonexistent/path'
1118 [255]
1119 We should not have created a file named owned - if it exists, the
1120 attack succeeded.
1121 $ if test -f owned; then echo 'you got owned'; fi
General Comments 0
You need to be logged in to leave comments. Login now