##// END OF EJS Templates
py3: replace file() with open() in test-clone.t...
Pulkit Goyal -
r36028:c02200b1 default
parent child Browse files
Show More
@@ -1,1256 +1,1256 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 'open("data1", "wb").write(b"".join(b"%d\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
141 $TESTTMP/a#0
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 new changesets acb14030fe0a:a7949464abda
151 new changesets acb14030fe0a:a7949464abda
152 updating to branch default
152 updating to branch default
153 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
153 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
154 $ hg -R g verify
154 $ hg -R g verify
155 checking changesets
155 checking changesets
156 checking manifests
156 checking manifests
157 crosschecking files in changesets and manifests
157 crosschecking files in changesets and manifests
158 checking files
158 checking files
159 2 files, 11 changesets, 11 total revisions
159 2 files, 11 changesets, 11 total revisions
160
160
161 Invalid dest '' with --pull must abort (issue2528):
161 Invalid dest '' with --pull must abort (issue2528):
162
162
163 $ hg clone --pull a ''
163 $ hg clone --pull a ''
164 abort: empty destination path is not valid
164 abort: empty destination path is not valid
165 [255]
165 [255]
166
166
167 Clone to '.':
167 Clone to '.':
168
168
169 $ mkdir h
169 $ mkdir h
170 $ cd h
170 $ cd h
171 $ hg clone ../a .
171 $ hg clone ../a .
172 updating to branch default
172 updating to branch default
173 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
173 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
174 $ cd ..
174 $ cd ..
175
175
176
176
177 *** Tests for option -u ***
177 *** Tests for option -u ***
178
178
179 Adding some more history to repo a:
179 Adding some more history to repo a:
180
180
181 $ cd a
181 $ cd a
182 $ hg tag ref1
182 $ hg tag ref1
183 $ echo the quick brown fox >a
183 $ echo the quick brown fox >a
184 $ hg ci -m "hacked default"
184 $ hg ci -m "hacked default"
185 $ hg up ref1
185 $ hg up ref1
186 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
186 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
187 $ hg branch stable
187 $ hg branch stable
188 marked working directory as branch stable
188 marked working directory as branch stable
189 (branches are permanent and global, did you want a bookmark?)
189 (branches are permanent and global, did you want a bookmark?)
190 $ echo some text >a
190 $ echo some text >a
191 $ hg ci -m "starting branch stable"
191 $ hg ci -m "starting branch stable"
192 $ hg tag ref2
192 $ hg tag ref2
193 $ echo some more text >a
193 $ echo some more text >a
194 $ hg ci -m "another change for branch stable"
194 $ hg ci -m "another change for branch stable"
195 $ hg up ref2
195 $ hg up ref2
196 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
196 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
197 $ hg parents
197 $ hg parents
198 changeset: 13:e8ece76546a6
198 changeset: 13:e8ece76546a6
199 branch: stable
199 branch: stable
200 tag: ref2
200 tag: ref2
201 parent: 10:a7949464abda
201 parent: 10:a7949464abda
202 user: test
202 user: test
203 date: Thu Jan 01 00:00:00 1970 +0000
203 date: Thu Jan 01 00:00:00 1970 +0000
204 summary: starting branch stable
204 summary: starting branch stable
205
205
206
206
207 Repo a has two heads:
207 Repo a has two heads:
208
208
209 $ hg heads
209 $ hg heads
210 changeset: 15:0aae7cf88f0d
210 changeset: 15:0aae7cf88f0d
211 branch: stable
211 branch: stable
212 tag: tip
212 tag: tip
213 user: test
213 user: test
214 date: Thu Jan 01 00:00:00 1970 +0000
214 date: Thu Jan 01 00:00:00 1970 +0000
215 summary: another change for branch stable
215 summary: another change for branch stable
216
216
217 changeset: 12:f21241060d6a
217 changeset: 12:f21241060d6a
218 user: test
218 user: test
219 date: Thu Jan 01 00:00:00 1970 +0000
219 date: Thu Jan 01 00:00:00 1970 +0000
220 summary: hacked default
220 summary: hacked default
221
221
222
222
223 $ cd ..
223 $ cd ..
224
224
225
225
226 Testing --noupdate with --updaterev (must abort):
226 Testing --noupdate with --updaterev (must abort):
227
227
228 $ hg clone --noupdate --updaterev 1 a ua
228 $ hg clone --noupdate --updaterev 1 a ua
229 abort: cannot specify both --noupdate and --updaterev
229 abort: cannot specify both --noupdate and --updaterev
230 [255]
230 [255]
231
231
232
232
233 Testing clone -u:
233 Testing clone -u:
234
234
235 $ hg clone -u . a ua
235 $ hg clone -u . a ua
236 updating to branch stable
236 updating to branch stable
237 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
237 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
238
238
239 Repo ua has both heads:
239 Repo ua has both heads:
240
240
241 $ hg -R ua heads
241 $ hg -R ua heads
242 changeset: 15:0aae7cf88f0d
242 changeset: 15:0aae7cf88f0d
243 branch: stable
243 branch: stable
244 tag: tip
244 tag: tip
245 user: test
245 user: test
246 date: Thu Jan 01 00:00:00 1970 +0000
246 date: Thu Jan 01 00:00:00 1970 +0000
247 summary: another change for branch stable
247 summary: another change for branch stable
248
248
249 changeset: 12:f21241060d6a
249 changeset: 12:f21241060d6a
250 user: test
250 user: test
251 date: Thu Jan 01 00:00:00 1970 +0000
251 date: Thu Jan 01 00:00:00 1970 +0000
252 summary: hacked default
252 summary: hacked default
253
253
254
254
255 Same revision checked out in repo a and ua:
255 Same revision checked out in repo a and ua:
256
256
257 $ hg -R a parents --template "{node|short}\n"
257 $ hg -R a parents --template "{node|short}\n"
258 e8ece76546a6
258 e8ece76546a6
259 $ hg -R ua parents --template "{node|short}\n"
259 $ hg -R ua parents --template "{node|short}\n"
260 e8ece76546a6
260 e8ece76546a6
261
261
262 $ rm -r ua
262 $ rm -r ua
263
263
264
264
265 Testing clone --pull -u:
265 Testing clone --pull -u:
266
266
267 $ hg clone --pull -u . a ua
267 $ hg clone --pull -u . a ua
268 requesting all changes
268 requesting all changes
269 adding changesets
269 adding changesets
270 adding manifests
270 adding manifests
271 adding file changes
271 adding file changes
272 added 16 changesets with 16 changes to 3 files (+1 heads)
272 added 16 changesets with 16 changes to 3 files (+1 heads)
273 new changesets acb14030fe0a:0aae7cf88f0d
273 new changesets acb14030fe0a:0aae7cf88f0d
274 updating to branch stable
274 updating to branch stable
275 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
275 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
276
276
277 Repo ua has both heads:
277 Repo ua has both heads:
278
278
279 $ hg -R ua heads
279 $ hg -R ua heads
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 changeset: 12:f21241060d6a
287 changeset: 12:f21241060d6a
288 user: test
288 user: test
289 date: Thu Jan 01 00:00:00 1970 +0000
289 date: Thu Jan 01 00:00:00 1970 +0000
290 summary: hacked default
290 summary: hacked default
291
291
292
292
293 Same revision checked out in repo a and ua:
293 Same revision checked out in repo a and ua:
294
294
295 $ hg -R a parents --template "{node|short}\n"
295 $ hg -R a parents --template "{node|short}\n"
296 e8ece76546a6
296 e8ece76546a6
297 $ hg -R ua parents --template "{node|short}\n"
297 $ hg -R ua parents --template "{node|short}\n"
298 e8ece76546a6
298 e8ece76546a6
299
299
300 $ rm -r ua
300 $ rm -r ua
301
301
302
302
303 Testing clone -u <branch>:
303 Testing clone -u <branch>:
304
304
305 $ hg clone -u stable a ua
305 $ hg clone -u stable a ua
306 updating to branch stable
306 updating to branch stable
307 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
307 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
308
308
309 Repo ua has both heads:
309 Repo ua has both heads:
310
310
311 $ hg -R ua heads
311 $ hg -R ua heads
312 changeset: 15:0aae7cf88f0d
312 changeset: 15:0aae7cf88f0d
313 branch: stable
313 branch: stable
314 tag: tip
314 tag: tip
315 user: test
315 user: test
316 date: Thu Jan 01 00:00:00 1970 +0000
316 date: Thu Jan 01 00:00:00 1970 +0000
317 summary: another change for branch stable
317 summary: another change for branch stable
318
318
319 changeset: 12:f21241060d6a
319 changeset: 12:f21241060d6a
320 user: test
320 user: test
321 date: Thu Jan 01 00:00:00 1970 +0000
321 date: Thu Jan 01 00:00:00 1970 +0000
322 summary: hacked default
322 summary: hacked default
323
323
324
324
325 Branch 'stable' is checked out:
325 Branch 'stable' is checked out:
326
326
327 $ hg -R ua parents
327 $ hg -R ua parents
328 changeset: 15:0aae7cf88f0d
328 changeset: 15:0aae7cf88f0d
329 branch: stable
329 branch: stable
330 tag: tip
330 tag: tip
331 user: test
331 user: test
332 date: Thu Jan 01 00:00:00 1970 +0000
332 date: Thu Jan 01 00:00:00 1970 +0000
333 summary: another change for branch stable
333 summary: another change for branch stable
334
334
335
335
336 $ rm -r ua
336 $ rm -r ua
337
337
338
338
339 Testing default checkout:
339 Testing default checkout:
340
340
341 $ hg clone a ua
341 $ hg clone a ua
342 updating to branch default
342 updating to branch default
343 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
343 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
344
344
345 Repo ua has both heads:
345 Repo ua has both heads:
346
346
347 $ hg -R ua heads
347 $ hg -R ua heads
348 changeset: 15:0aae7cf88f0d
348 changeset: 15:0aae7cf88f0d
349 branch: stable
349 branch: stable
350 tag: tip
350 tag: tip
351 user: test
351 user: test
352 date: Thu Jan 01 00:00:00 1970 +0000
352 date: Thu Jan 01 00:00:00 1970 +0000
353 summary: another change for branch stable
353 summary: another change for branch stable
354
354
355 changeset: 12:f21241060d6a
355 changeset: 12:f21241060d6a
356 user: test
356 user: test
357 date: Thu Jan 01 00:00:00 1970 +0000
357 date: Thu Jan 01 00:00:00 1970 +0000
358 summary: hacked default
358 summary: hacked default
359
359
360
360
361 Branch 'default' is checked out:
361 Branch 'default' is checked out:
362
362
363 $ hg -R ua parents
363 $ hg -R ua parents
364 changeset: 12:f21241060d6a
364 changeset: 12:f21241060d6a
365 user: test
365 user: test
366 date: Thu Jan 01 00:00:00 1970 +0000
366 date: Thu Jan 01 00:00:00 1970 +0000
367 summary: hacked default
367 summary: hacked default
368
368
369 Test clone with a branch named "@" (issue3677)
369 Test clone with a branch named "@" (issue3677)
370
370
371 $ hg -R ua branch @
371 $ hg -R ua branch @
372 marked working directory as branch @
372 marked working directory as branch @
373 $ hg -R ua commit -m 'created branch @'
373 $ hg -R ua commit -m 'created branch @'
374 $ hg clone ua atbranch
374 $ hg clone ua atbranch
375 updating to branch default
375 updating to branch default
376 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
376 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
377 $ hg -R atbranch heads
377 $ hg -R atbranch heads
378 changeset: 16:798b6d97153e
378 changeset: 16:798b6d97153e
379 branch: @
379 branch: @
380 tag: tip
380 tag: tip
381 parent: 12:f21241060d6a
381 parent: 12:f21241060d6a
382 user: test
382 user: test
383 date: Thu Jan 01 00:00:00 1970 +0000
383 date: Thu Jan 01 00:00:00 1970 +0000
384 summary: created branch @
384 summary: created branch @
385
385
386 changeset: 15:0aae7cf88f0d
386 changeset: 15:0aae7cf88f0d
387 branch: stable
387 branch: stable
388 user: test
388 user: test
389 date: Thu Jan 01 00:00:00 1970 +0000
389 date: Thu Jan 01 00:00:00 1970 +0000
390 summary: another change for branch stable
390 summary: another change for branch stable
391
391
392 changeset: 12:f21241060d6a
392 changeset: 12:f21241060d6a
393 user: test
393 user: test
394 date: Thu Jan 01 00:00:00 1970 +0000
394 date: Thu Jan 01 00:00:00 1970 +0000
395 summary: hacked default
395 summary: hacked default
396
396
397 $ hg -R atbranch parents
397 $ hg -R atbranch parents
398 changeset: 12:f21241060d6a
398 changeset: 12:f21241060d6a
399 user: test
399 user: test
400 date: Thu Jan 01 00:00:00 1970 +0000
400 date: Thu Jan 01 00:00:00 1970 +0000
401 summary: hacked default
401 summary: hacked default
402
402
403
403
404 $ rm -r ua atbranch
404 $ rm -r ua atbranch
405
405
406
406
407 Testing #<branch>:
407 Testing #<branch>:
408
408
409 $ hg clone -u . a#stable ua
409 $ hg clone -u . a#stable ua
410 adding changesets
410 adding changesets
411 adding manifests
411 adding manifests
412 adding file changes
412 adding file changes
413 added 14 changesets with 14 changes to 3 files
413 added 14 changesets with 14 changes to 3 files
414 new changesets acb14030fe0a:0aae7cf88f0d
414 new changesets acb14030fe0a:0aae7cf88f0d
415 updating to branch stable
415 updating to branch stable
416 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
416 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
417
417
418 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
418 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
419
419
420 $ hg -R ua heads
420 $ hg -R ua heads
421 changeset: 13:0aae7cf88f0d
421 changeset: 13:0aae7cf88f0d
422 branch: stable
422 branch: stable
423 tag: tip
423 tag: tip
424 user: test
424 user: test
425 date: Thu Jan 01 00:00:00 1970 +0000
425 date: Thu Jan 01 00:00:00 1970 +0000
426 summary: another change for branch stable
426 summary: another change for branch stable
427
427
428 changeset: 10:a7949464abda
428 changeset: 10:a7949464abda
429 user: test
429 user: test
430 date: Thu Jan 01 00:00:00 1970 +0000
430 date: Thu Jan 01 00:00:00 1970 +0000
431 summary: test
431 summary: test
432
432
433
433
434 Same revision checked out in repo a and ua:
434 Same revision checked out in repo a and ua:
435
435
436 $ hg -R a parents --template "{node|short}\n"
436 $ hg -R a parents --template "{node|short}\n"
437 e8ece76546a6
437 e8ece76546a6
438 $ hg -R ua parents --template "{node|short}\n"
438 $ hg -R ua parents --template "{node|short}\n"
439 e8ece76546a6
439 e8ece76546a6
440
440
441 $ rm -r ua
441 $ rm -r ua
442
442
443
443
444 Testing -u -r <branch>:
444 Testing -u -r <branch>:
445
445
446 $ hg clone -u . -r stable a ua
446 $ hg clone -u . -r stable a ua
447 adding changesets
447 adding changesets
448 adding manifests
448 adding manifests
449 adding file changes
449 adding file changes
450 added 14 changesets with 14 changes to 3 files
450 added 14 changesets with 14 changes to 3 files
451 new changesets acb14030fe0a:0aae7cf88f0d
451 new changesets acb14030fe0a:0aae7cf88f0d
452 updating to branch stable
452 updating to branch stable
453 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
453 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
454
454
455 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
455 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
456
456
457 $ hg -R ua heads
457 $ hg -R ua heads
458 changeset: 13:0aae7cf88f0d
458 changeset: 13:0aae7cf88f0d
459 branch: stable
459 branch: stable
460 tag: tip
460 tag: tip
461 user: test
461 user: test
462 date: Thu Jan 01 00:00:00 1970 +0000
462 date: Thu Jan 01 00:00:00 1970 +0000
463 summary: another change for branch stable
463 summary: another change for branch stable
464
464
465 changeset: 10:a7949464abda
465 changeset: 10:a7949464abda
466 user: test
466 user: test
467 date: Thu Jan 01 00:00:00 1970 +0000
467 date: Thu Jan 01 00:00:00 1970 +0000
468 summary: test
468 summary: test
469
469
470
470
471 Same revision checked out in repo a and ua:
471 Same revision checked out in repo a and ua:
472
472
473 $ hg -R a parents --template "{node|short}\n"
473 $ hg -R a parents --template "{node|short}\n"
474 e8ece76546a6
474 e8ece76546a6
475 $ hg -R ua parents --template "{node|short}\n"
475 $ hg -R ua parents --template "{node|short}\n"
476 e8ece76546a6
476 e8ece76546a6
477
477
478 $ rm -r ua
478 $ rm -r ua
479
479
480
480
481 Testing -r <branch>:
481 Testing -r <branch>:
482
482
483 $ hg clone -r stable a ua
483 $ hg clone -r stable a ua
484 adding changesets
484 adding changesets
485 adding manifests
485 adding manifests
486 adding file changes
486 adding file changes
487 added 14 changesets with 14 changes to 3 files
487 added 14 changesets with 14 changes to 3 files
488 new changesets acb14030fe0a:0aae7cf88f0d
488 new changesets acb14030fe0a:0aae7cf88f0d
489 updating to branch stable
489 updating to branch stable
490 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
490 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
491
491
492 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
492 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
493
493
494 $ hg -R ua heads
494 $ hg -R ua heads
495 changeset: 13:0aae7cf88f0d
495 changeset: 13:0aae7cf88f0d
496 branch: stable
496 branch: stable
497 tag: tip
497 tag: tip
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: another change for branch stable
500 summary: another change for branch stable
501
501
502 changeset: 10:a7949464abda
502 changeset: 10:a7949464abda
503 user: test
503 user: test
504 date: Thu Jan 01 00:00:00 1970 +0000
504 date: Thu Jan 01 00:00:00 1970 +0000
505 summary: test
505 summary: test
506
506
507
507
508 Branch 'stable' is checked out:
508 Branch 'stable' is checked out:
509
509
510 $ hg -R ua parents
510 $ hg -R ua parents
511 changeset: 13:0aae7cf88f0d
511 changeset: 13:0aae7cf88f0d
512 branch: stable
512 branch: stable
513 tag: tip
513 tag: tip
514 user: test
514 user: test
515 date: Thu Jan 01 00:00:00 1970 +0000
515 date: Thu Jan 01 00:00:00 1970 +0000
516 summary: another change for branch stable
516 summary: another change for branch stable
517
517
518
518
519 $ rm -r ua
519 $ rm -r ua
520
520
521
521
522 Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not
522 Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not
523 iterable in addbranchrevs()
523 iterable in addbranchrevs()
524
524
525 $ cat <<EOF > simpleclone.py
525 $ cat <<EOF > simpleclone.py
526 > from mercurial import ui, hg
526 > from mercurial import ui, hg
527 > myui = ui.ui.load()
527 > myui = ui.ui.load()
528 > repo = hg.repository(myui, 'a')
528 > repo = hg.repository(myui, 'a')
529 > hg.clone(myui, {}, repo, dest="ua")
529 > hg.clone(myui, {}, repo, dest="ua")
530 > EOF
530 > EOF
531
531
532 $ $PYTHON simpleclone.py
532 $ $PYTHON simpleclone.py
533 updating to branch default
533 updating to branch default
534 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
534 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
535
535
536 $ rm -r ua
536 $ rm -r ua
537
537
538 $ cat <<EOF > branchclone.py
538 $ cat <<EOF > branchclone.py
539 > from mercurial import ui, hg, extensions
539 > from mercurial import ui, hg, extensions
540 > myui = ui.ui.load()
540 > myui = ui.ui.load()
541 > extensions.loadall(myui)
541 > extensions.loadall(myui)
542 > repo = hg.repository(myui, 'a')
542 > repo = hg.repository(myui, 'a')
543 > hg.clone(myui, {}, repo, dest="ua", branch=["stable",])
543 > hg.clone(myui, {}, repo, dest="ua", branch=["stable",])
544 > EOF
544 > EOF
545
545
546 $ $PYTHON branchclone.py
546 $ $PYTHON branchclone.py
547 adding changesets
547 adding changesets
548 adding manifests
548 adding manifests
549 adding file changes
549 adding file changes
550 added 14 changesets with 14 changes to 3 files
550 added 14 changesets with 14 changes to 3 files
551 new changesets acb14030fe0a:0aae7cf88f0d
551 new changesets acb14030fe0a:0aae7cf88f0d
552 updating to branch stable
552 updating to branch stable
553 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
553 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
554 $ rm -r ua
554 $ rm -r ua
555
555
556
556
557 Test clone with special '@' bookmark:
557 Test clone with special '@' bookmark:
558 $ cd a
558 $ cd a
559 $ hg bookmark -r a7949464abda @ # branch point of stable from default
559 $ hg bookmark -r a7949464abda @ # branch point of stable from default
560 $ hg clone . ../i
560 $ hg clone . ../i
561 updating to bookmark @
561 updating to bookmark @
562 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
562 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
563 $ hg id -i ../i
563 $ hg id -i ../i
564 a7949464abda
564 a7949464abda
565 $ rm -r ../i
565 $ rm -r ../i
566
566
567 $ hg bookmark -f -r stable @
567 $ hg bookmark -f -r stable @
568 $ hg bookmarks
568 $ hg bookmarks
569 @ 15:0aae7cf88f0d
569 @ 15:0aae7cf88f0d
570 $ hg clone . ../i
570 $ hg clone . ../i
571 updating to bookmark @ on branch stable
571 updating to bookmark @ on branch stable
572 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
572 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
573 $ hg id -i ../i
573 $ hg id -i ../i
574 0aae7cf88f0d
574 0aae7cf88f0d
575 $ cd "$TESTTMP"
575 $ cd "$TESTTMP"
576
576
577
577
578 Testing failures:
578 Testing failures:
579
579
580 $ mkdir fail
580 $ mkdir fail
581 $ cd fail
581 $ cd fail
582
582
583 No local source
583 No local source
584
584
585 $ hg clone a b
585 $ hg clone a b
586 abort: repository a not found!
586 abort: repository a not found!
587 [255]
587 [255]
588
588
589 No remote source
589 No remote source
590
590
591 #if windows
591 #if windows
592 $ hg clone http://$LOCALIP:3121/a b
592 $ hg clone http://$LOCALIP:3121/a b
593 abort: error: * (glob)
593 abort: error: * (glob)
594 [255]
594 [255]
595 #else
595 #else
596 $ hg clone http://$LOCALIP:3121/a b
596 $ hg clone http://$LOCALIP:3121/a b
597 abort: error: *refused* (glob)
597 abort: error: *refused* (glob)
598 [255]
598 [255]
599 #endif
599 #endif
600 $ rm -rf b # work around bug with http clone
600 $ rm -rf b # work around bug with http clone
601
601
602
602
603 #if unix-permissions no-root
603 #if unix-permissions no-root
604
604
605 Inaccessible source
605 Inaccessible source
606
606
607 $ mkdir a
607 $ mkdir a
608 $ chmod 000 a
608 $ chmod 000 a
609 $ hg clone a b
609 $ hg clone a b
610 abort: repository a not found!
610 abort: repository a not found!
611 [255]
611 [255]
612
612
613 Inaccessible destination
613 Inaccessible destination
614
614
615 $ hg init b
615 $ hg init b
616 $ cd b
616 $ cd b
617 $ hg clone . ../a
617 $ hg clone . ../a
618 abort: Permission denied: '../a'
618 abort: Permission denied: '../a'
619 [255]
619 [255]
620 $ cd ..
620 $ cd ..
621 $ chmod 700 a
621 $ chmod 700 a
622 $ rm -r a b
622 $ rm -r a b
623
623
624 #endif
624 #endif
625
625
626
626
627 #if fifo
627 #if fifo
628
628
629 Source of wrong type
629 Source of wrong type
630
630
631 $ mkfifo a
631 $ mkfifo a
632 $ hg clone a b
632 $ hg clone a b
633 abort: repository a not found!
633 abort: repository a not found!
634 [255]
634 [255]
635 $ rm a
635 $ rm a
636
636
637 #endif
637 #endif
638
638
639 Default destination, same directory
639 Default destination, same directory
640
640
641 $ hg init q
641 $ hg init q
642 $ hg clone q
642 $ hg clone q
643 destination directory: q
643 destination directory: q
644 abort: destination 'q' is not empty
644 abort: destination 'q' is not empty
645 [255]
645 [255]
646
646
647 destination directory not empty
647 destination directory not empty
648
648
649 $ mkdir a
649 $ mkdir a
650 $ echo stuff > a/a
650 $ echo stuff > a/a
651 $ hg clone q a
651 $ hg clone q a
652 abort: destination 'a' is not empty
652 abort: destination 'a' is not empty
653 [255]
653 [255]
654
654
655
655
656 #if unix-permissions no-root
656 #if unix-permissions no-root
657
657
658 leave existing directory in place after clone failure
658 leave existing directory in place after clone failure
659
659
660 $ hg init c
660 $ hg init c
661 $ cd c
661 $ cd c
662 $ echo c > c
662 $ echo c > c
663 $ hg commit -A -m test
663 $ hg commit -A -m test
664 adding c
664 adding c
665 $ chmod -rx .hg/store/data
665 $ chmod -rx .hg/store/data
666 $ cd ..
666 $ cd ..
667 $ mkdir d
667 $ mkdir d
668 $ hg clone c d 2> err
668 $ hg clone c d 2> err
669 [255]
669 [255]
670 $ test -d d
670 $ test -d d
671 $ test -d d/.hg
671 $ test -d d/.hg
672 [1]
672 [1]
673
673
674 re-enable perm to allow deletion
674 re-enable perm to allow deletion
675
675
676 $ chmod +rx c/.hg/store/data
676 $ chmod +rx c/.hg/store/data
677
677
678 #endif
678 #endif
679
679
680 $ cd ..
680 $ cd ..
681
681
682 Test clone from the repository in (emulated) revlog format 0 (issue4203):
682 Test clone from the repository in (emulated) revlog format 0 (issue4203):
683
683
684 $ mkdir issue4203
684 $ mkdir issue4203
685 $ mkdir -p src/.hg
685 $ mkdir -p src/.hg
686 $ echo foo > src/foo
686 $ echo foo > src/foo
687 $ hg -R src add src/foo
687 $ hg -R src add src/foo
688 $ hg -R src commit -m '#0'
688 $ hg -R src commit -m '#0'
689 $ hg -R src log -q
689 $ hg -R src log -q
690 0:e1bab28bca43
690 0:e1bab28bca43
691 $ hg clone -U -q src dst
691 $ hg clone -U -q src dst
692 $ hg -R dst log -q
692 $ hg -R dst log -q
693 0:e1bab28bca43
693 0:e1bab28bca43
694
694
695 Create repositories to test auto sharing functionality
695 Create repositories to test auto sharing functionality
696
696
697 $ cat >> $HGRCPATH << EOF
697 $ cat >> $HGRCPATH << EOF
698 > [extensions]
698 > [extensions]
699 > share=
699 > share=
700 > EOF
700 > EOF
701
701
702 $ hg init empty
702 $ hg init empty
703 $ hg init source1a
703 $ hg init source1a
704 $ cd source1a
704 $ cd source1a
705 $ echo initial1 > foo
705 $ echo initial1 > foo
706 $ hg -q commit -A -m initial
706 $ hg -q commit -A -m initial
707 $ echo second > foo
707 $ echo second > foo
708 $ hg commit -m second
708 $ hg commit -m second
709 $ cd ..
709 $ cd ..
710
710
711 $ hg init filteredrev0
711 $ hg init filteredrev0
712 $ cd filteredrev0
712 $ cd filteredrev0
713 $ cat >> .hg/hgrc << EOF
713 $ cat >> .hg/hgrc << EOF
714 > [experimental]
714 > [experimental]
715 > evolution.createmarkers=True
715 > evolution.createmarkers=True
716 > EOF
716 > EOF
717 $ echo initial1 > foo
717 $ echo initial1 > foo
718 $ hg -q commit -A -m initial0
718 $ hg -q commit -A -m initial0
719 $ hg -q up -r null
719 $ hg -q up -r null
720 $ echo initial2 > foo
720 $ echo initial2 > foo
721 $ hg -q commit -A -m initial1
721 $ hg -q commit -A -m initial1
722 $ hg debugobsolete c05d5c47a5cf81401869999f3d05f7d699d2b29a e082c1832e09a7d1e78b7fd49a592d372de854c8
722 $ hg debugobsolete c05d5c47a5cf81401869999f3d05f7d699d2b29a e082c1832e09a7d1e78b7fd49a592d372de854c8
723 obsoleted 1 changesets
723 obsoleted 1 changesets
724 $ cd ..
724 $ cd ..
725
725
726 $ hg -q clone --pull source1a source1b
726 $ hg -q clone --pull source1a source1b
727 $ cd source1a
727 $ cd source1a
728 $ hg bookmark bookA
728 $ hg bookmark bookA
729 $ echo 1a > foo
729 $ echo 1a > foo
730 $ hg commit -m 1a
730 $ hg commit -m 1a
731 $ cd ../source1b
731 $ cd ../source1b
732 $ hg -q up -r 0
732 $ hg -q up -r 0
733 $ echo head1 > foo
733 $ echo head1 > foo
734 $ hg commit -m head1
734 $ hg commit -m head1
735 created new head
735 created new head
736 $ hg bookmark head1
736 $ hg bookmark head1
737 $ hg -q up -r 0
737 $ hg -q up -r 0
738 $ echo head2 > foo
738 $ echo head2 > foo
739 $ hg commit -m head2
739 $ hg commit -m head2
740 created new head
740 created new head
741 $ hg bookmark head2
741 $ hg bookmark head2
742 $ hg -q up -r 0
742 $ hg -q up -r 0
743 $ hg branch branch1
743 $ hg branch branch1
744 marked working directory as branch branch1
744 marked working directory as branch branch1
745 (branches are permanent and global, did you want a bookmark?)
745 (branches are permanent and global, did you want a bookmark?)
746 $ echo branch1 > foo
746 $ echo branch1 > foo
747 $ hg commit -m branch1
747 $ hg commit -m branch1
748 $ hg -q up -r 0
748 $ hg -q up -r 0
749 $ hg branch branch2
749 $ hg branch branch2
750 marked working directory as branch branch2
750 marked working directory as branch branch2
751 $ echo branch2 > foo
751 $ echo branch2 > foo
752 $ hg commit -m branch2
752 $ hg commit -m branch2
753 $ cd ..
753 $ cd ..
754 $ hg init source2
754 $ hg init source2
755 $ cd source2
755 $ cd source2
756 $ echo initial2 > foo
756 $ echo initial2 > foo
757 $ hg -q commit -A -m initial2
757 $ hg -q commit -A -m initial2
758 $ echo second > foo
758 $ echo second > foo
759 $ hg commit -m second
759 $ hg commit -m second
760 $ cd ..
760 $ cd ..
761
761
762 Clone with auto share from an empty repo should not result in share
762 Clone with auto share from an empty repo should not result in share
763
763
764 $ mkdir share
764 $ mkdir share
765 $ hg --config share.pool=share clone empty share-empty
765 $ hg --config share.pool=share clone empty share-empty
766 (not using pooled storage: remote appears to be empty)
766 (not using pooled storage: remote appears to be empty)
767 updating to branch default
767 updating to branch default
768 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
768 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
769 $ ls share
769 $ ls share
770 $ test -d share-empty/.hg/store
770 $ test -d share-empty/.hg/store
771 $ test -f share-empty/.hg/sharedpath
771 $ test -f share-empty/.hg/sharedpath
772 [1]
772 [1]
773
773
774 Clone with auto share from a repo with filtered revision 0 should not result in share
774 Clone with auto share from a repo with filtered revision 0 should not result in share
775
775
776 $ hg --config share.pool=share clone filteredrev0 share-filtered
776 $ hg --config share.pool=share clone filteredrev0 share-filtered
777 (not using pooled storage: unable to resolve identity of remote)
777 (not using pooled storage: unable to resolve identity of remote)
778 requesting all changes
778 requesting all changes
779 adding changesets
779 adding changesets
780 adding manifests
780 adding manifests
781 adding file changes
781 adding file changes
782 added 1 changesets with 1 changes to 1 files
782 added 1 changesets with 1 changes to 1 files
783 new changesets e082c1832e09
783 new changesets e082c1832e09
784 updating to branch default
784 updating to branch default
785 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
785 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
786
786
787 Clone from repo with content should result in shared store being created
787 Clone from repo with content should result in shared store being created
788
788
789 $ hg --config share.pool=share clone source1a share-dest1a
789 $ hg --config share.pool=share clone source1a share-dest1a
790 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
790 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
791 requesting all changes
791 requesting all changes
792 adding changesets
792 adding changesets
793 adding manifests
793 adding manifests
794 adding file changes
794 adding file changes
795 added 3 changesets with 3 changes to 1 files
795 added 3 changesets with 3 changes to 1 files
796 new changesets b5f04eac9d8f:e5bfe23c0b47
796 new changesets b5f04eac9d8f:e5bfe23c0b47
797 searching for changes
797 searching for changes
798 no changes found
798 no changes found
799 adding remote bookmark bookA
799 adding remote bookmark bookA
800 updating working directory
800 updating working directory
801 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
801 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
802
802
803 The shared repo should have been created
803 The shared repo should have been created
804
804
805 $ ls share
805 $ ls share
806 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
806 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
807
807
808 The destination should point to it
808 The destination should point to it
809
809
810 $ cat share-dest1a/.hg/sharedpath; echo
810 $ cat share-dest1a/.hg/sharedpath; echo
811 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg
811 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg
812
812
813 The destination should have bookmarks
813 The destination should have bookmarks
814
814
815 $ hg -R share-dest1a bookmarks
815 $ hg -R share-dest1a bookmarks
816 bookA 2:e5bfe23c0b47
816 bookA 2:e5bfe23c0b47
817
817
818 The default path should be the remote, not the share
818 The default path should be the remote, not the share
819
819
820 $ hg -R share-dest1a config paths.default
820 $ hg -R share-dest1a config paths.default
821 $TESTTMP/source1a
821 $TESTTMP/source1a
822
822
823 Clone with existing share dir should result in pull + share
823 Clone with existing share dir should result in pull + share
824
824
825 $ hg --config share.pool=share clone source1b share-dest1b
825 $ hg --config share.pool=share clone source1b share-dest1b
826 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
826 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
827 searching for changes
827 searching for changes
828 adding changesets
828 adding changesets
829 adding manifests
829 adding manifests
830 adding file changes
830 adding file changes
831 added 4 changesets with 4 changes to 1 files (+4 heads)
831 added 4 changesets with 4 changes to 1 files (+4 heads)
832 adding remote bookmark head1
832 adding remote bookmark head1
833 adding remote bookmark head2
833 adding remote bookmark head2
834 new changesets 4a8dc1ab4c13:6bacf4683960
834 new changesets 4a8dc1ab4c13:6bacf4683960
835 updating working directory
835 updating working directory
836 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
836 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
837
837
838 $ ls share
838 $ ls share
839 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
839 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
840
840
841 $ cat share-dest1b/.hg/sharedpath; echo
841 $ cat share-dest1b/.hg/sharedpath; echo
842 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg
842 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg
843
843
844 We only get bookmarks from the remote, not everything in the share
844 We only get bookmarks from the remote, not everything in the share
845
845
846 $ hg -R share-dest1b bookmarks
846 $ hg -R share-dest1b bookmarks
847 head1 3:4a8dc1ab4c13
847 head1 3:4a8dc1ab4c13
848 head2 4:99f71071f117
848 head2 4:99f71071f117
849
849
850 Default path should be source, not share.
850 Default path should be source, not share.
851
851
852 $ hg -R share-dest1b config paths.default
852 $ hg -R share-dest1b config paths.default
853 $TESTTMP/source1b
853 $TESTTMP/source1b
854
854
855 Checked out revision should be head of default branch
855 Checked out revision should be head of default branch
856
856
857 $ hg -R share-dest1b log -r .
857 $ hg -R share-dest1b log -r .
858 changeset: 4:99f71071f117
858 changeset: 4:99f71071f117
859 bookmark: head2
859 bookmark: head2
860 parent: 0:b5f04eac9d8f
860 parent: 0:b5f04eac9d8f
861 user: test
861 user: test
862 date: Thu Jan 01 00:00:00 1970 +0000
862 date: Thu Jan 01 00:00:00 1970 +0000
863 summary: head2
863 summary: head2
864
864
865
865
866 Clone from unrelated repo should result in new share
866 Clone from unrelated repo should result in new share
867
867
868 $ hg --config share.pool=share clone source2 share-dest2
868 $ hg --config share.pool=share clone source2 share-dest2
869 (sharing from new pooled repository 22aeff664783fd44c6d9b435618173c118c3448e)
869 (sharing from new pooled repository 22aeff664783fd44c6d9b435618173c118c3448e)
870 requesting all changes
870 requesting all changes
871 adding changesets
871 adding changesets
872 adding manifests
872 adding manifests
873 adding file changes
873 adding file changes
874 added 2 changesets with 2 changes to 1 files
874 added 2 changesets with 2 changes to 1 files
875 new changesets 22aeff664783:63cf6c3dba4a
875 new changesets 22aeff664783:63cf6c3dba4a
876 searching for changes
876 searching for changes
877 no changes found
877 no changes found
878 updating working directory
878 updating working directory
879 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
879 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
880
880
881 $ ls share
881 $ ls share
882 22aeff664783fd44c6d9b435618173c118c3448e
882 22aeff664783fd44c6d9b435618173c118c3448e
883 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
883 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
884
884
885 remote naming mode works as advertised
885 remote naming mode works as advertised
886
886
887 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1a share-remote1a
887 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1a share-remote1a
888 (sharing from new pooled repository 195bb1fcdb595c14a6c13e0269129ed78f6debde)
888 (sharing from new pooled repository 195bb1fcdb595c14a6c13e0269129ed78f6debde)
889 requesting all changes
889 requesting all changes
890 adding changesets
890 adding changesets
891 adding manifests
891 adding manifests
892 adding file changes
892 adding file changes
893 added 3 changesets with 3 changes to 1 files
893 added 3 changesets with 3 changes to 1 files
894 new changesets b5f04eac9d8f:e5bfe23c0b47
894 new changesets b5f04eac9d8f:e5bfe23c0b47
895 searching for changes
895 searching for changes
896 no changes found
896 no changes found
897 adding remote bookmark bookA
897 adding remote bookmark bookA
898 updating working directory
898 updating working directory
899 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
899 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
900
900
901 $ ls shareremote
901 $ ls shareremote
902 195bb1fcdb595c14a6c13e0269129ed78f6debde
902 195bb1fcdb595c14a6c13e0269129ed78f6debde
903
903
904 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1b share-remote1b
904 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1b share-remote1b
905 (sharing from new pooled repository c0d4f83847ca2a873741feb7048a45085fd47c46)
905 (sharing from new pooled repository c0d4f83847ca2a873741feb7048a45085fd47c46)
906 requesting all changes
906 requesting all changes
907 adding changesets
907 adding changesets
908 adding manifests
908 adding manifests
909 adding file changes
909 adding file changes
910 added 6 changesets with 6 changes to 1 files (+4 heads)
910 added 6 changesets with 6 changes to 1 files (+4 heads)
911 new changesets b5f04eac9d8f:6bacf4683960
911 new changesets b5f04eac9d8f:6bacf4683960
912 searching for changes
912 searching for changes
913 no changes found
913 no changes found
914 adding remote bookmark head1
914 adding remote bookmark head1
915 adding remote bookmark head2
915 adding remote bookmark head2
916 updating working directory
916 updating working directory
917 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
917 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
918
918
919 $ ls shareremote
919 $ ls shareremote
920 195bb1fcdb595c14a6c13e0269129ed78f6debde
920 195bb1fcdb595c14a6c13e0269129ed78f6debde
921 c0d4f83847ca2a873741feb7048a45085fd47c46
921 c0d4f83847ca2a873741feb7048a45085fd47c46
922
922
923 request to clone a single revision is respected in sharing mode
923 request to clone a single revision is respected in sharing mode
924
924
925 $ hg --config share.pool=sharerevs clone -r 4a8dc1ab4c13 source1b share-1arev
925 $ hg --config share.pool=sharerevs clone -r 4a8dc1ab4c13 source1b share-1arev
926 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
926 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
927 adding changesets
927 adding changesets
928 adding manifests
928 adding manifests
929 adding file changes
929 adding file changes
930 added 2 changesets with 2 changes to 1 files
930 added 2 changesets with 2 changes to 1 files
931 new changesets b5f04eac9d8f:4a8dc1ab4c13
931 new changesets b5f04eac9d8f:4a8dc1ab4c13
932 no changes found
932 no changes found
933 adding remote bookmark head1
933 adding remote bookmark head1
934 updating working directory
934 updating working directory
935 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
935 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
936
936
937 $ hg -R share-1arev log -G
937 $ hg -R share-1arev log -G
938 @ changeset: 1:4a8dc1ab4c13
938 @ changeset: 1:4a8dc1ab4c13
939 | bookmark: head1
939 | bookmark: head1
940 | tag: tip
940 | tag: tip
941 | user: test
941 | user: test
942 | date: Thu Jan 01 00:00:00 1970 +0000
942 | date: Thu Jan 01 00:00:00 1970 +0000
943 | summary: head1
943 | summary: head1
944 |
944 |
945 o changeset: 0:b5f04eac9d8f
945 o changeset: 0:b5f04eac9d8f
946 user: test
946 user: test
947 date: Thu Jan 01 00:00:00 1970 +0000
947 date: Thu Jan 01 00:00:00 1970 +0000
948 summary: initial
948 summary: initial
949
949
950
950
951 making another clone should only pull down requested rev
951 making another clone should only pull down requested rev
952
952
953 $ hg --config share.pool=sharerevs clone -r 99f71071f117 source1b share-1brev
953 $ hg --config share.pool=sharerevs clone -r 99f71071f117 source1b share-1brev
954 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
954 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
955 searching for changes
955 searching for changes
956 adding changesets
956 adding changesets
957 adding manifests
957 adding manifests
958 adding file changes
958 adding file changes
959 added 1 changesets with 1 changes to 1 files (+1 heads)
959 added 1 changesets with 1 changes to 1 files (+1 heads)
960 adding remote bookmark head1
960 adding remote bookmark head1
961 adding remote bookmark head2
961 adding remote bookmark head2
962 new changesets 99f71071f117
962 new changesets 99f71071f117
963 updating working directory
963 updating working directory
964 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
964 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
965
965
966 $ hg -R share-1brev log -G
966 $ hg -R share-1brev log -G
967 @ changeset: 2:99f71071f117
967 @ changeset: 2:99f71071f117
968 | bookmark: head2
968 | bookmark: head2
969 | tag: tip
969 | tag: tip
970 | parent: 0:b5f04eac9d8f
970 | parent: 0:b5f04eac9d8f
971 | user: test
971 | user: test
972 | date: Thu Jan 01 00:00:00 1970 +0000
972 | date: Thu Jan 01 00:00:00 1970 +0000
973 | summary: head2
973 | summary: head2
974 |
974 |
975 | o changeset: 1:4a8dc1ab4c13
975 | o changeset: 1:4a8dc1ab4c13
976 |/ bookmark: head1
976 |/ bookmark: head1
977 | user: test
977 | user: test
978 | date: Thu Jan 01 00:00:00 1970 +0000
978 | date: Thu Jan 01 00:00:00 1970 +0000
979 | summary: head1
979 | summary: head1
980 |
980 |
981 o changeset: 0:b5f04eac9d8f
981 o changeset: 0:b5f04eac9d8f
982 user: test
982 user: test
983 date: Thu Jan 01 00:00:00 1970 +0000
983 date: Thu Jan 01 00:00:00 1970 +0000
984 summary: initial
984 summary: initial
985
985
986
986
987 Request to clone a single branch is respected in sharing mode
987 Request to clone a single branch is respected in sharing mode
988
988
989 $ hg --config share.pool=sharebranch clone -b branch1 source1b share-1bbranch1
989 $ hg --config share.pool=sharebranch clone -b branch1 source1b share-1bbranch1
990 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
990 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
991 adding changesets
991 adding changesets
992 adding manifests
992 adding manifests
993 adding file changes
993 adding file changes
994 added 2 changesets with 2 changes to 1 files
994 added 2 changesets with 2 changes to 1 files
995 new changesets b5f04eac9d8f:5f92a6c1a1b1
995 new changesets b5f04eac9d8f:5f92a6c1a1b1
996 no changes found
996 no changes found
997 updating working directory
997 updating working directory
998 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
998 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
999
999
1000 $ hg -R share-1bbranch1 log -G
1000 $ hg -R share-1bbranch1 log -G
1001 o changeset: 1:5f92a6c1a1b1
1001 o changeset: 1:5f92a6c1a1b1
1002 | branch: branch1
1002 | branch: branch1
1003 | tag: tip
1003 | tag: tip
1004 | user: test
1004 | user: test
1005 | date: Thu Jan 01 00:00:00 1970 +0000
1005 | date: Thu Jan 01 00:00:00 1970 +0000
1006 | summary: branch1
1006 | summary: branch1
1007 |
1007 |
1008 @ changeset: 0:b5f04eac9d8f
1008 @ changeset: 0:b5f04eac9d8f
1009 user: test
1009 user: test
1010 date: Thu Jan 01 00:00:00 1970 +0000
1010 date: Thu Jan 01 00:00:00 1970 +0000
1011 summary: initial
1011 summary: initial
1012
1012
1013
1013
1014 $ hg --config share.pool=sharebranch clone -b branch2 source1b share-1bbranch2
1014 $ hg --config share.pool=sharebranch clone -b branch2 source1b share-1bbranch2
1015 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1015 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1016 searching for changes
1016 searching for changes
1017 adding changesets
1017 adding changesets
1018 adding manifests
1018 adding manifests
1019 adding file changes
1019 adding file changes
1020 added 1 changesets with 1 changes to 1 files (+1 heads)
1020 added 1 changesets with 1 changes to 1 files (+1 heads)
1021 new changesets 6bacf4683960
1021 new changesets 6bacf4683960
1022 updating working directory
1022 updating working directory
1023 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1023 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1024
1024
1025 $ hg -R share-1bbranch2 log -G
1025 $ hg -R share-1bbranch2 log -G
1026 o changeset: 2:6bacf4683960
1026 o changeset: 2:6bacf4683960
1027 | branch: branch2
1027 | branch: branch2
1028 | tag: tip
1028 | tag: tip
1029 | parent: 0:b5f04eac9d8f
1029 | parent: 0:b5f04eac9d8f
1030 | user: test
1030 | user: test
1031 | date: Thu Jan 01 00:00:00 1970 +0000
1031 | date: Thu Jan 01 00:00:00 1970 +0000
1032 | summary: branch2
1032 | summary: branch2
1033 |
1033 |
1034 | o changeset: 1:5f92a6c1a1b1
1034 | o changeset: 1:5f92a6c1a1b1
1035 |/ branch: branch1
1035 |/ branch: branch1
1036 | user: test
1036 | user: test
1037 | date: Thu Jan 01 00:00:00 1970 +0000
1037 | date: Thu Jan 01 00:00:00 1970 +0000
1038 | summary: branch1
1038 | summary: branch1
1039 |
1039 |
1040 @ changeset: 0:b5f04eac9d8f
1040 @ changeset: 0:b5f04eac9d8f
1041 user: test
1041 user: test
1042 date: Thu Jan 01 00:00:00 1970 +0000
1042 date: Thu Jan 01 00:00:00 1970 +0000
1043 summary: initial
1043 summary: initial
1044
1044
1045
1045
1046 -U is respected in share clone mode
1046 -U is respected in share clone mode
1047
1047
1048 $ hg --config share.pool=share clone -U source1a share-1anowc
1048 $ hg --config share.pool=share clone -U source1a share-1anowc
1049 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1049 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1050 searching for changes
1050 searching for changes
1051 no changes found
1051 no changes found
1052 adding remote bookmark bookA
1052 adding remote bookmark bookA
1053
1053
1054 $ ls share-1anowc
1054 $ ls share-1anowc
1055
1055
1056 Test that auto sharing doesn't cause failure of "hg clone local remote"
1056 Test that auto sharing doesn't cause failure of "hg clone local remote"
1057
1057
1058 $ cd $TESTTMP
1058 $ cd $TESTTMP
1059 $ hg -R a id -r 0
1059 $ hg -R a id -r 0
1060 acb14030fe0a
1060 acb14030fe0a
1061 $ hg id -R remote -r 0
1061 $ hg id -R remote -r 0
1062 abort: repository remote not found!
1062 abort: repository remote not found!
1063 [255]
1063 [255]
1064 $ hg --config share.pool=share -q clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" a ssh://user@dummy/remote
1064 $ hg --config share.pool=share -q clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" a ssh://user@dummy/remote
1065 $ hg -R remote id -r 0
1065 $ hg -R remote id -r 0
1066 acb14030fe0a
1066 acb14030fe0a
1067
1067
1068 Cloning into pooled storage doesn't race (issue5104)
1068 Cloning into pooled storage doesn't race (issue5104)
1069
1069
1070 $ HGPOSTLOCKDELAY=2.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace1 > race1.log 2>&1 &
1070 $ HGPOSTLOCKDELAY=2.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace1 > race1.log 2>&1 &
1071 $ HGPRELOCKDELAY=1.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace2 > race2.log 2>&1
1071 $ HGPRELOCKDELAY=1.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace2 > race2.log 2>&1
1072 $ wait
1072 $ wait
1073
1073
1074 $ hg -R share-destrace1 log -r tip
1074 $ hg -R share-destrace1 log -r tip
1075 changeset: 2:e5bfe23c0b47
1075 changeset: 2:e5bfe23c0b47
1076 bookmark: bookA
1076 bookmark: bookA
1077 tag: tip
1077 tag: tip
1078 user: test
1078 user: test
1079 date: Thu Jan 01 00:00:00 1970 +0000
1079 date: Thu Jan 01 00:00:00 1970 +0000
1080 summary: 1a
1080 summary: 1a
1081
1081
1082
1082
1083 $ hg -R share-destrace2 log -r tip
1083 $ hg -R share-destrace2 log -r tip
1084 changeset: 2:e5bfe23c0b47
1084 changeset: 2:e5bfe23c0b47
1085 bookmark: bookA
1085 bookmark: bookA
1086 tag: tip
1086 tag: tip
1087 user: test
1087 user: test
1088 date: Thu Jan 01 00:00:00 1970 +0000
1088 date: Thu Jan 01 00:00:00 1970 +0000
1089 summary: 1a
1089 summary: 1a
1090
1090
1091 One repo should be new, the other should be shared from the pool. We
1091 One repo should be new, the other should be shared from the pool. We
1092 don't care which is which, so we just make sure we always print the
1092 don't care which is which, so we just make sure we always print the
1093 one containing "new pooled" first, then one one containing "existing
1093 one containing "new pooled" first, then one one containing "existing
1094 pooled".
1094 pooled".
1095
1095
1096 $ (grep 'new pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1096 $ (grep 'new pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1097 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1097 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1098 requesting all changes
1098 requesting all changes
1099 adding changesets
1099 adding changesets
1100 adding manifests
1100 adding manifests
1101 adding file changes
1101 adding file changes
1102 added 3 changesets with 3 changes to 1 files
1102 added 3 changesets with 3 changes to 1 files
1103 new changesets b5f04eac9d8f:e5bfe23c0b47
1103 new changesets b5f04eac9d8f:e5bfe23c0b47
1104 searching for changes
1104 searching for changes
1105 no changes found
1105 no changes found
1106 adding remote bookmark bookA
1106 adding remote bookmark bookA
1107 updating working directory
1107 updating working directory
1108 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1108 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1109
1109
1110 $ (grep 'existing pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1110 $ (grep 'existing pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1111 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1111 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1112 searching for changes
1112 searching for changes
1113 no changes found
1113 no changes found
1114 adding remote bookmark bookA
1114 adding remote bookmark bookA
1115 updating working directory
1115 updating working directory
1116 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1116 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1117
1117
1118 SEC: check for unsafe ssh url
1118 SEC: check for unsafe ssh url
1119
1119
1120 $ cat >> $HGRCPATH << EOF
1120 $ cat >> $HGRCPATH << EOF
1121 > [ui]
1121 > [ui]
1122 > ssh = sh -c "read l; read l; read l"
1122 > ssh = sh -c "read l; read l; read l"
1123 > EOF
1123 > EOF
1124
1124
1125 $ hg clone 'ssh://-oProxyCommand=touch${IFS}owned/path'
1125 $ hg clone 'ssh://-oProxyCommand=touch${IFS}owned/path'
1126 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1126 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1127 [255]
1127 [255]
1128 $ hg clone 'ssh://%2DoProxyCommand=touch${IFS}owned/path'
1128 $ hg clone 'ssh://%2DoProxyCommand=touch${IFS}owned/path'
1129 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1129 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1130 [255]
1130 [255]
1131 $ hg clone 'ssh://fakehost|touch%20owned/path'
1131 $ hg clone 'ssh://fakehost|touch%20owned/path'
1132 abort: no suitable response from remote hg!
1132 abort: no suitable response from remote hg!
1133 [255]
1133 [255]
1134 $ hg clone 'ssh://fakehost%7Ctouch%20owned/path'
1134 $ hg clone 'ssh://fakehost%7Ctouch%20owned/path'
1135 abort: no suitable response from remote hg!
1135 abort: no suitable response from remote hg!
1136 [255]
1136 [255]
1137
1137
1138 $ hg clone 'ssh://-oProxyCommand=touch owned%20foo@example.com/nonexistent/path'
1138 $ hg clone 'ssh://-oProxyCommand=touch owned%20foo@example.com/nonexistent/path'
1139 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned foo@example.com/nonexistent/path'
1139 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned foo@example.com/nonexistent/path'
1140 [255]
1140 [255]
1141
1141
1142 #if windows
1142 #if windows
1143 $ hg clone "ssh://%26touch%20owned%20/" --debug
1143 $ hg clone "ssh://%26touch%20owned%20/" --debug
1144 running sh -c "read l; read l; read l" "&touch owned " "hg -R . serve --stdio"
1144 running sh -c "read l; read l; read l" "&touch owned " "hg -R . serve --stdio"
1145 sending hello command
1145 sending hello command
1146 sending between command
1146 sending between command
1147 abort: no suitable response from remote hg!
1147 abort: no suitable response from remote hg!
1148 [255]
1148 [255]
1149 $ hg clone "ssh://example.com:%26touch%20owned%20/" --debug
1149 $ hg clone "ssh://example.com:%26touch%20owned%20/" --debug
1150 running sh -c "read l; read l; read l" -p "&touch owned " example.com "hg -R . serve --stdio"
1150 running sh -c "read l; read l; read l" -p "&touch owned " example.com "hg -R . serve --stdio"
1151 sending hello command
1151 sending hello command
1152 sending between command
1152 sending between command
1153 abort: no suitable response from remote hg!
1153 abort: no suitable response from remote hg!
1154 [255]
1154 [255]
1155 #else
1155 #else
1156 $ hg clone "ssh://%3btouch%20owned%20/" --debug
1156 $ hg clone "ssh://%3btouch%20owned%20/" --debug
1157 running sh -c "read l; read l; read l" ';touch owned ' 'hg -R . serve --stdio'
1157 running sh -c "read l; read l; read l" ';touch owned ' 'hg -R . serve --stdio'
1158 sending hello command
1158 sending hello command
1159 sending between command
1159 sending between command
1160 abort: no suitable response from remote hg!
1160 abort: no suitable response from remote hg!
1161 [255]
1161 [255]
1162 $ hg clone "ssh://example.com:%3btouch%20owned%20/" --debug
1162 $ hg clone "ssh://example.com:%3btouch%20owned%20/" --debug
1163 running sh -c "read l; read l; read l" -p ';touch owned ' example.com 'hg -R . serve --stdio'
1163 running sh -c "read l; read l; read l" -p ';touch owned ' example.com 'hg -R . serve --stdio'
1164 sending hello command
1164 sending hello command
1165 sending between command
1165 sending between command
1166 abort: no suitable response from remote hg!
1166 abort: no suitable response from remote hg!
1167 [255]
1167 [255]
1168 #endif
1168 #endif
1169
1169
1170 $ hg clone "ssh://v-alid.example.com/" --debug
1170 $ hg clone "ssh://v-alid.example.com/" --debug
1171 running sh -c "read l; read l; read l" v-alid\.example\.com ['"]hg -R \. serve --stdio['"] (re)
1171 running sh -c "read l; read l; read l" v-alid\.example\.com ['"]hg -R \. serve --stdio['"] (re)
1172 sending hello command
1172 sending hello command
1173 sending between command
1173 sending between command
1174 abort: no suitable response from remote hg!
1174 abort: no suitable response from remote hg!
1175 [255]
1175 [255]
1176
1176
1177 We should not have created a file named owned - if it exists, the
1177 We should not have created a file named owned - if it exists, the
1178 attack succeeded.
1178 attack succeeded.
1179 $ if test -f owned; then echo 'you got owned'; fi
1179 $ if test -f owned; then echo 'you got owned'; fi
1180
1180
1181 Cloning without fsmonitor enabled does not print a warning for small repos
1181 Cloning without fsmonitor enabled does not print a warning for small repos
1182
1182
1183 $ hg clone a fsmonitor-default
1183 $ hg clone a fsmonitor-default
1184 updating to bookmark @ on branch stable
1184 updating to bookmark @ on branch stable
1185 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1185 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1186
1186
1187 Lower the warning threshold to simulate a large repo
1187 Lower the warning threshold to simulate a large repo
1188
1188
1189 $ cat >> $HGRCPATH << EOF
1189 $ cat >> $HGRCPATH << EOF
1190 > [fsmonitor]
1190 > [fsmonitor]
1191 > warn_update_file_count = 2
1191 > warn_update_file_count = 2
1192 > EOF
1192 > EOF
1193
1193
1194 We should see a warning about no fsmonitor on supported platforms
1194 We should see a warning about no fsmonitor on supported platforms
1195
1195
1196 #if linuxormacos no-fsmonitor
1196 #if linuxormacos no-fsmonitor
1197 $ hg clone a nofsmonitor
1197 $ hg clone a nofsmonitor
1198 updating to bookmark @ on branch stable
1198 updating to bookmark @ on branch stable
1199 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor")
1199 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor")
1200 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1200 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1201 #else
1201 #else
1202 $ hg clone a nofsmonitor
1202 $ hg clone a nofsmonitor
1203 updating to bookmark @ on branch stable
1203 updating to bookmark @ on branch stable
1204 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1204 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1205 #endif
1205 #endif
1206
1206
1207 We should not see warning about fsmonitor when it is enabled
1207 We should not see warning about fsmonitor when it is enabled
1208
1208
1209 #if fsmonitor
1209 #if fsmonitor
1210 $ hg clone a fsmonitor-enabled
1210 $ hg clone a fsmonitor-enabled
1211 updating to bookmark @ on branch stable
1211 updating to bookmark @ on branch stable
1212 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1212 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1213 #endif
1213 #endif
1214
1214
1215 We can disable the fsmonitor warning
1215 We can disable the fsmonitor warning
1216
1216
1217 $ hg --config fsmonitor.warn_when_unused=false clone a fsmonitor-disable-warning
1217 $ hg --config fsmonitor.warn_when_unused=false clone a fsmonitor-disable-warning
1218 updating to bookmark @ on branch stable
1218 updating to bookmark @ on branch stable
1219 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1219 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1220
1220
1221 Loaded fsmonitor but disabled in config should still print warning
1221 Loaded fsmonitor but disabled in config should still print warning
1222
1222
1223 #if linuxormacos fsmonitor
1223 #if linuxormacos fsmonitor
1224 $ hg --config fsmonitor.mode=off clone a fsmonitor-mode-off
1224 $ hg --config fsmonitor.mode=off clone a fsmonitor-mode-off
1225 updating to bookmark @ on branch stable
1225 updating to bookmark @ on branch stable
1226 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (fsmonitor !)
1226 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (fsmonitor !)
1227 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1227 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1228 #endif
1228 #endif
1229
1229
1230 Warning not printed if working directory isn't empty
1230 Warning not printed if working directory isn't empty
1231
1231
1232 $ hg -q clone a fsmonitor-update
1232 $ hg -q clone a fsmonitor-update
1233 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (?)
1233 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (?)
1234 $ cd fsmonitor-update
1234 $ cd fsmonitor-update
1235 $ hg up acb14030fe0a
1235 $ hg up acb14030fe0a
1236 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1236 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1237 (leaving bookmark @)
1237 (leaving bookmark @)
1238 $ hg up cf0fe1914066
1238 $ hg up cf0fe1914066
1239 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1239 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1240
1240
1241 `hg update` from null revision also prints
1241 `hg update` from null revision also prints
1242
1242
1243 $ hg up null
1243 $ hg up null
1244 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1244 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1245
1245
1246 #if linuxormacos no-fsmonitor
1246 #if linuxormacos no-fsmonitor
1247 $ hg up cf0fe1914066
1247 $ hg up cf0fe1914066
1248 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor")
1248 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor")
1249 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1249 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1250 #else
1250 #else
1251 $ hg up cf0fe1914066
1251 $ hg up cf0fe1914066
1252 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1252 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1253 #endif
1253 #endif
1254
1254
1255 $ cd ..
1255 $ cd ..
1256
1256
General Comments 0
You need to be logged in to leave comments. Login now