##// END OF EJS Templates
tests: mark manifestfulltextcache as conditional on revlog store...
Gregory Szorc -
r39359:c11e8894 default
parent child Browse files
Show More
@@ -1,1296 +1,1296 b''
1 #testcases sshv1 sshv2
1 #testcases sshv1 sshv2
2
2
3 #if sshv2
3 #if sshv2
4 $ cat >> $HGRCPATH << EOF
4 $ cat >> $HGRCPATH << EOF
5 > [experimental]
5 > [experimental]
6 > sshpeer.advertise-v2 = true
6 > sshpeer.advertise-v2 = true
7 > sshserver.support-v2 = true
7 > sshserver.support-v2 = true
8 > EOF
8 > EOF
9 #endif
9 #endif
10
10
11 Prepare repo a:
11 Prepare repo a:
12
12
13 $ hg init a
13 $ hg init a
14 $ cd a
14 $ cd a
15 $ echo a > a
15 $ echo a > a
16 $ hg add a
16 $ hg add a
17 $ hg commit -m test
17 $ hg commit -m test
18 $ echo first line > b
18 $ echo first line > b
19 $ hg add b
19 $ hg add b
20
20
21 Create a non-inlined filelog:
21 Create a non-inlined filelog:
22
22
23 $ $PYTHON -c 'open("data1", "wb").write(b"".join(b"%d\n" % x for x in range(10000)))'
23 $ $PYTHON -c 'open("data1", "wb").write(b"".join(b"%d\n" % x for x in range(10000)))'
24 $ for j in 0 1 2 3 4 5 6 7 8 9; do
24 $ for j in 0 1 2 3 4 5 6 7 8 9; do
25 > cat data1 >> b
25 > cat data1 >> b
26 > hg commit -m test
26 > hg commit -m test
27 > done
27 > done
28
28
29 List files in store/data (should show a 'b.d'):
29 List files in store/data (should show a 'b.d'):
30
30
31 #if reporevlogstore
31 #if reporevlogstore
32 $ for i in .hg/store/data/*; do
32 $ for i in .hg/store/data/*; do
33 > echo $i
33 > echo $i
34 > done
34 > done
35 .hg/store/data/a.i
35 .hg/store/data/a.i
36 .hg/store/data/b.d
36 .hg/store/data/b.d
37 .hg/store/data/b.i
37 .hg/store/data/b.i
38 #endif
38 #endif
39
39
40 Trigger branchcache creation:
40 Trigger branchcache creation:
41
41
42 $ hg branches
42 $ hg branches
43 default 10:a7949464abda
43 default 10:a7949464abda
44 $ ls .hg/cache
44 $ ls .hg/cache
45 branch2-served
45 branch2-served
46 checkisexec (execbit !)
46 checkisexec (execbit !)
47 checklink (symlink !)
47 checklink (symlink !)
48 checklink-target (symlink !)
48 checklink-target (symlink !)
49 checknoexec (execbit !)
49 checknoexec (execbit !)
50 manifestfulltextcache
50 manifestfulltextcache (reporevlogstore !)
51 rbc-names-v1
51 rbc-names-v1
52 rbc-revs-v1
52 rbc-revs-v1
53
53
54 Default operation:
54 Default operation:
55
55
56 $ hg clone . ../b
56 $ hg clone . ../b
57 updating to branch default
57 updating to branch default
58 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
58 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
59 $ cd ../b
59 $ cd ../b
60
60
61 Ensure branchcache got copied over:
61 Ensure branchcache got copied over:
62
62
63 $ ls .hg/cache
63 $ ls .hg/cache
64 branch2-served
64 branch2-served
65 checkisexec (execbit !)
65 checkisexec (execbit !)
66 checklink (symlink !)
66 checklink (symlink !)
67 checklink-target (symlink !)
67 checklink-target (symlink !)
68 rbc-names-v1
68 rbc-names-v1
69 rbc-revs-v1
69 rbc-revs-v1
70
70
71 $ cat a
71 $ cat a
72 a
72 a
73 $ hg verify
73 $ hg verify
74 checking changesets
74 checking changesets
75 checking manifests
75 checking manifests
76 crosschecking files in changesets and manifests
76 crosschecking files in changesets and manifests
77 checking files
77 checking files
78 2 files, 11 changesets, 11 total revisions
78 2 files, 11 changesets, 11 total revisions
79
79
80 Invalid dest '' must abort:
80 Invalid dest '' must abort:
81
81
82 $ hg clone . ''
82 $ hg clone . ''
83 abort: empty destination path is not valid
83 abort: empty destination path is not valid
84 [255]
84 [255]
85
85
86 No update, with debug option:
86 No update, with debug option:
87
87
88 #if hardlink
88 #if hardlink
89 $ hg --debug clone -U . ../c --config progress.debug=true
89 $ hg --debug clone -U . ../c --config progress.debug=true
90 linking: 1
90 linking: 1
91 linking: 2
91 linking: 2
92 linking: 3
92 linking: 3
93 linking: 4
93 linking: 4
94 linking: 5
94 linking: 5
95 linking: 6
95 linking: 6
96 linking: 7
96 linking: 7
97 linking: 8
97 linking: 8
98 linked 8 files (reporevlogstore !)
98 linked 8 files (reporevlogstore !)
99 linking: 9 (reposimplestore !)
99 linking: 9 (reposimplestore !)
100 linking: 10 (reposimplestore !)
100 linking: 10 (reposimplestore !)
101 linking: 11 (reposimplestore !)
101 linking: 11 (reposimplestore !)
102 linking: 12 (reposimplestore !)
102 linking: 12 (reposimplestore !)
103 linking: 13 (reposimplestore !)
103 linking: 13 (reposimplestore !)
104 linking: 14 (reposimplestore !)
104 linking: 14 (reposimplestore !)
105 linking: 15 (reposimplestore !)
105 linking: 15 (reposimplestore !)
106 linking: 16 (reposimplestore !)
106 linking: 16 (reposimplestore !)
107 linking: 17 (reposimplestore !)
107 linking: 17 (reposimplestore !)
108 linking: 18 (reposimplestore !)
108 linking: 18 (reposimplestore !)
109 linked 18 files (reposimplestore !)
109 linked 18 files (reposimplestore !)
110 #else
110 #else
111 $ hg --debug clone -U . ../c --config progress.debug=true
111 $ hg --debug clone -U . ../c --config progress.debug=true
112 linking: 1
112 linking: 1
113 copying: 2
113 copying: 2
114 copying: 3
114 copying: 3
115 copying: 4
115 copying: 4
116 copying: 5
116 copying: 5
117 copying: 6
117 copying: 6
118 copying: 7
118 copying: 7
119 copying: 8
119 copying: 8
120 copied 8 files (reporevlogstore !)
120 copied 8 files (reporevlogstore !)
121 copying: 9 (reposimplestore !)
121 copying: 9 (reposimplestore !)
122 copying: 10 (reposimplestore !)
122 copying: 10 (reposimplestore !)
123 copying: 11 (reposimplestore !)
123 copying: 11 (reposimplestore !)
124 copying: 12 (reposimplestore !)
124 copying: 12 (reposimplestore !)
125 copying: 13 (reposimplestore !)
125 copying: 13 (reposimplestore !)
126 copying: 14 (reposimplestore !)
126 copying: 14 (reposimplestore !)
127 copying: 15 (reposimplestore !)
127 copying: 15 (reposimplestore !)
128 copying: 16 (reposimplestore !)
128 copying: 16 (reposimplestore !)
129 copying: 17 (reposimplestore !)
129 copying: 17 (reposimplestore !)
130 copying: 18 (reposimplestore !)
130 copying: 18 (reposimplestore !)
131 copied 18 files (reposimplestore !)
131 copied 18 files (reposimplestore !)
132 #endif
132 #endif
133 $ cd ../c
133 $ cd ../c
134
134
135 Ensure branchcache got copied over:
135 Ensure branchcache got copied over:
136
136
137 $ ls .hg/cache
137 $ ls .hg/cache
138 branch2-served
138 branch2-served
139 rbc-names-v1
139 rbc-names-v1
140 rbc-revs-v1
140 rbc-revs-v1
141
141
142 $ cat a 2>/dev/null || echo "a not present"
142 $ cat a 2>/dev/null || echo "a not present"
143 a not present
143 a not present
144 $ hg verify
144 $ hg verify
145 checking changesets
145 checking changesets
146 checking manifests
146 checking manifests
147 crosschecking files in changesets and manifests
147 crosschecking files in changesets and manifests
148 checking files
148 checking files
149 2 files, 11 changesets, 11 total revisions
149 2 files, 11 changesets, 11 total revisions
150
150
151 Default destination:
151 Default destination:
152
152
153 $ mkdir ../d
153 $ mkdir ../d
154 $ cd ../d
154 $ cd ../d
155 $ hg clone ../a
155 $ hg clone ../a
156 destination directory: a
156 destination directory: a
157 updating to branch default
157 updating to branch default
158 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
158 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
159 $ cd a
159 $ cd a
160 $ hg cat a
160 $ hg cat a
161 a
161 a
162 $ cd ../..
162 $ cd ../..
163
163
164 Check that we drop the 'file:' from the path before writing the .hgrc:
164 Check that we drop the 'file:' from the path before writing the .hgrc:
165
165
166 $ hg clone file:a e
166 $ hg clone file:a e
167 updating to branch default
167 updating to branch default
168 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
168 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
169 $ grep 'file:' e/.hg/hgrc
169 $ grep 'file:' e/.hg/hgrc
170 [1]
170 [1]
171
171
172 Check that path aliases are expanded:
172 Check that path aliases are expanded:
173
173
174 $ hg clone -q -U --config 'paths.foobar=a#0' foobar f
174 $ hg clone -q -U --config 'paths.foobar=a#0' foobar f
175 $ hg -R f showconfig paths.default
175 $ hg -R f showconfig paths.default
176 $TESTTMP/a#0
176 $TESTTMP/a#0
177
177
178 Use --pull:
178 Use --pull:
179
179
180 $ hg clone --pull a g
180 $ hg clone --pull a g
181 requesting all changes
181 requesting all changes
182 adding changesets
182 adding changesets
183 adding manifests
183 adding manifests
184 adding file changes
184 adding file changes
185 added 11 changesets with 11 changes to 2 files
185 added 11 changesets with 11 changes to 2 files
186 new changesets acb14030fe0a:a7949464abda
186 new changesets acb14030fe0a:a7949464abda
187 updating to branch default
187 updating to branch default
188 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
188 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
189 $ hg -R g verify
189 $ hg -R g verify
190 checking changesets
190 checking changesets
191 checking manifests
191 checking manifests
192 crosschecking files in changesets and manifests
192 crosschecking files in changesets and manifests
193 checking files
193 checking files
194 2 files, 11 changesets, 11 total revisions
194 2 files, 11 changesets, 11 total revisions
195
195
196 Invalid dest '' with --pull must abort (issue2528):
196 Invalid dest '' with --pull must abort (issue2528):
197
197
198 $ hg clone --pull a ''
198 $ hg clone --pull a ''
199 abort: empty destination path is not valid
199 abort: empty destination path is not valid
200 [255]
200 [255]
201
201
202 Clone to '.':
202 Clone to '.':
203
203
204 $ mkdir h
204 $ mkdir h
205 $ cd h
205 $ cd h
206 $ hg clone ../a .
206 $ hg clone ../a .
207 updating to branch default
207 updating to branch default
208 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
208 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
209 $ cd ..
209 $ cd ..
210
210
211
211
212 *** Tests for option -u ***
212 *** Tests for option -u ***
213
213
214 Adding some more history to repo a:
214 Adding some more history to repo a:
215
215
216 $ cd a
216 $ cd a
217 $ hg tag ref1
217 $ hg tag ref1
218 $ echo the quick brown fox >a
218 $ echo the quick brown fox >a
219 $ hg ci -m "hacked default"
219 $ hg ci -m "hacked default"
220 $ hg up ref1
220 $ hg up ref1
221 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
221 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
222 $ hg branch stable
222 $ hg branch stable
223 marked working directory as branch stable
223 marked working directory as branch stable
224 (branches are permanent and global, did you want a bookmark?)
224 (branches are permanent and global, did you want a bookmark?)
225 $ echo some text >a
225 $ echo some text >a
226 $ hg ci -m "starting branch stable"
226 $ hg ci -m "starting branch stable"
227 $ hg tag ref2
227 $ hg tag ref2
228 $ echo some more text >a
228 $ echo some more text >a
229 $ hg ci -m "another change for branch stable"
229 $ hg ci -m "another change for branch stable"
230 $ hg up ref2
230 $ hg up ref2
231 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
231 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
232 $ hg parents
232 $ hg parents
233 changeset: 13:e8ece76546a6
233 changeset: 13:e8ece76546a6
234 branch: stable
234 branch: stable
235 tag: ref2
235 tag: ref2
236 parent: 10:a7949464abda
236 parent: 10:a7949464abda
237 user: test
237 user: test
238 date: Thu Jan 01 00:00:00 1970 +0000
238 date: Thu Jan 01 00:00:00 1970 +0000
239 summary: starting branch stable
239 summary: starting branch stable
240
240
241
241
242 Repo a has two heads:
242 Repo a has two heads:
243
243
244 $ hg heads
244 $ hg heads
245 changeset: 15:0aae7cf88f0d
245 changeset: 15:0aae7cf88f0d
246 branch: stable
246 branch: stable
247 tag: tip
247 tag: tip
248 user: test
248 user: test
249 date: Thu Jan 01 00:00:00 1970 +0000
249 date: Thu Jan 01 00:00:00 1970 +0000
250 summary: another change for branch stable
250 summary: another change for branch stable
251
251
252 changeset: 12:f21241060d6a
252 changeset: 12:f21241060d6a
253 user: test
253 user: test
254 date: Thu Jan 01 00:00:00 1970 +0000
254 date: Thu Jan 01 00:00:00 1970 +0000
255 summary: hacked default
255 summary: hacked default
256
256
257
257
258 $ cd ..
258 $ cd ..
259
259
260
260
261 Testing --noupdate with --updaterev (must abort):
261 Testing --noupdate with --updaterev (must abort):
262
262
263 $ hg clone --noupdate --updaterev 1 a ua
263 $ hg clone --noupdate --updaterev 1 a ua
264 abort: cannot specify both --noupdate and --updaterev
264 abort: cannot specify both --noupdate and --updaterev
265 [255]
265 [255]
266
266
267
267
268 Testing clone -u:
268 Testing clone -u:
269
269
270 $ hg clone -u . a ua
270 $ hg clone -u . a ua
271 updating to branch stable
271 updating to branch stable
272 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
272 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
273
273
274 Repo ua has both heads:
274 Repo ua has both heads:
275
275
276 $ hg -R ua heads
276 $ hg -R ua heads
277 changeset: 15:0aae7cf88f0d
277 changeset: 15:0aae7cf88f0d
278 branch: stable
278 branch: stable
279 tag: tip
279 tag: tip
280 user: test
280 user: test
281 date: Thu Jan 01 00:00:00 1970 +0000
281 date: Thu Jan 01 00:00:00 1970 +0000
282 summary: another change for branch stable
282 summary: another change for branch stable
283
283
284 changeset: 12:f21241060d6a
284 changeset: 12:f21241060d6a
285 user: test
285 user: test
286 date: Thu Jan 01 00:00:00 1970 +0000
286 date: Thu Jan 01 00:00:00 1970 +0000
287 summary: hacked default
287 summary: hacked default
288
288
289
289
290 Same revision checked out in repo a and ua:
290 Same revision checked out in repo a and ua:
291
291
292 $ hg -R a parents --template "{node|short}\n"
292 $ hg -R a parents --template "{node|short}\n"
293 e8ece76546a6
293 e8ece76546a6
294 $ hg -R ua parents --template "{node|short}\n"
294 $ hg -R ua parents --template "{node|short}\n"
295 e8ece76546a6
295 e8ece76546a6
296
296
297 $ rm -r ua
297 $ rm -r ua
298
298
299
299
300 Testing clone --pull -u:
300 Testing clone --pull -u:
301
301
302 $ hg clone --pull -u . a ua
302 $ hg clone --pull -u . a ua
303 requesting all changes
303 requesting all changes
304 adding changesets
304 adding changesets
305 adding manifests
305 adding manifests
306 adding file changes
306 adding file changes
307 added 16 changesets with 16 changes to 3 files (+1 heads)
307 added 16 changesets with 16 changes to 3 files (+1 heads)
308 new changesets acb14030fe0a:0aae7cf88f0d
308 new changesets acb14030fe0a:0aae7cf88f0d
309 updating to branch stable
309 updating to branch stable
310 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
310 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
311
311
312 Repo ua has both heads:
312 Repo ua has both heads:
313
313
314 $ hg -R ua heads
314 $ hg -R ua heads
315 changeset: 15:0aae7cf88f0d
315 changeset: 15:0aae7cf88f0d
316 branch: stable
316 branch: stable
317 tag: tip
317 tag: tip
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: another change for branch stable
320 summary: another change for branch stable
321
321
322 changeset: 12:f21241060d6a
322 changeset: 12:f21241060d6a
323 user: test
323 user: test
324 date: Thu Jan 01 00:00:00 1970 +0000
324 date: Thu Jan 01 00:00:00 1970 +0000
325 summary: hacked default
325 summary: hacked default
326
326
327
327
328 Same revision checked out in repo a and ua:
328 Same revision checked out in repo a and ua:
329
329
330 $ hg -R a parents --template "{node|short}\n"
330 $ hg -R a parents --template "{node|short}\n"
331 e8ece76546a6
331 e8ece76546a6
332 $ hg -R ua parents --template "{node|short}\n"
332 $ hg -R ua parents --template "{node|short}\n"
333 e8ece76546a6
333 e8ece76546a6
334
334
335 $ rm -r ua
335 $ rm -r ua
336
336
337
337
338 Testing clone -u <branch>:
338 Testing clone -u <branch>:
339
339
340 $ hg clone -u stable a ua
340 $ hg clone -u stable a ua
341 updating to branch stable
341 updating to branch stable
342 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
342 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
343
343
344 Repo ua has both heads:
344 Repo ua has both heads:
345
345
346 $ hg -R ua heads
346 $ hg -R ua heads
347 changeset: 15:0aae7cf88f0d
347 changeset: 15:0aae7cf88f0d
348 branch: stable
348 branch: stable
349 tag: tip
349 tag: tip
350 user: test
350 user: test
351 date: Thu Jan 01 00:00:00 1970 +0000
351 date: Thu Jan 01 00:00:00 1970 +0000
352 summary: another change for branch stable
352 summary: another change for branch stable
353
353
354 changeset: 12:f21241060d6a
354 changeset: 12:f21241060d6a
355 user: test
355 user: test
356 date: Thu Jan 01 00:00:00 1970 +0000
356 date: Thu Jan 01 00:00:00 1970 +0000
357 summary: hacked default
357 summary: hacked default
358
358
359
359
360 Branch 'stable' is checked out:
360 Branch 'stable' is checked out:
361
361
362 $ hg -R ua parents
362 $ hg -R ua parents
363 changeset: 15:0aae7cf88f0d
363 changeset: 15:0aae7cf88f0d
364 branch: stable
364 branch: stable
365 tag: tip
365 tag: tip
366 user: test
366 user: test
367 date: Thu Jan 01 00:00:00 1970 +0000
367 date: Thu Jan 01 00:00:00 1970 +0000
368 summary: another change for branch stable
368 summary: another change for branch stable
369
369
370
370
371 $ rm -r ua
371 $ rm -r ua
372
372
373
373
374 Testing default checkout:
374 Testing default checkout:
375
375
376 $ hg clone a ua
376 $ hg clone a ua
377 updating to branch default
377 updating to branch default
378 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
378 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
379
379
380 Repo ua has both heads:
380 Repo ua has both heads:
381
381
382 $ hg -R ua heads
382 $ hg -R ua heads
383 changeset: 15:0aae7cf88f0d
383 changeset: 15:0aae7cf88f0d
384 branch: stable
384 branch: stable
385 tag: tip
385 tag: tip
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
395
396 Branch 'default' is checked out:
396 Branch 'default' is checked out:
397
397
398 $ hg -R ua parents
398 $ hg -R ua parents
399 changeset: 12:f21241060d6a
399 changeset: 12:f21241060d6a
400 user: test
400 user: test
401 date: Thu Jan 01 00:00:00 1970 +0000
401 date: Thu Jan 01 00:00:00 1970 +0000
402 summary: hacked default
402 summary: hacked default
403
403
404 Test clone with a branch named "@" (issue3677)
404 Test clone with a branch named "@" (issue3677)
405
405
406 $ hg -R ua branch @
406 $ hg -R ua branch @
407 marked working directory as branch @
407 marked working directory as branch @
408 $ hg -R ua commit -m 'created branch @'
408 $ hg -R ua commit -m 'created branch @'
409 $ hg clone ua atbranch
409 $ hg clone ua atbranch
410 updating to branch default
410 updating to branch default
411 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
411 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
412 $ hg -R atbranch heads
412 $ hg -R atbranch heads
413 changeset: 16:798b6d97153e
413 changeset: 16:798b6d97153e
414 branch: @
414 branch: @
415 tag: tip
415 tag: tip
416 parent: 12:f21241060d6a
416 parent: 12:f21241060d6a
417 user: test
417 user: test
418 date: Thu Jan 01 00:00:00 1970 +0000
418 date: Thu Jan 01 00:00:00 1970 +0000
419 summary: created branch @
419 summary: created branch @
420
420
421 changeset: 15:0aae7cf88f0d
421 changeset: 15:0aae7cf88f0d
422 branch: stable
422 branch: stable
423 user: test
423 user: test
424 date: Thu Jan 01 00:00:00 1970 +0000
424 date: Thu Jan 01 00:00:00 1970 +0000
425 summary: another change for branch stable
425 summary: another change for branch stable
426
426
427 changeset: 12:f21241060d6a
427 changeset: 12:f21241060d6a
428 user: test
428 user: test
429 date: Thu Jan 01 00:00:00 1970 +0000
429 date: Thu Jan 01 00:00:00 1970 +0000
430 summary: hacked default
430 summary: hacked default
431
431
432 $ hg -R atbranch parents
432 $ hg -R atbranch parents
433 changeset: 12:f21241060d6a
433 changeset: 12:f21241060d6a
434 user: test
434 user: test
435 date: Thu Jan 01 00:00:00 1970 +0000
435 date: Thu Jan 01 00:00:00 1970 +0000
436 summary: hacked default
436 summary: hacked default
437
437
438
438
439 $ rm -r ua atbranch
439 $ rm -r ua atbranch
440
440
441
441
442 Testing #<branch>:
442 Testing #<branch>:
443
443
444 $ hg clone -u . a#stable ua
444 $ hg clone -u . a#stable ua
445 adding changesets
445 adding changesets
446 adding manifests
446 adding manifests
447 adding file changes
447 adding file changes
448 added 14 changesets with 14 changes to 3 files
448 added 14 changesets with 14 changes to 3 files
449 new changesets acb14030fe0a:0aae7cf88f0d
449 new changesets acb14030fe0a:0aae7cf88f0d
450 updating to branch stable
450 updating to branch stable
451 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
451 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
452
452
453 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
453 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
454
454
455 $ hg -R ua heads
455 $ hg -R ua heads
456 changeset: 13:0aae7cf88f0d
456 changeset: 13:0aae7cf88f0d
457 branch: stable
457 branch: stable
458 tag: tip
458 tag: tip
459 user: test
459 user: test
460 date: Thu Jan 01 00:00:00 1970 +0000
460 date: Thu Jan 01 00:00:00 1970 +0000
461 summary: another change for branch stable
461 summary: another change for branch stable
462
462
463 changeset: 10:a7949464abda
463 changeset: 10:a7949464abda
464 user: test
464 user: test
465 date: Thu Jan 01 00:00:00 1970 +0000
465 date: Thu Jan 01 00:00:00 1970 +0000
466 summary: test
466 summary: test
467
467
468
468
469 Same revision checked out in repo a and ua:
469 Same revision checked out in repo a and ua:
470
470
471 $ hg -R a parents --template "{node|short}\n"
471 $ hg -R a parents --template "{node|short}\n"
472 e8ece76546a6
472 e8ece76546a6
473 $ hg -R ua parents --template "{node|short}\n"
473 $ hg -R ua parents --template "{node|short}\n"
474 e8ece76546a6
474 e8ece76546a6
475
475
476 $ rm -r ua
476 $ rm -r ua
477
477
478
478
479 Testing -u -r <branch>:
479 Testing -u -r <branch>:
480
480
481 $ hg clone -u . -r stable a ua
481 $ hg clone -u . -r stable a ua
482 adding changesets
482 adding changesets
483 adding manifests
483 adding manifests
484 adding file changes
484 adding file changes
485 added 14 changesets with 14 changes to 3 files
485 added 14 changesets with 14 changes to 3 files
486 new changesets acb14030fe0a:0aae7cf88f0d
486 new changesets acb14030fe0a:0aae7cf88f0d
487 updating to branch stable
487 updating to branch stable
488 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
488 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
489
489
490 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
490 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
491
491
492 $ hg -R ua heads
492 $ hg -R ua heads
493 changeset: 13:0aae7cf88f0d
493 changeset: 13:0aae7cf88f0d
494 branch: stable
494 branch: stable
495 tag: tip
495 tag: tip
496 user: test
496 user: test
497 date: Thu Jan 01 00:00:00 1970 +0000
497 date: Thu Jan 01 00:00:00 1970 +0000
498 summary: another change for branch stable
498 summary: another change for branch stable
499
499
500 changeset: 10:a7949464abda
500 changeset: 10:a7949464abda
501 user: test
501 user: test
502 date: Thu Jan 01 00:00:00 1970 +0000
502 date: Thu Jan 01 00:00:00 1970 +0000
503 summary: test
503 summary: test
504
504
505
505
506 Same revision checked out in repo a and ua:
506 Same revision checked out in repo a and ua:
507
507
508 $ hg -R a parents --template "{node|short}\n"
508 $ hg -R a parents --template "{node|short}\n"
509 e8ece76546a6
509 e8ece76546a6
510 $ hg -R ua parents --template "{node|short}\n"
510 $ hg -R ua parents --template "{node|short}\n"
511 e8ece76546a6
511 e8ece76546a6
512
512
513 $ rm -r ua
513 $ rm -r ua
514
514
515
515
516 Testing -r <branch>:
516 Testing -r <branch>:
517
517
518 $ hg clone -r stable a ua
518 $ hg clone -r stable a ua
519 adding changesets
519 adding changesets
520 adding manifests
520 adding manifests
521 adding file changes
521 adding file changes
522 added 14 changesets with 14 changes to 3 files
522 added 14 changesets with 14 changes to 3 files
523 new changesets acb14030fe0a:0aae7cf88f0d
523 new changesets acb14030fe0a:0aae7cf88f0d
524 updating to branch stable
524 updating to branch stable
525 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
525 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
526
526
527 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
527 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
528
528
529 $ hg -R ua heads
529 $ hg -R ua heads
530 changeset: 13:0aae7cf88f0d
530 changeset: 13:0aae7cf88f0d
531 branch: stable
531 branch: stable
532 tag: tip
532 tag: tip
533 user: test
533 user: test
534 date: Thu Jan 01 00:00:00 1970 +0000
534 date: Thu Jan 01 00:00:00 1970 +0000
535 summary: another change for branch stable
535 summary: another change for branch stable
536
536
537 changeset: 10:a7949464abda
537 changeset: 10:a7949464abda
538 user: test
538 user: test
539 date: Thu Jan 01 00:00:00 1970 +0000
539 date: Thu Jan 01 00:00:00 1970 +0000
540 summary: test
540 summary: test
541
541
542
542
543 Branch 'stable' is checked out:
543 Branch 'stable' is checked out:
544
544
545 $ hg -R ua parents
545 $ hg -R ua parents
546 changeset: 13:0aae7cf88f0d
546 changeset: 13:0aae7cf88f0d
547 branch: stable
547 branch: stable
548 tag: tip
548 tag: tip
549 user: test
549 user: test
550 date: Thu Jan 01 00:00:00 1970 +0000
550 date: Thu Jan 01 00:00:00 1970 +0000
551 summary: another change for branch stable
551 summary: another change for branch stable
552
552
553
553
554 $ rm -r ua
554 $ rm -r ua
555
555
556
556
557 Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not
557 Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not
558 iterable in addbranchrevs()
558 iterable in addbranchrevs()
559
559
560 $ cat <<EOF > simpleclone.py
560 $ cat <<EOF > simpleclone.py
561 > from mercurial import ui, hg
561 > from mercurial import ui, hg
562 > myui = ui.ui.load()
562 > myui = ui.ui.load()
563 > repo = hg.repository(myui, b'a')
563 > repo = hg.repository(myui, b'a')
564 > hg.clone(myui, {}, repo, dest=b"ua")
564 > hg.clone(myui, {}, repo, dest=b"ua")
565 > EOF
565 > EOF
566
566
567 $ $PYTHON simpleclone.py
567 $ $PYTHON simpleclone.py
568 updating to branch default
568 updating to branch default
569 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
569 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
570
570
571 $ rm -r ua
571 $ rm -r ua
572
572
573 $ cat <<EOF > branchclone.py
573 $ cat <<EOF > branchclone.py
574 > from mercurial import ui, hg, extensions
574 > from mercurial import ui, hg, extensions
575 > myui = ui.ui.load()
575 > myui = ui.ui.load()
576 > extensions.loadall(myui)
576 > extensions.loadall(myui)
577 > repo = hg.repository(myui, b'a')
577 > repo = hg.repository(myui, b'a')
578 > hg.clone(myui, {}, repo, dest=b"ua", branch=[b"stable",])
578 > hg.clone(myui, {}, repo, dest=b"ua", branch=[b"stable",])
579 > EOF
579 > EOF
580
580
581 $ $PYTHON branchclone.py
581 $ $PYTHON branchclone.py
582 adding changesets
582 adding changesets
583 adding manifests
583 adding manifests
584 adding file changes
584 adding file changes
585 added 14 changesets with 14 changes to 3 files
585 added 14 changesets with 14 changes to 3 files
586 new changesets acb14030fe0a:0aae7cf88f0d
586 new changesets acb14030fe0a:0aae7cf88f0d
587 updating to branch stable
587 updating to branch stable
588 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
588 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
589 $ rm -r ua
589 $ rm -r ua
590
590
591
591
592 Test clone with special '@' bookmark:
592 Test clone with special '@' bookmark:
593 $ cd a
593 $ cd a
594 $ hg bookmark -r a7949464abda @ # branch point of stable from default
594 $ hg bookmark -r a7949464abda @ # branch point of stable from default
595 $ hg clone . ../i
595 $ hg clone . ../i
596 updating to bookmark @
596 updating to bookmark @
597 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
597 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
598 $ hg id -i ../i
598 $ hg id -i ../i
599 a7949464abda
599 a7949464abda
600 $ rm -r ../i
600 $ rm -r ../i
601
601
602 $ hg bookmark -f -r stable @
602 $ hg bookmark -f -r stable @
603 $ hg bookmarks
603 $ hg bookmarks
604 @ 15:0aae7cf88f0d
604 @ 15:0aae7cf88f0d
605 $ hg clone . ../i
605 $ hg clone . ../i
606 updating to bookmark @ on branch stable
606 updating to bookmark @ on branch stable
607 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
607 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
608 $ hg id -i ../i
608 $ hg id -i ../i
609 0aae7cf88f0d
609 0aae7cf88f0d
610 $ cd "$TESTTMP"
610 $ cd "$TESTTMP"
611
611
612
612
613 Testing failures:
613 Testing failures:
614
614
615 $ mkdir fail
615 $ mkdir fail
616 $ cd fail
616 $ cd fail
617
617
618 No local source
618 No local source
619
619
620 $ hg clone a b
620 $ hg clone a b
621 abort: repository a not found!
621 abort: repository a not found!
622 [255]
622 [255]
623
623
624 No remote source
624 No remote source
625
625
626 #if windows
626 #if windows
627 $ hg clone http://$LOCALIP:3121/a b
627 $ hg clone http://$LOCALIP:3121/a b
628 abort: error: * (glob)
628 abort: error: * (glob)
629 [255]
629 [255]
630 #else
630 #else
631 $ hg clone http://$LOCALIP:3121/a b
631 $ hg clone http://$LOCALIP:3121/a b
632 abort: error: *refused* (glob)
632 abort: error: *refused* (glob)
633 [255]
633 [255]
634 #endif
634 #endif
635 $ rm -rf b # work around bug with http clone
635 $ rm -rf b # work around bug with http clone
636
636
637
637
638 #if unix-permissions no-root
638 #if unix-permissions no-root
639
639
640 Inaccessible source
640 Inaccessible source
641
641
642 $ mkdir a
642 $ mkdir a
643 $ chmod 000 a
643 $ chmod 000 a
644 $ hg clone a b
644 $ hg clone a b
645 abort: Permission denied: '$TESTTMP/fail/a/.hg'
645 abort: Permission denied: '$TESTTMP/fail/a/.hg'
646 [255]
646 [255]
647
647
648 Inaccessible destination
648 Inaccessible destination
649
649
650 $ hg init b
650 $ hg init b
651 $ cd b
651 $ cd b
652 $ hg clone . ../a
652 $ hg clone . ../a
653 abort: Permission denied: '../a'
653 abort: Permission denied: '../a'
654 [255]
654 [255]
655 $ cd ..
655 $ cd ..
656 $ chmod 700 a
656 $ chmod 700 a
657 $ rm -r a b
657 $ rm -r a b
658
658
659 #endif
659 #endif
660
660
661
661
662 #if fifo
662 #if fifo
663
663
664 Source of wrong type
664 Source of wrong type
665
665
666 $ mkfifo a
666 $ mkfifo a
667 $ hg clone a b
667 $ hg clone a b
668 abort: $ENOTDIR$: '$TESTTMP/fail/a/.hg'
668 abort: $ENOTDIR$: '$TESTTMP/fail/a/.hg'
669 [255]
669 [255]
670 $ rm a
670 $ rm a
671
671
672 #endif
672 #endif
673
673
674 Default destination, same directory
674 Default destination, same directory
675
675
676 $ hg init q
676 $ hg init q
677 $ hg clone q
677 $ hg clone q
678 destination directory: q
678 destination directory: q
679 abort: destination 'q' is not empty
679 abort: destination 'q' is not empty
680 [255]
680 [255]
681
681
682 destination directory not empty
682 destination directory not empty
683
683
684 $ mkdir a
684 $ mkdir a
685 $ echo stuff > a/a
685 $ echo stuff > a/a
686 $ hg clone q a
686 $ hg clone q a
687 abort: destination 'a' is not empty
687 abort: destination 'a' is not empty
688 [255]
688 [255]
689
689
690
690
691 #if unix-permissions no-root
691 #if unix-permissions no-root
692
692
693 leave existing directory in place after clone failure
693 leave existing directory in place after clone failure
694
694
695 $ hg init c
695 $ hg init c
696 $ cd c
696 $ cd c
697 $ echo c > c
697 $ echo c > c
698 $ hg commit -A -m test
698 $ hg commit -A -m test
699 adding c
699 adding c
700 $ chmod -rx .hg/store/data
700 $ chmod -rx .hg/store/data
701 $ cd ..
701 $ cd ..
702 $ mkdir d
702 $ mkdir d
703 $ hg clone c d 2> err
703 $ hg clone c d 2> err
704 [255]
704 [255]
705 $ test -d d
705 $ test -d d
706 $ test -d d/.hg
706 $ test -d d/.hg
707 [1]
707 [1]
708
708
709 re-enable perm to allow deletion
709 re-enable perm to allow deletion
710
710
711 $ chmod +rx c/.hg/store/data
711 $ chmod +rx c/.hg/store/data
712
712
713 #endif
713 #endif
714
714
715 $ cd ..
715 $ cd ..
716
716
717 Test clone from the repository in (emulated) revlog format 0 (issue4203):
717 Test clone from the repository in (emulated) revlog format 0 (issue4203):
718
718
719 $ mkdir issue4203
719 $ mkdir issue4203
720 $ mkdir -p src/.hg
720 $ mkdir -p src/.hg
721 $ echo foo > src/foo
721 $ echo foo > src/foo
722 $ hg -R src add src/foo
722 $ hg -R src add src/foo
723 $ hg -R src commit -m '#0'
723 $ hg -R src commit -m '#0'
724 $ hg -R src log -q
724 $ hg -R src log -q
725 0:e1bab28bca43
725 0:e1bab28bca43
726 $ hg clone -U -q src dst
726 $ hg clone -U -q src dst
727 $ hg -R dst log -q
727 $ hg -R dst log -q
728 0:e1bab28bca43
728 0:e1bab28bca43
729
729
730 Create repositories to test auto sharing functionality
730 Create repositories to test auto sharing functionality
731
731
732 $ cat >> $HGRCPATH << EOF
732 $ cat >> $HGRCPATH << EOF
733 > [extensions]
733 > [extensions]
734 > share=
734 > share=
735 > EOF
735 > EOF
736
736
737 $ hg init empty
737 $ hg init empty
738 $ hg init source1a
738 $ hg init source1a
739 $ cd source1a
739 $ cd source1a
740 $ echo initial1 > foo
740 $ echo initial1 > foo
741 $ hg -q commit -A -m initial
741 $ hg -q commit -A -m initial
742 $ echo second > foo
742 $ echo second > foo
743 $ hg commit -m second
743 $ hg commit -m second
744 $ cd ..
744 $ cd ..
745
745
746 $ hg init filteredrev0
746 $ hg init filteredrev0
747 $ cd filteredrev0
747 $ cd filteredrev0
748 $ cat >> .hg/hgrc << EOF
748 $ cat >> .hg/hgrc << EOF
749 > [experimental]
749 > [experimental]
750 > evolution.createmarkers=True
750 > evolution.createmarkers=True
751 > EOF
751 > EOF
752 $ echo initial1 > foo
752 $ echo initial1 > foo
753 $ hg -q commit -A -m initial0
753 $ hg -q commit -A -m initial0
754 $ hg -q up -r null
754 $ hg -q up -r null
755 $ echo initial2 > foo
755 $ echo initial2 > foo
756 $ hg -q commit -A -m initial1
756 $ hg -q commit -A -m initial1
757 $ hg debugobsolete c05d5c47a5cf81401869999f3d05f7d699d2b29a e082c1832e09a7d1e78b7fd49a592d372de854c8
757 $ hg debugobsolete c05d5c47a5cf81401869999f3d05f7d699d2b29a e082c1832e09a7d1e78b7fd49a592d372de854c8
758 obsoleted 1 changesets
758 obsoleted 1 changesets
759 $ cd ..
759 $ cd ..
760
760
761 $ hg -q clone --pull source1a source1b
761 $ hg -q clone --pull source1a source1b
762 $ cd source1a
762 $ cd source1a
763 $ hg bookmark bookA
763 $ hg bookmark bookA
764 $ echo 1a > foo
764 $ echo 1a > foo
765 $ hg commit -m 1a
765 $ hg commit -m 1a
766 $ cd ../source1b
766 $ cd ../source1b
767 $ hg -q up -r 0
767 $ hg -q up -r 0
768 $ echo head1 > foo
768 $ echo head1 > foo
769 $ hg commit -m head1
769 $ hg commit -m head1
770 created new head
770 created new head
771 $ hg bookmark head1
771 $ hg bookmark head1
772 $ hg -q up -r 0
772 $ hg -q up -r 0
773 $ echo head2 > foo
773 $ echo head2 > foo
774 $ hg commit -m head2
774 $ hg commit -m head2
775 created new head
775 created new head
776 $ hg bookmark head2
776 $ hg bookmark head2
777 $ hg -q up -r 0
777 $ hg -q up -r 0
778 $ hg branch branch1
778 $ hg branch branch1
779 marked working directory as branch branch1
779 marked working directory as branch branch1
780 (branches are permanent and global, did you want a bookmark?)
780 (branches are permanent and global, did you want a bookmark?)
781 $ echo branch1 > foo
781 $ echo branch1 > foo
782 $ hg commit -m branch1
782 $ hg commit -m branch1
783 $ hg -q up -r 0
783 $ hg -q up -r 0
784 $ hg branch branch2
784 $ hg branch branch2
785 marked working directory as branch branch2
785 marked working directory as branch branch2
786 $ echo branch2 > foo
786 $ echo branch2 > foo
787 $ hg commit -m branch2
787 $ hg commit -m branch2
788 $ cd ..
788 $ cd ..
789 $ hg init source2
789 $ hg init source2
790 $ cd source2
790 $ cd source2
791 $ echo initial2 > foo
791 $ echo initial2 > foo
792 $ hg -q commit -A -m initial2
792 $ hg -q commit -A -m initial2
793 $ echo second > foo
793 $ echo second > foo
794 $ hg commit -m second
794 $ hg commit -m second
795 $ cd ..
795 $ cd ..
796
796
797 Clone with auto share from an empty repo should not result in share
797 Clone with auto share from an empty repo should not result in share
798
798
799 $ mkdir share
799 $ mkdir share
800 $ hg --config share.pool=share clone empty share-empty
800 $ hg --config share.pool=share clone empty share-empty
801 (not using pooled storage: remote appears to be empty)
801 (not using pooled storage: remote appears to be empty)
802 updating to branch default
802 updating to branch default
803 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
803 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
804 $ ls share
804 $ ls share
805 $ test -d share-empty/.hg/store
805 $ test -d share-empty/.hg/store
806 $ test -f share-empty/.hg/sharedpath
806 $ test -f share-empty/.hg/sharedpath
807 [1]
807 [1]
808
808
809 Clone with auto share from a repo with filtered revision 0 should not result in share
809 Clone with auto share from a repo with filtered revision 0 should not result in share
810
810
811 $ hg --config share.pool=share clone filteredrev0 share-filtered
811 $ hg --config share.pool=share clone filteredrev0 share-filtered
812 (not using pooled storage: unable to resolve identity of remote)
812 (not using pooled storage: unable to resolve identity of remote)
813 requesting all changes
813 requesting all changes
814 adding changesets
814 adding changesets
815 adding manifests
815 adding manifests
816 adding file changes
816 adding file changes
817 added 1 changesets with 1 changes to 1 files
817 added 1 changesets with 1 changes to 1 files
818 new changesets e082c1832e09
818 new changesets e082c1832e09
819 updating to branch default
819 updating to branch default
820 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
820 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
821
821
822 Clone from repo with content should result in shared store being created
822 Clone from repo with content should result in shared store being created
823
823
824 $ hg --config share.pool=share clone source1a share-dest1a
824 $ hg --config share.pool=share clone source1a share-dest1a
825 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
825 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
826 requesting all changes
826 requesting all changes
827 adding changesets
827 adding changesets
828 adding manifests
828 adding manifests
829 adding file changes
829 adding file changes
830 added 3 changesets with 3 changes to 1 files
830 added 3 changesets with 3 changes to 1 files
831 new changesets b5f04eac9d8f:e5bfe23c0b47
831 new changesets b5f04eac9d8f:e5bfe23c0b47
832 searching for changes
832 searching for changes
833 no changes found
833 no changes found
834 adding remote bookmark bookA
834 adding remote bookmark bookA
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 The shared repo should have been created
838 The shared repo should have been created
839
839
840 $ ls share
840 $ ls share
841 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
841 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
842
842
843 The destination should point to it
843 The destination should point to it
844
844
845 $ cat share-dest1a/.hg/sharedpath; echo
845 $ cat share-dest1a/.hg/sharedpath; echo
846 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg
846 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg
847
847
848 The destination should have bookmarks
848 The destination should have bookmarks
849
849
850 $ hg -R share-dest1a bookmarks
850 $ hg -R share-dest1a bookmarks
851 bookA 2:e5bfe23c0b47
851 bookA 2:e5bfe23c0b47
852
852
853 The default path should be the remote, not the share
853 The default path should be the remote, not the share
854
854
855 $ hg -R share-dest1a config paths.default
855 $ hg -R share-dest1a config paths.default
856 $TESTTMP/source1a
856 $TESTTMP/source1a
857
857
858 Clone with existing share dir should result in pull + share
858 Clone with existing share dir should result in pull + share
859
859
860 $ hg --config share.pool=share clone source1b share-dest1b
860 $ hg --config share.pool=share clone source1b share-dest1b
861 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
861 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
862 searching for changes
862 searching for changes
863 adding changesets
863 adding changesets
864 adding manifests
864 adding manifests
865 adding file changes
865 adding file changes
866 added 4 changesets with 4 changes to 1 files (+4 heads)
866 added 4 changesets with 4 changes to 1 files (+4 heads)
867 adding remote bookmark head1
867 adding remote bookmark head1
868 adding remote bookmark head2
868 adding remote bookmark head2
869 new changesets 4a8dc1ab4c13:6bacf4683960
869 new changesets 4a8dc1ab4c13:6bacf4683960
870 updating working directory
870 updating working directory
871 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
871 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
872
872
873 $ ls share
873 $ ls share
874 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
874 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
875
875
876 $ cat share-dest1b/.hg/sharedpath; echo
876 $ cat share-dest1b/.hg/sharedpath; echo
877 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg
877 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg
878
878
879 We only get bookmarks from the remote, not everything in the share
879 We only get bookmarks from the remote, not everything in the share
880
880
881 $ hg -R share-dest1b bookmarks
881 $ hg -R share-dest1b bookmarks
882 head1 3:4a8dc1ab4c13
882 head1 3:4a8dc1ab4c13
883 head2 4:99f71071f117
883 head2 4:99f71071f117
884
884
885 Default path should be source, not share.
885 Default path should be source, not share.
886
886
887 $ hg -R share-dest1b config paths.default
887 $ hg -R share-dest1b config paths.default
888 $TESTTMP/source1b
888 $TESTTMP/source1b
889
889
890 Checked out revision should be head of default branch
890 Checked out revision should be head of default branch
891
891
892 $ hg -R share-dest1b log -r .
892 $ hg -R share-dest1b log -r .
893 changeset: 4:99f71071f117
893 changeset: 4:99f71071f117
894 bookmark: head2
894 bookmark: head2
895 parent: 0:b5f04eac9d8f
895 parent: 0:b5f04eac9d8f
896 user: test
896 user: test
897 date: Thu Jan 01 00:00:00 1970 +0000
897 date: Thu Jan 01 00:00:00 1970 +0000
898 summary: head2
898 summary: head2
899
899
900
900
901 Clone from unrelated repo should result in new share
901 Clone from unrelated repo should result in new share
902
902
903 $ hg --config share.pool=share clone source2 share-dest2
903 $ hg --config share.pool=share clone source2 share-dest2
904 (sharing from new pooled repository 22aeff664783fd44c6d9b435618173c118c3448e)
904 (sharing from new pooled repository 22aeff664783fd44c6d9b435618173c118c3448e)
905 requesting all changes
905 requesting all changes
906 adding changesets
906 adding changesets
907 adding manifests
907 adding manifests
908 adding file changes
908 adding file changes
909 added 2 changesets with 2 changes to 1 files
909 added 2 changesets with 2 changes to 1 files
910 new changesets 22aeff664783:63cf6c3dba4a
910 new changesets 22aeff664783:63cf6c3dba4a
911 searching for changes
911 searching for changes
912 no changes found
912 no changes found
913 updating working directory
913 updating working directory
914 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
914 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
915
915
916 $ ls share
916 $ ls share
917 22aeff664783fd44c6d9b435618173c118c3448e
917 22aeff664783fd44c6d9b435618173c118c3448e
918 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
918 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
919
919
920 remote naming mode works as advertised
920 remote naming mode works as advertised
921
921
922 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1a share-remote1a
922 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1a share-remote1a
923 (sharing from new pooled repository 195bb1fcdb595c14a6c13e0269129ed78f6debde)
923 (sharing from new pooled repository 195bb1fcdb595c14a6c13e0269129ed78f6debde)
924 requesting all changes
924 requesting all changes
925 adding changesets
925 adding changesets
926 adding manifests
926 adding manifests
927 adding file changes
927 adding file changes
928 added 3 changesets with 3 changes to 1 files
928 added 3 changesets with 3 changes to 1 files
929 new changesets b5f04eac9d8f:e5bfe23c0b47
929 new changesets b5f04eac9d8f:e5bfe23c0b47
930 searching for changes
930 searching for changes
931 no changes found
931 no changes found
932 adding remote bookmark bookA
932 adding remote bookmark bookA
933 updating working directory
933 updating working directory
934 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
934 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
935
935
936 $ ls shareremote
936 $ ls shareremote
937 195bb1fcdb595c14a6c13e0269129ed78f6debde
937 195bb1fcdb595c14a6c13e0269129ed78f6debde
938
938
939 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1b share-remote1b
939 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1b share-remote1b
940 (sharing from new pooled repository c0d4f83847ca2a873741feb7048a45085fd47c46)
940 (sharing from new pooled repository c0d4f83847ca2a873741feb7048a45085fd47c46)
941 requesting all changes
941 requesting all changes
942 adding changesets
942 adding changesets
943 adding manifests
943 adding manifests
944 adding file changes
944 adding file changes
945 added 6 changesets with 6 changes to 1 files (+4 heads)
945 added 6 changesets with 6 changes to 1 files (+4 heads)
946 new changesets b5f04eac9d8f:6bacf4683960
946 new changesets b5f04eac9d8f:6bacf4683960
947 searching for changes
947 searching for changes
948 no changes found
948 no changes found
949 adding remote bookmark head1
949 adding remote bookmark head1
950 adding remote bookmark head2
950 adding remote bookmark head2
951 updating working directory
951 updating working directory
952 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
952 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
953
953
954 $ ls shareremote
954 $ ls shareremote
955 195bb1fcdb595c14a6c13e0269129ed78f6debde
955 195bb1fcdb595c14a6c13e0269129ed78f6debde
956 c0d4f83847ca2a873741feb7048a45085fd47c46
956 c0d4f83847ca2a873741feb7048a45085fd47c46
957
957
958 request to clone a single revision is respected in sharing mode
958 request to clone a single revision is respected in sharing mode
959
959
960 $ hg --config share.pool=sharerevs clone -r 4a8dc1ab4c13 source1b share-1arev
960 $ hg --config share.pool=sharerevs clone -r 4a8dc1ab4c13 source1b share-1arev
961 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
961 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
962 adding changesets
962 adding changesets
963 adding manifests
963 adding manifests
964 adding file changes
964 adding file changes
965 added 2 changesets with 2 changes to 1 files
965 added 2 changesets with 2 changes to 1 files
966 new changesets b5f04eac9d8f:4a8dc1ab4c13
966 new changesets b5f04eac9d8f:4a8dc1ab4c13
967 no changes found
967 no changes found
968 adding remote bookmark head1
968 adding remote bookmark head1
969 updating working directory
969 updating working directory
970 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
970 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
971
971
972 $ hg -R share-1arev log -G
972 $ hg -R share-1arev log -G
973 @ changeset: 1:4a8dc1ab4c13
973 @ changeset: 1:4a8dc1ab4c13
974 | bookmark: head1
974 | bookmark: head1
975 | tag: tip
975 | tag: tip
976 | user: test
976 | user: test
977 | date: Thu Jan 01 00:00:00 1970 +0000
977 | date: Thu Jan 01 00:00:00 1970 +0000
978 | summary: head1
978 | summary: head1
979 |
979 |
980 o changeset: 0:b5f04eac9d8f
980 o changeset: 0:b5f04eac9d8f
981 user: test
981 user: test
982 date: Thu Jan 01 00:00:00 1970 +0000
982 date: Thu Jan 01 00:00:00 1970 +0000
983 summary: initial
983 summary: initial
984
984
985
985
986 making another clone should only pull down requested rev
986 making another clone should only pull down requested rev
987
987
988 $ hg --config share.pool=sharerevs clone -r 99f71071f117 source1b share-1brev
988 $ hg --config share.pool=sharerevs clone -r 99f71071f117 source1b share-1brev
989 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
989 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
990 searching for changes
990 searching for changes
991 adding changesets
991 adding changesets
992 adding manifests
992 adding manifests
993 adding file changes
993 adding file changes
994 added 1 changesets with 1 changes to 1 files (+1 heads)
994 added 1 changesets with 1 changes to 1 files (+1 heads)
995 adding remote bookmark head1
995 adding remote bookmark head1
996 adding remote bookmark head2
996 adding remote bookmark head2
997 new changesets 99f71071f117
997 new changesets 99f71071f117
998 updating working directory
998 updating working directory
999 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
999 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1000
1000
1001 $ hg -R share-1brev log -G
1001 $ hg -R share-1brev log -G
1002 @ changeset: 2:99f71071f117
1002 @ changeset: 2:99f71071f117
1003 | bookmark: head2
1003 | bookmark: head2
1004 | tag: tip
1004 | tag: tip
1005 | parent: 0:b5f04eac9d8f
1005 | parent: 0:b5f04eac9d8f
1006 | user: test
1006 | user: test
1007 | date: Thu Jan 01 00:00:00 1970 +0000
1007 | date: Thu Jan 01 00:00:00 1970 +0000
1008 | summary: head2
1008 | summary: head2
1009 |
1009 |
1010 | o changeset: 1:4a8dc1ab4c13
1010 | o changeset: 1:4a8dc1ab4c13
1011 |/ bookmark: head1
1011 |/ bookmark: head1
1012 | user: test
1012 | user: test
1013 | date: Thu Jan 01 00:00:00 1970 +0000
1013 | date: Thu Jan 01 00:00:00 1970 +0000
1014 | summary: head1
1014 | summary: head1
1015 |
1015 |
1016 o changeset: 0:b5f04eac9d8f
1016 o changeset: 0:b5f04eac9d8f
1017 user: test
1017 user: test
1018 date: Thu Jan 01 00:00:00 1970 +0000
1018 date: Thu Jan 01 00:00:00 1970 +0000
1019 summary: initial
1019 summary: initial
1020
1020
1021
1021
1022 Request to clone a single branch is respected in sharing mode
1022 Request to clone a single branch is respected in sharing mode
1023
1023
1024 $ hg --config share.pool=sharebranch clone -b branch1 source1b share-1bbranch1
1024 $ hg --config share.pool=sharebranch clone -b branch1 source1b share-1bbranch1
1025 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1025 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1026 adding changesets
1026 adding changesets
1027 adding manifests
1027 adding manifests
1028 adding file changes
1028 adding file changes
1029 added 2 changesets with 2 changes to 1 files
1029 added 2 changesets with 2 changes to 1 files
1030 new changesets b5f04eac9d8f:5f92a6c1a1b1
1030 new changesets b5f04eac9d8f:5f92a6c1a1b1
1031 no changes found
1031 no changes found
1032 updating working directory
1032 updating working directory
1033 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1033 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1034
1034
1035 $ hg -R share-1bbranch1 log -G
1035 $ hg -R share-1bbranch1 log -G
1036 o changeset: 1:5f92a6c1a1b1
1036 o changeset: 1:5f92a6c1a1b1
1037 | branch: branch1
1037 | branch: branch1
1038 | tag: tip
1038 | tag: tip
1039 | user: test
1039 | user: test
1040 | date: Thu Jan 01 00:00:00 1970 +0000
1040 | date: Thu Jan 01 00:00:00 1970 +0000
1041 | summary: branch1
1041 | summary: branch1
1042 |
1042 |
1043 @ changeset: 0:b5f04eac9d8f
1043 @ changeset: 0:b5f04eac9d8f
1044 user: test
1044 user: test
1045 date: Thu Jan 01 00:00:00 1970 +0000
1045 date: Thu Jan 01 00:00:00 1970 +0000
1046 summary: initial
1046 summary: initial
1047
1047
1048
1048
1049 $ hg --config share.pool=sharebranch clone -b branch2 source1b share-1bbranch2
1049 $ hg --config share.pool=sharebranch clone -b branch2 source1b share-1bbranch2
1050 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1050 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1051 searching for changes
1051 searching for changes
1052 adding changesets
1052 adding changesets
1053 adding manifests
1053 adding manifests
1054 adding file changes
1054 adding file changes
1055 added 1 changesets with 1 changes to 1 files (+1 heads)
1055 added 1 changesets with 1 changes to 1 files (+1 heads)
1056 new changesets 6bacf4683960
1056 new changesets 6bacf4683960
1057 updating working directory
1057 updating working directory
1058 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1058 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1059
1059
1060 $ hg -R share-1bbranch2 log -G
1060 $ hg -R share-1bbranch2 log -G
1061 o changeset: 2:6bacf4683960
1061 o changeset: 2:6bacf4683960
1062 | branch: branch2
1062 | branch: branch2
1063 | tag: tip
1063 | tag: tip
1064 | parent: 0:b5f04eac9d8f
1064 | parent: 0:b5f04eac9d8f
1065 | user: test
1065 | user: test
1066 | date: Thu Jan 01 00:00:00 1970 +0000
1066 | date: Thu Jan 01 00:00:00 1970 +0000
1067 | summary: branch2
1067 | summary: branch2
1068 |
1068 |
1069 | o changeset: 1:5f92a6c1a1b1
1069 | o changeset: 1:5f92a6c1a1b1
1070 |/ branch: branch1
1070 |/ branch: branch1
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: branch1
1073 | summary: branch1
1074 |
1074 |
1075 @ changeset: 0:b5f04eac9d8f
1075 @ changeset: 0:b5f04eac9d8f
1076 user: test
1076 user: test
1077 date: Thu Jan 01 00:00:00 1970 +0000
1077 date: Thu Jan 01 00:00:00 1970 +0000
1078 summary: initial
1078 summary: initial
1079
1079
1080
1080
1081 -U is respected in share clone mode
1081 -U is respected in share clone mode
1082
1082
1083 $ hg --config share.pool=share clone -U source1a share-1anowc
1083 $ hg --config share.pool=share clone -U source1a share-1anowc
1084 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1084 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1085 searching for changes
1085 searching for changes
1086 no changes found
1086 no changes found
1087 adding remote bookmark bookA
1087 adding remote bookmark bookA
1088
1088
1089 $ ls share-1anowc
1089 $ ls share-1anowc
1090
1090
1091 Test that auto sharing doesn't cause failure of "hg clone local remote"
1091 Test that auto sharing doesn't cause failure of "hg clone local remote"
1092
1092
1093 $ cd $TESTTMP
1093 $ cd $TESTTMP
1094 $ hg -R a id -r 0
1094 $ hg -R a id -r 0
1095 acb14030fe0a
1095 acb14030fe0a
1096 $ hg id -R remote -r 0
1096 $ hg id -R remote -r 0
1097 abort: repository remote not found!
1097 abort: repository remote not found!
1098 [255]
1098 [255]
1099 $ hg --config share.pool=share -q clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" a ssh://user@dummy/remote
1099 $ hg --config share.pool=share -q clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" a ssh://user@dummy/remote
1100 $ hg -R remote id -r 0
1100 $ hg -R remote id -r 0
1101 acb14030fe0a
1101 acb14030fe0a
1102
1102
1103 Cloning into pooled storage doesn't race (issue5104)
1103 Cloning into pooled storage doesn't race (issue5104)
1104
1104
1105 $ HGPOSTLOCKDELAY=2.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace1 > race1.log 2>&1 &
1105 $ HGPOSTLOCKDELAY=2.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace1 > race1.log 2>&1 &
1106 $ HGPRELOCKDELAY=1.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace2 > race2.log 2>&1
1106 $ HGPRELOCKDELAY=1.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace2 > race2.log 2>&1
1107 $ wait
1107 $ wait
1108
1108
1109 $ hg -R share-destrace1 log -r tip
1109 $ hg -R share-destrace1 log -r tip
1110 changeset: 2:e5bfe23c0b47
1110 changeset: 2:e5bfe23c0b47
1111 bookmark: bookA
1111 bookmark: bookA
1112 tag: tip
1112 tag: tip
1113 user: test
1113 user: test
1114 date: Thu Jan 01 00:00:00 1970 +0000
1114 date: Thu Jan 01 00:00:00 1970 +0000
1115 summary: 1a
1115 summary: 1a
1116
1116
1117
1117
1118 $ hg -R share-destrace2 log -r tip
1118 $ hg -R share-destrace2 log -r tip
1119 changeset: 2:e5bfe23c0b47
1119 changeset: 2:e5bfe23c0b47
1120 bookmark: bookA
1120 bookmark: bookA
1121 tag: tip
1121 tag: tip
1122 user: test
1122 user: test
1123 date: Thu Jan 01 00:00:00 1970 +0000
1123 date: Thu Jan 01 00:00:00 1970 +0000
1124 summary: 1a
1124 summary: 1a
1125
1125
1126 One repo should be new, the other should be shared from the pool. We
1126 One repo should be new, the other should be shared from the pool. We
1127 don't care which is which, so we just make sure we always print the
1127 don't care which is which, so we just make sure we always print the
1128 one containing "new pooled" first, then one one containing "existing
1128 one containing "new pooled" first, then one one containing "existing
1129 pooled".
1129 pooled".
1130
1130
1131 $ (grep 'new pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1131 $ (grep 'new pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1132 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1132 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1133 requesting all changes
1133 requesting all changes
1134 adding changesets
1134 adding changesets
1135 adding manifests
1135 adding manifests
1136 adding file changes
1136 adding file changes
1137 added 3 changesets with 3 changes to 1 files
1137 added 3 changesets with 3 changes to 1 files
1138 new changesets b5f04eac9d8f:e5bfe23c0b47
1138 new changesets b5f04eac9d8f:e5bfe23c0b47
1139 searching for changes
1139 searching for changes
1140 no changes found
1140 no changes found
1141 adding remote bookmark bookA
1141 adding remote bookmark bookA
1142 updating working directory
1142 updating working directory
1143 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1143 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1144
1144
1145 $ (grep 'existing pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1145 $ (grep 'existing pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1146 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1146 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1147 searching for changes
1147 searching for changes
1148 no changes found
1148 no changes found
1149 adding remote bookmark bookA
1149 adding remote bookmark bookA
1150 updating working directory
1150 updating working directory
1151 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1151 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1152
1152
1153 SEC: check for unsafe ssh url
1153 SEC: check for unsafe ssh url
1154
1154
1155 $ cat >> $HGRCPATH << EOF
1155 $ cat >> $HGRCPATH << EOF
1156 > [ui]
1156 > [ui]
1157 > ssh = sh -c "read l; read l; read l"
1157 > ssh = sh -c "read l; read l; read l"
1158 > EOF
1158 > EOF
1159
1159
1160 $ hg clone 'ssh://-oProxyCommand=touch${IFS}owned/path'
1160 $ hg clone 'ssh://-oProxyCommand=touch${IFS}owned/path'
1161 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1161 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1162 [255]
1162 [255]
1163 $ hg clone 'ssh://%2DoProxyCommand=touch${IFS}owned/path'
1163 $ hg clone 'ssh://%2DoProxyCommand=touch${IFS}owned/path'
1164 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1164 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1165 [255]
1165 [255]
1166 $ hg clone 'ssh://fakehost|touch%20owned/path'
1166 $ hg clone 'ssh://fakehost|touch%20owned/path'
1167 abort: no suitable response from remote hg!
1167 abort: no suitable response from remote hg!
1168 [255]
1168 [255]
1169 $ hg clone 'ssh://fakehost%7Ctouch%20owned/path'
1169 $ hg clone 'ssh://fakehost%7Ctouch%20owned/path'
1170 abort: no suitable response from remote hg!
1170 abort: no suitable response from remote hg!
1171 [255]
1171 [255]
1172
1172
1173 $ hg clone 'ssh://-oProxyCommand=touch owned%20foo@example.com/nonexistent/path'
1173 $ hg clone 'ssh://-oProxyCommand=touch owned%20foo@example.com/nonexistent/path'
1174 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned foo@example.com/nonexistent/path'
1174 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned foo@example.com/nonexistent/path'
1175 [255]
1175 [255]
1176
1176
1177 #if windows
1177 #if windows
1178 $ hg clone "ssh://%26touch%20owned%20/" --debug
1178 $ hg clone "ssh://%26touch%20owned%20/" --debug
1179 running sh -c "read l; read l; read l" "&touch owned " "hg -R . serve --stdio"
1179 running sh -c "read l; read l; read l" "&touch owned " "hg -R . serve --stdio"
1180 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1180 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1181 sending hello command
1181 sending hello command
1182 sending between command
1182 sending between command
1183 abort: no suitable response from remote hg!
1183 abort: no suitable response from remote hg!
1184 [255]
1184 [255]
1185 $ hg clone "ssh://example.com:%26touch%20owned%20/" --debug
1185 $ hg clone "ssh://example.com:%26touch%20owned%20/" --debug
1186 running sh -c "read l; read l; read l" -p "&touch owned " example.com "hg -R . serve --stdio"
1186 running sh -c "read l; read l; read l" -p "&touch owned " example.com "hg -R . serve --stdio"
1187 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1187 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1188 sending hello command
1188 sending hello command
1189 sending between command
1189 sending between command
1190 abort: no suitable response from remote hg!
1190 abort: no suitable response from remote hg!
1191 [255]
1191 [255]
1192 #else
1192 #else
1193 $ hg clone "ssh://%3btouch%20owned%20/" --debug
1193 $ hg clone "ssh://%3btouch%20owned%20/" --debug
1194 running sh -c "read l; read l; read l" ';touch owned ' 'hg -R . serve --stdio'
1194 running sh -c "read l; read l; read l" ';touch owned ' 'hg -R . serve --stdio'
1195 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1195 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1196 sending hello command
1196 sending hello command
1197 sending between command
1197 sending between command
1198 abort: no suitable response from remote hg!
1198 abort: no suitable response from remote hg!
1199 [255]
1199 [255]
1200 $ hg clone "ssh://example.com:%3btouch%20owned%20/" --debug
1200 $ hg clone "ssh://example.com:%3btouch%20owned%20/" --debug
1201 running sh -c "read l; read l; read l" -p ';touch owned ' example.com 'hg -R . serve --stdio'
1201 running sh -c "read l; read l; read l" -p ';touch owned ' example.com 'hg -R . serve --stdio'
1202 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1202 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1203 sending hello command
1203 sending hello command
1204 sending between command
1204 sending between command
1205 abort: no suitable response from remote hg!
1205 abort: no suitable response from remote hg!
1206 [255]
1206 [255]
1207 #endif
1207 #endif
1208
1208
1209 $ hg clone "ssh://v-alid.example.com/" --debug
1209 $ hg clone "ssh://v-alid.example.com/" --debug
1210 running sh -c "read l; read l; read l" v-alid\.example\.com ['"]hg -R \. serve --stdio['"] (re)
1210 running sh -c "read l; read l; read l" v-alid\.example\.com ['"]hg -R \. serve --stdio['"] (re)
1211 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1211 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1212 sending hello command
1212 sending hello command
1213 sending between command
1213 sending between command
1214 abort: no suitable response from remote hg!
1214 abort: no suitable response from remote hg!
1215 [255]
1215 [255]
1216
1216
1217 We should not have created a file named owned - if it exists, the
1217 We should not have created a file named owned - if it exists, the
1218 attack succeeded.
1218 attack succeeded.
1219 $ if test -f owned; then echo 'you got owned'; fi
1219 $ if test -f owned; then echo 'you got owned'; fi
1220
1220
1221 Cloning without fsmonitor enabled does not print a warning for small repos
1221 Cloning without fsmonitor enabled does not print a warning for small repos
1222
1222
1223 $ hg clone a fsmonitor-default
1223 $ hg clone a fsmonitor-default
1224 updating to bookmark @ on branch stable
1224 updating to bookmark @ on branch stable
1225 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1225 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1226
1226
1227 Lower the warning threshold to simulate a large repo
1227 Lower the warning threshold to simulate a large repo
1228
1228
1229 $ cat >> $HGRCPATH << EOF
1229 $ cat >> $HGRCPATH << EOF
1230 > [fsmonitor]
1230 > [fsmonitor]
1231 > warn_update_file_count = 2
1231 > warn_update_file_count = 2
1232 > EOF
1232 > EOF
1233
1233
1234 We should see a warning about no fsmonitor on supported platforms
1234 We should see a warning about no fsmonitor on supported platforms
1235
1235
1236 #if linuxormacos no-fsmonitor
1236 #if linuxormacos no-fsmonitor
1237 $ hg clone a nofsmonitor
1237 $ hg clone a nofsmonitor
1238 updating to bookmark @ on branch stable
1238 updating to bookmark @ on branch stable
1239 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor")
1239 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor")
1240 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1240 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1241 #else
1241 #else
1242 $ hg clone a nofsmonitor
1242 $ hg clone a nofsmonitor
1243 updating to bookmark @ on branch stable
1243 updating to bookmark @ on branch stable
1244 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1244 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1245 #endif
1245 #endif
1246
1246
1247 We should not see warning about fsmonitor when it is enabled
1247 We should not see warning about fsmonitor when it is enabled
1248
1248
1249 #if fsmonitor
1249 #if fsmonitor
1250 $ hg clone a fsmonitor-enabled
1250 $ hg clone a fsmonitor-enabled
1251 updating to bookmark @ on branch stable
1251 updating to bookmark @ on branch stable
1252 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1252 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1253 #endif
1253 #endif
1254
1254
1255 We can disable the fsmonitor warning
1255 We can disable the fsmonitor warning
1256
1256
1257 $ hg --config fsmonitor.warn_when_unused=false clone a fsmonitor-disable-warning
1257 $ hg --config fsmonitor.warn_when_unused=false clone a fsmonitor-disable-warning
1258 updating to bookmark @ on branch stable
1258 updating to bookmark @ on branch stable
1259 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1259 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1260
1260
1261 Loaded fsmonitor but disabled in config should still print warning
1261 Loaded fsmonitor but disabled in config should still print warning
1262
1262
1263 #if linuxormacos fsmonitor
1263 #if linuxormacos fsmonitor
1264 $ hg --config fsmonitor.mode=off clone a fsmonitor-mode-off
1264 $ hg --config fsmonitor.mode=off clone a fsmonitor-mode-off
1265 updating to bookmark @ on branch stable
1265 updating to bookmark @ on branch stable
1266 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (fsmonitor !)
1266 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (fsmonitor !)
1267 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1267 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1268 #endif
1268 #endif
1269
1269
1270 Warning not printed if working directory isn't empty
1270 Warning not printed if working directory isn't empty
1271
1271
1272 $ hg -q clone a fsmonitor-update
1272 $ hg -q clone a fsmonitor-update
1273 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (?)
1273 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (?)
1274 $ cd fsmonitor-update
1274 $ cd fsmonitor-update
1275 $ hg up acb14030fe0a
1275 $ hg up acb14030fe0a
1276 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1276 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1277 (leaving bookmark @)
1277 (leaving bookmark @)
1278 $ hg up cf0fe1914066
1278 $ hg up cf0fe1914066
1279 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1279 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1280
1280
1281 `hg update` from null revision also prints
1281 `hg update` from null revision also prints
1282
1282
1283 $ hg up null
1283 $ hg up null
1284 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1284 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1285
1285
1286 #if linuxormacos no-fsmonitor
1286 #if linuxormacos no-fsmonitor
1287 $ hg up cf0fe1914066
1287 $ hg up cf0fe1914066
1288 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor")
1288 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor")
1289 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1289 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1290 #else
1290 #else
1291 $ hg up cf0fe1914066
1291 $ hg up cf0fe1914066
1292 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1292 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1293 #endif
1293 #endif
1294
1294
1295 $ cd ..
1295 $ cd ..
1296
1296
@@ -1,619 +1,619 b''
1 $ cat << EOF >> $HGRCPATH
1 $ cat << EOF >> $HGRCPATH
2 > [ui]
2 > [ui]
3 > interactive=yes
3 > interactive=yes
4 > EOF
4 > EOF
5
5
6 $ hg init debugrevlog
6 $ hg init debugrevlog
7 $ cd debugrevlog
7 $ cd debugrevlog
8 $ echo a > a
8 $ echo a > a
9 $ hg ci -Am adda
9 $ hg ci -Am adda
10 adding a
10 adding a
11 $ hg rm .
11 $ hg rm .
12 removing a
12 removing a
13 $ hg ci -Am make-it-empty
13 $ hg ci -Am make-it-empty
14 $ hg revert --all -r 0
14 $ hg revert --all -r 0
15 adding a
15 adding a
16 $ hg ci -Am make-it-full
16 $ hg ci -Am make-it-full
17 #if reporevlogstore
17 #if reporevlogstore
18 $ hg debugrevlog -c
18 $ hg debugrevlog -c
19 format : 1
19 format : 1
20 flags : inline
20 flags : inline
21
21
22 revisions : 3
22 revisions : 3
23 merges : 0 ( 0.00%)
23 merges : 0 ( 0.00%)
24 normal : 3 (100.00%)
24 normal : 3 (100.00%)
25 revisions : 3
25 revisions : 3
26 empty : 0 ( 0.00%)
26 empty : 0 ( 0.00%)
27 text : 0 (100.00%)
27 text : 0 (100.00%)
28 delta : 0 (100.00%)
28 delta : 0 (100.00%)
29 snapshot : 3 (100.00%)
29 snapshot : 3 (100.00%)
30 lvl-0 : 3 (100.00%)
30 lvl-0 : 3 (100.00%)
31 deltas : 0 ( 0.00%)
31 deltas : 0 ( 0.00%)
32 revision size : 191
32 revision size : 191
33 snapshot : 191 (100.00%)
33 snapshot : 191 (100.00%)
34 lvl-0 : 191 (100.00%)
34 lvl-0 : 191 (100.00%)
35 deltas : 0 ( 0.00%)
35 deltas : 0 ( 0.00%)
36
36
37 chunks : 3
37 chunks : 3
38 0x75 (u) : 3 (100.00%)
38 0x75 (u) : 3 (100.00%)
39 chunks size : 191
39 chunks size : 191
40 0x75 (u) : 191 (100.00%)
40 0x75 (u) : 191 (100.00%)
41
41
42 avg chain length : 0
42 avg chain length : 0
43 max chain length : 0
43 max chain length : 0
44 max chain reach : 67
44 max chain reach : 67
45 compression ratio : 0
45 compression ratio : 0
46
46
47 uncompressed data size (min/max/avg) : 57 / 66 / 62
47 uncompressed data size (min/max/avg) : 57 / 66 / 62
48 full revision size (min/max/avg) : 58 / 67 / 63
48 full revision size (min/max/avg) : 58 / 67 / 63
49 inter-snapshot size (min/max/avg) : 0 / 0 / 0
49 inter-snapshot size (min/max/avg) : 0 / 0 / 0
50 delta size (min/max/avg) : 0 / 0 / 0
50 delta size (min/max/avg) : 0 / 0 / 0
51 $ hg debugrevlog -m
51 $ hg debugrevlog -m
52 format : 1
52 format : 1
53 flags : inline, generaldelta
53 flags : inline, generaldelta
54
54
55 revisions : 3
55 revisions : 3
56 merges : 0 ( 0.00%)
56 merges : 0 ( 0.00%)
57 normal : 3 (100.00%)
57 normal : 3 (100.00%)
58 revisions : 3
58 revisions : 3
59 empty : 1 (33.33%)
59 empty : 1 (33.33%)
60 text : 1 (100.00%)
60 text : 1 (100.00%)
61 delta : 0 ( 0.00%)
61 delta : 0 ( 0.00%)
62 snapshot : 2 (66.67%)
62 snapshot : 2 (66.67%)
63 lvl-0 : 2 (66.67%)
63 lvl-0 : 2 (66.67%)
64 deltas : 0 ( 0.00%)
64 deltas : 0 ( 0.00%)
65 revision size : 88
65 revision size : 88
66 snapshot : 88 (100.00%)
66 snapshot : 88 (100.00%)
67 lvl-0 : 88 (100.00%)
67 lvl-0 : 88 (100.00%)
68 deltas : 0 ( 0.00%)
68 deltas : 0 ( 0.00%)
69
69
70 chunks : 3
70 chunks : 3
71 empty : 1 (33.33%)
71 empty : 1 (33.33%)
72 0x75 (u) : 2 (66.67%)
72 0x75 (u) : 2 (66.67%)
73 chunks size : 88
73 chunks size : 88
74 empty : 0 ( 0.00%)
74 empty : 0 ( 0.00%)
75 0x75 (u) : 88 (100.00%)
75 0x75 (u) : 88 (100.00%)
76
76
77 avg chain length : 0
77 avg chain length : 0
78 max chain length : 0
78 max chain length : 0
79 max chain reach : 44
79 max chain reach : 44
80 compression ratio : 0
80 compression ratio : 0
81
81
82 uncompressed data size (min/max/avg) : 0 / 43 / 28
82 uncompressed data size (min/max/avg) : 0 / 43 / 28
83 full revision size (min/max/avg) : 44 / 44 / 44
83 full revision size (min/max/avg) : 44 / 44 / 44
84 inter-snapshot size (min/max/avg) : 0 / 0 / 0
84 inter-snapshot size (min/max/avg) : 0 / 0 / 0
85 delta size (min/max/avg) : 0 / 0 / 0
85 delta size (min/max/avg) : 0 / 0 / 0
86 $ hg debugrevlog a
86 $ hg debugrevlog a
87 format : 1
87 format : 1
88 flags : inline, generaldelta
88 flags : inline, generaldelta
89
89
90 revisions : 1
90 revisions : 1
91 merges : 0 ( 0.00%)
91 merges : 0 ( 0.00%)
92 normal : 1 (100.00%)
92 normal : 1 (100.00%)
93 revisions : 1
93 revisions : 1
94 empty : 0 ( 0.00%)
94 empty : 0 ( 0.00%)
95 text : 0 (100.00%)
95 text : 0 (100.00%)
96 delta : 0 (100.00%)
96 delta : 0 (100.00%)
97 snapshot : 1 (100.00%)
97 snapshot : 1 (100.00%)
98 lvl-0 : 1 (100.00%)
98 lvl-0 : 1 (100.00%)
99 deltas : 0 ( 0.00%)
99 deltas : 0 ( 0.00%)
100 revision size : 3
100 revision size : 3
101 snapshot : 3 (100.00%)
101 snapshot : 3 (100.00%)
102 lvl-0 : 3 (100.00%)
102 lvl-0 : 3 (100.00%)
103 deltas : 0 ( 0.00%)
103 deltas : 0 ( 0.00%)
104
104
105 chunks : 1
105 chunks : 1
106 0x75 (u) : 1 (100.00%)
106 0x75 (u) : 1 (100.00%)
107 chunks size : 3
107 chunks size : 3
108 0x75 (u) : 3 (100.00%)
108 0x75 (u) : 3 (100.00%)
109
109
110 avg chain length : 0
110 avg chain length : 0
111 max chain length : 0
111 max chain length : 0
112 max chain reach : 3
112 max chain reach : 3
113 compression ratio : 0
113 compression ratio : 0
114
114
115 uncompressed data size (min/max/avg) : 2 / 2 / 2
115 uncompressed data size (min/max/avg) : 2 / 2 / 2
116 full revision size (min/max/avg) : 3 / 3 / 3
116 full revision size (min/max/avg) : 3 / 3 / 3
117 inter-snapshot size (min/max/avg) : 0 / 0 / 0
117 inter-snapshot size (min/max/avg) : 0 / 0 / 0
118 delta size (min/max/avg) : 0 / 0 / 0
118 delta size (min/max/avg) : 0 / 0 / 0
119 #endif
119 #endif
120
120
121 Test debugindex, with and without the --verbose/--debug flag
121 Test debugindex, with and without the --verbose/--debug flag
122 $ hg debugrevlogindex a
122 $ hg debugrevlogindex a
123 rev linkrev nodeid p1 p2
123 rev linkrev nodeid p1 p2
124 0 0 b789fdd96dc2 000000000000 000000000000
124 0 0 b789fdd96dc2 000000000000 000000000000
125
125
126 #if no-reposimplestore
126 #if no-reposimplestore
127 $ hg --verbose debugrevlogindex a
127 $ hg --verbose debugrevlogindex a
128 rev offset length linkrev nodeid p1 p2
128 rev offset length linkrev nodeid p1 p2
129 0 0 3 0 b789fdd96dc2 000000000000 000000000000
129 0 0 3 0 b789fdd96dc2 000000000000 000000000000
130
130
131 $ hg --debug debugrevlogindex a
131 $ hg --debug debugrevlogindex a
132 rev offset length linkrev nodeid p1 p2
132 rev offset length linkrev nodeid p1 p2
133 0 0 3 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
133 0 0 3 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
134 #endif
134 #endif
135
135
136 $ hg debugrevlogindex -f 1 a
136 $ hg debugrevlogindex -f 1 a
137 rev flag size link p1 p2 nodeid
137 rev flag size link p1 p2 nodeid
138 0 0000 2 0 -1 -1 b789fdd96dc2
138 0 0000 2 0 -1 -1 b789fdd96dc2
139
139
140 #if no-reposimplestore
140 #if no-reposimplestore
141 $ hg --verbose debugrevlogindex -f 1 a
141 $ hg --verbose debugrevlogindex -f 1 a
142 rev flag offset length size link p1 p2 nodeid
142 rev flag offset length size link p1 p2 nodeid
143 0 0000 0 3 2 0 -1 -1 b789fdd96dc2
143 0 0000 0 3 2 0 -1 -1 b789fdd96dc2
144
144
145 $ hg --debug debugrevlogindex -f 1 a
145 $ hg --debug debugrevlogindex -f 1 a
146 rev flag offset length size link p1 p2 nodeid
146 rev flag offset length size link p1 p2 nodeid
147 0 0000 0 3 2 0 -1 -1 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
147 0 0000 0 3 2 0 -1 -1 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
148 #endif
148 #endif
149
149
150 $ hg debugindex -c
150 $ hg debugindex -c
151 rev linkrev nodeid p1 p2
151 rev linkrev nodeid p1 p2
152 0 0 07f494440405 000000000000 000000000000
152 0 0 07f494440405 000000000000 000000000000
153 1 1 8cccb4b5fec2 07f494440405 000000000000
153 1 1 8cccb4b5fec2 07f494440405 000000000000
154 2 2 b1e228c512c5 8cccb4b5fec2 000000000000
154 2 2 b1e228c512c5 8cccb4b5fec2 000000000000
155 $ hg debugindex -c --debug
155 $ hg debugindex -c --debug
156 rev linkrev nodeid p1 p2
156 rev linkrev nodeid p1 p2
157 0 0 07f4944404050f47db2e5c5071e0e84e7a27bba9 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
157 0 0 07f4944404050f47db2e5c5071e0e84e7a27bba9 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
158 1 1 8cccb4b5fec20cafeb99dd01c26d4dee8ea4388a 07f4944404050f47db2e5c5071e0e84e7a27bba9 0000000000000000000000000000000000000000
158 1 1 8cccb4b5fec20cafeb99dd01c26d4dee8ea4388a 07f4944404050f47db2e5c5071e0e84e7a27bba9 0000000000000000000000000000000000000000
159 2 2 b1e228c512c5d7066d70562ed839c3323a62d6d2 8cccb4b5fec20cafeb99dd01c26d4dee8ea4388a 0000000000000000000000000000000000000000
159 2 2 b1e228c512c5d7066d70562ed839c3323a62d6d2 8cccb4b5fec20cafeb99dd01c26d4dee8ea4388a 0000000000000000000000000000000000000000
160 $ hg debugindex -m
160 $ hg debugindex -m
161 rev linkrev nodeid p1 p2
161 rev linkrev nodeid p1 p2
162 0 0 a0c8bcbbb45c 000000000000 000000000000
162 0 0 a0c8bcbbb45c 000000000000 000000000000
163 1 1 57faf8a737ae a0c8bcbbb45c 000000000000
163 1 1 57faf8a737ae a0c8bcbbb45c 000000000000
164 2 2 a35b10320954 57faf8a737ae 000000000000
164 2 2 a35b10320954 57faf8a737ae 000000000000
165 $ hg debugindex -m --debug
165 $ hg debugindex -m --debug
166 rev linkrev nodeid p1 p2
166 rev linkrev nodeid p1 p2
167 0 0 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
167 0 0 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
168 1 1 57faf8a737ae7faf490582941a82319ba6529dca a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 0000000000000000000000000000000000000000
168 1 1 57faf8a737ae7faf490582941a82319ba6529dca a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 0000000000000000000000000000000000000000
169 2 2 a35b103209548032201c16c7688cb2657f037a38 57faf8a737ae7faf490582941a82319ba6529dca 0000000000000000000000000000000000000000
169 2 2 a35b103209548032201c16c7688cb2657f037a38 57faf8a737ae7faf490582941a82319ba6529dca 0000000000000000000000000000000000000000
170 $ hg debugindex a
170 $ hg debugindex a
171 rev linkrev nodeid p1 p2
171 rev linkrev nodeid p1 p2
172 0 0 b789fdd96dc2 000000000000 000000000000
172 0 0 b789fdd96dc2 000000000000 000000000000
173 $ hg debugindex --debug a
173 $ hg debugindex --debug a
174 rev linkrev nodeid p1 p2
174 rev linkrev nodeid p1 p2
175 0 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
175 0 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
176
176
177 debugdelta chain basic output
177 debugdelta chain basic output
178
178
179 #if reporevlogstore
179 #if reporevlogstore
180 $ hg debugdeltachain -m
180 $ hg debugdeltachain -m
181 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
181 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
182 0 1 1 -1 base 44 43 44 1.02326 44 0 0.00000
182 0 1 1 -1 base 44 43 44 1.02326 44 0 0.00000
183 1 2 1 -1 base 0 0 0 0.00000 0 0 0.00000
183 1 2 1 -1 base 0 0 0 0.00000 0 0 0.00000
184 2 3 1 -1 base 44 43 44 1.02326 44 0 0.00000
184 2 3 1 -1 base 44 43 44 1.02326 44 0 0.00000
185
185
186 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen}\n'
186 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen}\n'
187 0 1 1
187 0 1 1
188 1 2 1
188 1 2 1
189 2 3 1
189 2 3 1
190
190
191 $ hg debugdeltachain -m -Tjson
191 $ hg debugdeltachain -m -Tjson
192 [
192 [
193 {
193 {
194 "chainid": 1,
194 "chainid": 1,
195 "chainlen": 1,
195 "chainlen": 1,
196 "chainratio": 1.02325581395,
196 "chainratio": 1.02325581395,
197 "chainsize": 44,
197 "chainsize": 44,
198 "compsize": 44,
198 "compsize": 44,
199 "deltatype": "base",
199 "deltatype": "base",
200 "extradist": 0,
200 "extradist": 0,
201 "extraratio": 0.0,
201 "extraratio": 0.0,
202 "lindist": 44,
202 "lindist": 44,
203 "prevrev": -1,
203 "prevrev": -1,
204 "rev": 0,
204 "rev": 0,
205 "uncompsize": 43
205 "uncompsize": 43
206 },
206 },
207 {
207 {
208 "chainid": 2,
208 "chainid": 2,
209 "chainlen": 1,
209 "chainlen": 1,
210 "chainratio": 0,
210 "chainratio": 0,
211 "chainsize": 0,
211 "chainsize": 0,
212 "compsize": 0,
212 "compsize": 0,
213 "deltatype": "base",
213 "deltatype": "base",
214 "extradist": 0,
214 "extradist": 0,
215 "extraratio": 0,
215 "extraratio": 0,
216 "lindist": 0,
216 "lindist": 0,
217 "prevrev": -1,
217 "prevrev": -1,
218 "rev": 1,
218 "rev": 1,
219 "uncompsize": 0
219 "uncompsize": 0
220 },
220 },
221 {
221 {
222 "chainid": 3,
222 "chainid": 3,
223 "chainlen": 1,
223 "chainlen": 1,
224 "chainratio": 1.02325581395,
224 "chainratio": 1.02325581395,
225 "chainsize": 44,
225 "chainsize": 44,
226 "compsize": 44,
226 "compsize": 44,
227 "deltatype": "base",
227 "deltatype": "base",
228 "extradist": 0,
228 "extradist": 0,
229 "extraratio": 0.0,
229 "extraratio": 0.0,
230 "lindist": 44,
230 "lindist": 44,
231 "prevrev": -1,
231 "prevrev": -1,
232 "rev": 2,
232 "rev": 2,
233 "uncompsize": 43
233 "uncompsize": 43
234 }
234 }
235 ]
235 ]
236
236
237 debugdelta chain with sparse read enabled
237 debugdelta chain with sparse read enabled
238
238
239 $ cat >> $HGRCPATH <<EOF
239 $ cat >> $HGRCPATH <<EOF
240 > [experimental]
240 > [experimental]
241 > sparse-read = True
241 > sparse-read = True
242 > EOF
242 > EOF
243 $ hg debugdeltachain -m
243 $ hg debugdeltachain -m
244 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
244 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
245 0 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
245 0 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
246 1 2 1 -1 base 0 0 0 0.00000 0 0 0.00000 0 0 1.00000 1
246 1 2 1 -1 base 0 0 0 0.00000 0 0 0.00000 0 0 1.00000 1
247 2 3 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
247 2 3 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
248
248
249 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen} {readsize} {largestblock} {readdensity}\n'
249 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen} {readsize} {largestblock} {readdensity}\n'
250 0 1 1 44 44 1.0
250 0 1 1 44 44 1.0
251 1 2 1 0 0 1
251 1 2 1 0 0 1
252 2 3 1 44 44 1.0
252 2 3 1 44 44 1.0
253
253
254 $ hg debugdeltachain -m -Tjson
254 $ hg debugdeltachain -m -Tjson
255 [
255 [
256 {
256 {
257 "chainid": 1,
257 "chainid": 1,
258 "chainlen": 1,
258 "chainlen": 1,
259 "chainratio": 1.02325581395,
259 "chainratio": 1.02325581395,
260 "chainsize": 44,
260 "chainsize": 44,
261 "compsize": 44,
261 "compsize": 44,
262 "deltatype": "base",
262 "deltatype": "base",
263 "extradist": 0,
263 "extradist": 0,
264 "extraratio": 0.0,
264 "extraratio": 0.0,
265 "largestblock": 44,
265 "largestblock": 44,
266 "lindist": 44,
266 "lindist": 44,
267 "prevrev": -1,
267 "prevrev": -1,
268 "readdensity": 1.0,
268 "readdensity": 1.0,
269 "readsize": 44,
269 "readsize": 44,
270 "rev": 0,
270 "rev": 0,
271 "srchunks": 1,
271 "srchunks": 1,
272 "uncompsize": 43
272 "uncompsize": 43
273 },
273 },
274 {
274 {
275 "chainid": 2,
275 "chainid": 2,
276 "chainlen": 1,
276 "chainlen": 1,
277 "chainratio": 0,
277 "chainratio": 0,
278 "chainsize": 0,
278 "chainsize": 0,
279 "compsize": 0,
279 "compsize": 0,
280 "deltatype": "base",
280 "deltatype": "base",
281 "extradist": 0,
281 "extradist": 0,
282 "extraratio": 0,
282 "extraratio": 0,
283 "largestblock": 0,
283 "largestblock": 0,
284 "lindist": 0,
284 "lindist": 0,
285 "prevrev": -1,
285 "prevrev": -1,
286 "readdensity": 1,
286 "readdensity": 1,
287 "readsize": 0,
287 "readsize": 0,
288 "rev": 1,
288 "rev": 1,
289 "srchunks": 1,
289 "srchunks": 1,
290 "uncompsize": 0
290 "uncompsize": 0
291 },
291 },
292 {
292 {
293 "chainid": 3,
293 "chainid": 3,
294 "chainlen": 1,
294 "chainlen": 1,
295 "chainratio": 1.02325581395,
295 "chainratio": 1.02325581395,
296 "chainsize": 44,
296 "chainsize": 44,
297 "compsize": 44,
297 "compsize": 44,
298 "deltatype": "base",
298 "deltatype": "base",
299 "extradist": 0,
299 "extradist": 0,
300 "extraratio": 0.0,
300 "extraratio": 0.0,
301 "largestblock": 44,
301 "largestblock": 44,
302 "lindist": 44,
302 "lindist": 44,
303 "prevrev": -1,
303 "prevrev": -1,
304 "readdensity": 1.0,
304 "readdensity": 1.0,
305 "readsize": 44,
305 "readsize": 44,
306 "rev": 2,
306 "rev": 2,
307 "srchunks": 1,
307 "srchunks": 1,
308 "uncompsize": 43
308 "uncompsize": 43
309 }
309 }
310 ]
310 ]
311
311
312 $ printf "This test checks things.\n" >> a
312 $ printf "This test checks things.\n" >> a
313 $ hg ci -m a
313 $ hg ci -m a
314 $ hg branch other
314 $ hg branch other
315 marked working directory as branch other
315 marked working directory as branch other
316 (branches are permanent and global, did you want a bookmark?)
316 (branches are permanent and global, did you want a bookmark?)
317 $ for i in `$TESTDIR/seq.py 5`; do
317 $ for i in `$TESTDIR/seq.py 5`; do
318 > printf "shorter ${i}" >> a
318 > printf "shorter ${i}" >> a
319 > hg ci -m "a other:$i"
319 > hg ci -m "a other:$i"
320 > hg up -q default
320 > hg up -q default
321 > printf "for the branch default we want longer chains: ${i}" >> a
321 > printf "for the branch default we want longer chains: ${i}" >> a
322 > hg ci -m "a default:$i"
322 > hg ci -m "a default:$i"
323 > hg up -q other
323 > hg up -q other
324 > done
324 > done
325 $ hg debugdeltachain a -T '{rev} {srchunks}\n' \
325 $ hg debugdeltachain a -T '{rev} {srchunks}\n' \
326 > --config experimental.sparse-read.density-threshold=0.50 \
326 > --config experimental.sparse-read.density-threshold=0.50 \
327 > --config experimental.sparse-read.min-gap-size=0
327 > --config experimental.sparse-read.min-gap-size=0
328 0 1
328 0 1
329 1 1
329 1 1
330 2 1
330 2 1
331 3 1
331 3 1
332 4 1
332 4 1
333 5 1
333 5 1
334 6 1
334 6 1
335 7 1
335 7 1
336 8 1
336 8 1
337 9 1
337 9 1
338 10 2
338 10 2
339 11 1
339 11 1
340 $ hg --config extensions.strip= strip --no-backup -r 1
340 $ hg --config extensions.strip= strip --no-backup -r 1
341 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
341 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
342
342
343 Test max chain len
343 Test max chain len
344 $ cat >> $HGRCPATH << EOF
344 $ cat >> $HGRCPATH << EOF
345 > [format]
345 > [format]
346 > maxchainlen=4
346 > maxchainlen=4
347 > EOF
347 > EOF
348
348
349 $ printf "This test checks if maxchainlen config value is respected also it can serve as basic test for debugrevlog -d <file>.\n" >> a
349 $ printf "This test checks if maxchainlen config value is respected also it can serve as basic test for debugrevlog -d <file>.\n" >> a
350 $ hg ci -m a
350 $ hg ci -m a
351 $ printf "b\n" >> a
351 $ printf "b\n" >> a
352 $ hg ci -m a
352 $ hg ci -m a
353 $ printf "c\n" >> a
353 $ printf "c\n" >> a
354 $ hg ci -m a
354 $ hg ci -m a
355 $ printf "d\n" >> a
355 $ printf "d\n" >> a
356 $ hg ci -m a
356 $ hg ci -m a
357 $ printf "e\n" >> a
357 $ printf "e\n" >> a
358 $ hg ci -m a
358 $ hg ci -m a
359 $ printf "f\n" >> a
359 $ printf "f\n" >> a
360 $ hg ci -m a
360 $ hg ci -m a
361 $ printf 'g\n' >> a
361 $ printf 'g\n' >> a
362 $ hg ci -m a
362 $ hg ci -m a
363 $ printf 'h\n' >> a
363 $ printf 'h\n' >> a
364 $ hg ci -m a
364 $ hg ci -m a
365
365
366 $ hg debugrevlog -d a
366 $ hg debugrevlog -d a
367 # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen
367 # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen
368 0 -1 -1 0 ??? 0 0 0 0 ??? ???? ? 1 0 (glob)
368 0 -1 -1 0 ??? 0 0 0 0 ??? ???? ? 1 0 (glob)
369 1 0 -1 ??? ??? 0 0 0 0 ??? ???? ? 1 1 (glob)
369 1 0 -1 ??? ??? 0 0 0 0 ??? ???? ? 1 1 (glob)
370 2 1 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
370 2 1 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
371 3 2 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
371 3 2 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
372 4 3 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 4 (glob)
372 4 3 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 4 (glob)
373 5 4 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 0 (glob)
373 5 4 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 0 (glob)
374 6 5 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 1 (glob)
374 6 5 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 1 (glob)
375 7 6 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
375 7 6 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
376 8 7 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
376 8 7 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
377 #endif
377 #endif
378
378
379 Test debuglocks command:
379 Test debuglocks command:
380
380
381 $ hg debuglocks
381 $ hg debuglocks
382 lock: free
382 lock: free
383 wlock: free
383 wlock: free
384
384
385 * Test setting the lock
385 * Test setting the lock
386
386
387 waitlock <file> will wait for file to be created. If it isn't in a reasonable
387 waitlock <file> will wait for file to be created. If it isn't in a reasonable
388 amount of time, displays error message and returns 1
388 amount of time, displays error message and returns 1
389 $ waitlock() {
389 $ waitlock() {
390 > start=`date +%s`
390 > start=`date +%s`
391 > timeout=5
391 > timeout=5
392 > while [ \( ! -f $1 \) -a \( ! -L $1 \) ]; do
392 > while [ \( ! -f $1 \) -a \( ! -L $1 \) ]; do
393 > now=`date +%s`
393 > now=`date +%s`
394 > if [ "`expr $now - $start`" -gt $timeout ]; then
394 > if [ "`expr $now - $start`" -gt $timeout ]; then
395 > echo "timeout: $1 was not created in $timeout seconds"
395 > echo "timeout: $1 was not created in $timeout seconds"
396 > return 1
396 > return 1
397 > fi
397 > fi
398 > sleep 0.1
398 > sleep 0.1
399 > done
399 > done
400 > }
400 > }
401 $ dolock() {
401 $ dolock() {
402 > {
402 > {
403 > waitlock .hg/unlock
403 > waitlock .hg/unlock
404 > rm -f .hg/unlock
404 > rm -f .hg/unlock
405 > echo y
405 > echo y
406 > } | hg debuglocks "$@" > /dev/null
406 > } | hg debuglocks "$@" > /dev/null
407 > }
407 > }
408 $ dolock -s &
408 $ dolock -s &
409 $ waitlock .hg/store/lock
409 $ waitlock .hg/store/lock
410
410
411 $ hg debuglocks
411 $ hg debuglocks
412 lock: user *, process * (*s) (glob)
412 lock: user *, process * (*s) (glob)
413 wlock: free
413 wlock: free
414 [1]
414 [1]
415 $ touch .hg/unlock
415 $ touch .hg/unlock
416 $ wait
416 $ wait
417 $ [ -f .hg/store/lock ] || echo "There is no lock"
417 $ [ -f .hg/store/lock ] || echo "There is no lock"
418 There is no lock
418 There is no lock
419
419
420 * Test setting the wlock
420 * Test setting the wlock
421
421
422 $ dolock -S &
422 $ dolock -S &
423 $ waitlock .hg/wlock
423 $ waitlock .hg/wlock
424
424
425 $ hg debuglocks
425 $ hg debuglocks
426 lock: free
426 lock: free
427 wlock: user *, process * (*s) (glob)
427 wlock: user *, process * (*s) (glob)
428 [1]
428 [1]
429 $ touch .hg/unlock
429 $ touch .hg/unlock
430 $ wait
430 $ wait
431 $ [ -f .hg/wlock ] || echo "There is no wlock"
431 $ [ -f .hg/wlock ] || echo "There is no wlock"
432 There is no wlock
432 There is no wlock
433
433
434 * Test setting both locks
434 * Test setting both locks
435
435
436 $ dolock -Ss &
436 $ dolock -Ss &
437 $ waitlock .hg/wlock && waitlock .hg/store/lock
437 $ waitlock .hg/wlock && waitlock .hg/store/lock
438
438
439 $ hg debuglocks
439 $ hg debuglocks
440 lock: user *, process * (*s) (glob)
440 lock: user *, process * (*s) (glob)
441 wlock: user *, process * (*s) (glob)
441 wlock: user *, process * (*s) (glob)
442 [2]
442 [2]
443
443
444 * Test failing to set a lock
444 * Test failing to set a lock
445
445
446 $ hg debuglocks -s
446 $ hg debuglocks -s
447 abort: lock is already held
447 abort: lock is already held
448 [255]
448 [255]
449
449
450 $ hg debuglocks -S
450 $ hg debuglocks -S
451 abort: wlock is already held
451 abort: wlock is already held
452 [255]
452 [255]
453
453
454 $ touch .hg/unlock
454 $ touch .hg/unlock
455 $ wait
455 $ wait
456
456
457 $ hg debuglocks
457 $ hg debuglocks
458 lock: free
458 lock: free
459 wlock: free
459 wlock: free
460
460
461 * Test forcing the lock
461 * Test forcing the lock
462
462
463 $ dolock -s &
463 $ dolock -s &
464 $ waitlock .hg/store/lock
464 $ waitlock .hg/store/lock
465
465
466 $ hg debuglocks
466 $ hg debuglocks
467 lock: user *, process * (*s) (glob)
467 lock: user *, process * (*s) (glob)
468 wlock: free
468 wlock: free
469 [1]
469 [1]
470
470
471 $ hg debuglocks -L
471 $ hg debuglocks -L
472
472
473 $ hg debuglocks
473 $ hg debuglocks
474 lock: free
474 lock: free
475 wlock: free
475 wlock: free
476
476
477 $ touch .hg/unlock
477 $ touch .hg/unlock
478 $ wait
478 $ wait
479
479
480 * Test forcing the wlock
480 * Test forcing the wlock
481
481
482 $ dolock -S &
482 $ dolock -S &
483 $ waitlock .hg/wlock
483 $ waitlock .hg/wlock
484
484
485 $ hg debuglocks
485 $ hg debuglocks
486 lock: free
486 lock: free
487 wlock: user *, process * (*s) (glob)
487 wlock: user *, process * (*s) (glob)
488 [1]
488 [1]
489
489
490 $ hg debuglocks -W
490 $ hg debuglocks -W
491
491
492 $ hg debuglocks
492 $ hg debuglocks
493 lock: free
493 lock: free
494 wlock: free
494 wlock: free
495
495
496 $ touch .hg/unlock
496 $ touch .hg/unlock
497 $ wait
497 $ wait
498
498
499 Test WdirUnsupported exception
499 Test WdirUnsupported exception
500
500
501 $ hg debugdata -c ffffffffffffffffffffffffffffffffffffffff
501 $ hg debugdata -c ffffffffffffffffffffffffffffffffffffffff
502 abort: working directory revision cannot be specified
502 abort: working directory revision cannot be specified
503 [255]
503 [255]
504
504
505 Test cache warming command
505 Test cache warming command
506
506
507 $ rm -rf .hg/cache/
507 $ rm -rf .hg/cache/
508 $ hg debugupdatecaches --debug
508 $ hg debugupdatecaches --debug
509 updating the branch cache
509 updating the branch cache
510 $ ls -r .hg/cache/*
510 $ ls -r .hg/cache/*
511 .hg/cache/rbc-revs-v1
511 .hg/cache/rbc-revs-v1
512 .hg/cache/rbc-names-v1
512 .hg/cache/rbc-names-v1
513 .hg/cache/manifestfulltextcache
513 .hg/cache/manifestfulltextcache (reporevlogstore !)
514 .hg/cache/branch2-served
514 .hg/cache/branch2-served
515
515
516 Test debugcolor
516 Test debugcolor
517
517
518 #if no-windows
518 #if no-windows
519 $ hg debugcolor --style --color always | egrep 'mode|style|log\.'
519 $ hg debugcolor --style --color always | egrep 'mode|style|log\.'
520 color mode: 'ansi'
520 color mode: 'ansi'
521 available style:
521 available style:
522 \x1b[0;33mlog.changeset\x1b[0m: \x1b[0;33myellow\x1b[0m (esc)
522 \x1b[0;33mlog.changeset\x1b[0m: \x1b[0;33myellow\x1b[0m (esc)
523 #endif
523 #endif
524
524
525 $ hg debugcolor --style --color never
525 $ hg debugcolor --style --color never
526 color mode: None
526 color mode: None
527 available style:
527 available style:
528
528
529 $ cd ..
529 $ cd ..
530
530
531 Test internal debugstacktrace command
531 Test internal debugstacktrace command
532
532
533 $ cat > debugstacktrace.py << EOF
533 $ cat > debugstacktrace.py << EOF
534 > from __future__ import absolute_import
534 > from __future__ import absolute_import
535 > import sys
535 > import sys
536 > from mercurial import util
536 > from mercurial import util
537 > def f():
537 > def f():
538 > util.debugstacktrace(f=sys.stdout)
538 > util.debugstacktrace(f=sys.stdout)
539 > g()
539 > g()
540 > def g():
540 > def g():
541 > util.dst('hello from g\\n', skip=1)
541 > util.dst('hello from g\\n', skip=1)
542 > h()
542 > h()
543 > def h():
543 > def h():
544 > util.dst('hi ...\\nfrom h hidden in g', 1, depth=2)
544 > util.dst('hi ...\\nfrom h hidden in g', 1, depth=2)
545 > f()
545 > f()
546 > EOF
546 > EOF
547 $ $PYTHON debugstacktrace.py
547 $ $PYTHON debugstacktrace.py
548 stacktrace at:
548 stacktrace at:
549 debugstacktrace.py:12 in * (glob)
549 debugstacktrace.py:12 in * (glob)
550 debugstacktrace.py:5 in f
550 debugstacktrace.py:5 in f
551 hello from g at:
551 hello from g at:
552 debugstacktrace.py:12 in * (glob)
552 debugstacktrace.py:12 in * (glob)
553 debugstacktrace.py:6 in f
553 debugstacktrace.py:6 in f
554 hi ...
554 hi ...
555 from h hidden in g at:
555 from h hidden in g at:
556 debugstacktrace.py:6 in f
556 debugstacktrace.py:6 in f
557 debugstacktrace.py:9 in g
557 debugstacktrace.py:9 in g
558
558
559 Test debugcapabilities command:
559 Test debugcapabilities command:
560
560
561 $ hg debugcapabilities ./debugrevlog/
561 $ hg debugcapabilities ./debugrevlog/
562 Main capabilities:
562 Main capabilities:
563 branchmap
563 branchmap
564 $USUAL_BUNDLE2_CAPS$
564 $USUAL_BUNDLE2_CAPS$
565 getbundle
565 getbundle
566 known
566 known
567 lookup
567 lookup
568 pushkey
568 pushkey
569 unbundle
569 unbundle
570 Bundle2 capabilities:
570 Bundle2 capabilities:
571 HG20
571 HG20
572 bookmarks
572 bookmarks
573 changegroup
573 changegroup
574 01
574 01
575 02
575 02
576 digests
576 digests
577 md5
577 md5
578 sha1
578 sha1
579 sha512
579 sha512
580 error
580 error
581 abort
581 abort
582 unsupportedcontent
582 unsupportedcontent
583 pushraced
583 pushraced
584 pushkey
584 pushkey
585 hgtagsfnodes
585 hgtagsfnodes
586 listkeys
586 listkeys
587 phases
587 phases
588 heads
588 heads
589 pushkey
589 pushkey
590 remote-changegroup
590 remote-changegroup
591 http
591 http
592 https
592 https
593 rev-branch-cache
593 rev-branch-cache
594 stream
594 stream
595 v2
595 v2
596
596
597 Test debugpeer
597 Test debugpeer
598
598
599 $ hg --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" debugpeer ssh://user@dummy/debugrevlog
599 $ hg --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" debugpeer ssh://user@dummy/debugrevlog
600 url: ssh://user@dummy/debugrevlog
600 url: ssh://user@dummy/debugrevlog
601 local: no
601 local: no
602 pushable: yes
602 pushable: yes
603
603
604 $ hg --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" --debug debugpeer ssh://user@dummy/debugrevlog
604 $ hg --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" --debug debugpeer ssh://user@dummy/debugrevlog
605 running "*" "*/tests/dummyssh" 'user@dummy' 'hg -R debugrevlog serve --stdio' (glob) (no-windows !)
605 running "*" "*/tests/dummyssh" 'user@dummy' 'hg -R debugrevlog serve --stdio' (glob) (no-windows !)
606 running "*" "*\tests/dummyssh" "user@dummy" "hg -R debugrevlog serve --stdio" (glob) (windows !)
606 running "*" "*\tests/dummyssh" "user@dummy" "hg -R debugrevlog serve --stdio" (glob) (windows !)
607 devel-peer-request: hello+between
607 devel-peer-request: hello+between
608 devel-peer-request: pairs: 81 bytes
608 devel-peer-request: pairs: 81 bytes
609 sending hello command
609 sending hello command
610 sending between command
610 sending between command
611 remote: 413
611 remote: 413
612 remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
612 remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
613 remote: 1
613 remote: 1
614 devel-peer-request: protocaps
614 devel-peer-request: protocaps
615 devel-peer-request: caps: * bytes (glob)
615 devel-peer-request: caps: * bytes (glob)
616 sending protocaps command
616 sending protocaps command
617 url: ssh://user@dummy/debugrevlog
617 url: ssh://user@dummy/debugrevlog
618 local: no
618 local: no
619 pushable: yes
619 pushable: yes
@@ -1,510 +1,510 b''
1 #require repofncache
1 #require repofncache
2
2
3 Init repo1:
3 Init repo1:
4
4
5 $ hg init repo1
5 $ hg init repo1
6 $ cd repo1
6 $ cd repo1
7 $ echo "some text" > a
7 $ echo "some text" > a
8 $ hg add
8 $ hg add
9 adding a
9 adding a
10 $ hg ci -m first
10 $ hg ci -m first
11 $ cat .hg/store/fncache | sort
11 $ cat .hg/store/fncache | sort
12 data/a.i
12 data/a.i
13
13
14 Testing a.i/b:
14 Testing a.i/b:
15
15
16 $ mkdir a.i
16 $ mkdir a.i
17 $ echo "some other text" > a.i/b
17 $ echo "some other text" > a.i/b
18 $ hg add
18 $ hg add
19 adding a.i/b
19 adding a.i/b
20 $ hg ci -m second
20 $ hg ci -m second
21 $ cat .hg/store/fncache | sort
21 $ cat .hg/store/fncache | sort
22 data/a.i
22 data/a.i
23 data/a.i.hg/b.i
23 data/a.i.hg/b.i
24
24
25 Testing a.i.hg/c:
25 Testing a.i.hg/c:
26
26
27 $ mkdir a.i.hg
27 $ mkdir a.i.hg
28 $ echo "yet another text" > a.i.hg/c
28 $ echo "yet another text" > a.i.hg/c
29 $ hg add
29 $ hg add
30 adding a.i.hg/c
30 adding a.i.hg/c
31 $ hg ci -m third
31 $ hg ci -m third
32 $ cat .hg/store/fncache | sort
32 $ cat .hg/store/fncache | sort
33 data/a.i
33 data/a.i
34 data/a.i.hg.hg/c.i
34 data/a.i.hg.hg/c.i
35 data/a.i.hg/b.i
35 data/a.i.hg/b.i
36
36
37 Testing verify:
37 Testing verify:
38
38
39 $ hg verify
39 $ hg verify
40 checking changesets
40 checking changesets
41 checking manifests
41 checking manifests
42 crosschecking files in changesets and manifests
42 crosschecking files in changesets and manifests
43 checking files
43 checking files
44 3 files, 3 changesets, 3 total revisions
44 3 files, 3 changesets, 3 total revisions
45
45
46 $ rm .hg/store/fncache
46 $ rm .hg/store/fncache
47
47
48 $ hg verify
48 $ hg verify
49 checking changesets
49 checking changesets
50 checking manifests
50 checking manifests
51 crosschecking files in changesets and manifests
51 crosschecking files in changesets and manifests
52 checking files
52 checking files
53 warning: revlog 'data/a.i' not in fncache!
53 warning: revlog 'data/a.i' not in fncache!
54 warning: revlog 'data/a.i.hg/c.i' not in fncache!
54 warning: revlog 'data/a.i.hg/c.i' not in fncache!
55 warning: revlog 'data/a.i/b.i' not in fncache!
55 warning: revlog 'data/a.i/b.i' not in fncache!
56 3 files, 3 changesets, 3 total revisions
56 3 files, 3 changesets, 3 total revisions
57 3 warnings encountered!
57 3 warnings encountered!
58 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
58 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
59
59
60 Follow the hint to make sure it works
60 Follow the hint to make sure it works
61
61
62 $ hg debugrebuildfncache
62 $ hg debugrebuildfncache
63 adding data/a.i
63 adding data/a.i
64 adding data/a.i.hg/c.i
64 adding data/a.i.hg/c.i
65 adding data/a.i/b.i
65 adding data/a.i/b.i
66 3 items added, 0 removed from fncache
66 3 items added, 0 removed from fncache
67
67
68 $ hg verify
68 $ hg verify
69 checking changesets
69 checking changesets
70 checking manifests
70 checking manifests
71 crosschecking files in changesets and manifests
71 crosschecking files in changesets and manifests
72 checking files
72 checking files
73 3 files, 3 changesets, 3 total revisions
73 3 files, 3 changesets, 3 total revisions
74
74
75 $ cd ..
75 $ cd ..
76
76
77 Non store repo:
77 Non store repo:
78
78
79 $ hg --config format.usestore=False init foo
79 $ hg --config format.usestore=False init foo
80 $ cd foo
80 $ cd foo
81 $ mkdir tst.d
81 $ mkdir tst.d
82 $ echo foo > tst.d/foo
82 $ echo foo > tst.d/foo
83 $ hg ci -Amfoo
83 $ hg ci -Amfoo
84 adding tst.d/foo
84 adding tst.d/foo
85 $ find .hg | sort
85 $ find .hg | sort
86 .hg
86 .hg
87 .hg/00changelog.i
87 .hg/00changelog.i
88 .hg/00manifest.i
88 .hg/00manifest.i
89 .hg/cache
89 .hg/cache
90 .hg/cache/branch2-served
90 .hg/cache/branch2-served
91 .hg/cache/manifestfulltextcache
91 .hg/cache/manifestfulltextcache (reporevlogstore !)
92 .hg/cache/rbc-names-v1
92 .hg/cache/rbc-names-v1
93 .hg/cache/rbc-revs-v1
93 .hg/cache/rbc-revs-v1
94 .hg/data
94 .hg/data
95 .hg/data/tst.d.hg
95 .hg/data/tst.d.hg
96 .hg/data/tst.d.hg/foo.i
96 .hg/data/tst.d.hg/foo.i
97 .hg/dirstate
97 .hg/dirstate
98 .hg/fsmonitor.state (fsmonitor !)
98 .hg/fsmonitor.state (fsmonitor !)
99 .hg/last-message.txt
99 .hg/last-message.txt
100 .hg/phaseroots
100 .hg/phaseroots
101 .hg/requires
101 .hg/requires
102 .hg/undo
102 .hg/undo
103 .hg/undo.backup.dirstate
103 .hg/undo.backup.dirstate
104 .hg/undo.backupfiles
104 .hg/undo.backupfiles
105 .hg/undo.bookmarks
105 .hg/undo.bookmarks
106 .hg/undo.branch
106 .hg/undo.branch
107 .hg/undo.desc
107 .hg/undo.desc
108 .hg/undo.dirstate
108 .hg/undo.dirstate
109 .hg/undo.phaseroots
109 .hg/undo.phaseroots
110 $ cd ..
110 $ cd ..
111
111
112 Non fncache repo:
112 Non fncache repo:
113
113
114 $ hg --config format.usefncache=False init bar
114 $ hg --config format.usefncache=False init bar
115 $ cd bar
115 $ cd bar
116 $ mkdir tst.d
116 $ mkdir tst.d
117 $ echo foo > tst.d/Foo
117 $ echo foo > tst.d/Foo
118 $ hg ci -Amfoo
118 $ hg ci -Amfoo
119 adding tst.d/Foo
119 adding tst.d/Foo
120 $ find .hg | sort
120 $ find .hg | sort
121 .hg
121 .hg
122 .hg/00changelog.i
122 .hg/00changelog.i
123 .hg/cache
123 .hg/cache
124 .hg/cache/branch2-served
124 .hg/cache/branch2-served
125 .hg/cache/manifestfulltextcache
125 .hg/cache/manifestfulltextcache (reporevlogstore !)
126 .hg/cache/rbc-names-v1
126 .hg/cache/rbc-names-v1
127 .hg/cache/rbc-revs-v1
127 .hg/cache/rbc-revs-v1
128 .hg/dirstate
128 .hg/dirstate
129 .hg/fsmonitor.state (fsmonitor !)
129 .hg/fsmonitor.state (fsmonitor !)
130 .hg/last-message.txt
130 .hg/last-message.txt
131 .hg/requires
131 .hg/requires
132 .hg/store
132 .hg/store
133 .hg/store/00changelog.i
133 .hg/store/00changelog.i
134 .hg/store/00manifest.i
134 .hg/store/00manifest.i
135 .hg/store/data
135 .hg/store/data
136 .hg/store/data/tst.d.hg
136 .hg/store/data/tst.d.hg
137 .hg/store/data/tst.d.hg/_foo.i
137 .hg/store/data/tst.d.hg/_foo.i
138 .hg/store/phaseroots
138 .hg/store/phaseroots
139 .hg/store/undo
139 .hg/store/undo
140 .hg/store/undo.backupfiles
140 .hg/store/undo.backupfiles
141 .hg/store/undo.phaseroots
141 .hg/store/undo.phaseroots
142 .hg/undo.backup.dirstate
142 .hg/undo.backup.dirstate
143 .hg/undo.bookmarks
143 .hg/undo.bookmarks
144 .hg/undo.branch
144 .hg/undo.branch
145 .hg/undo.desc
145 .hg/undo.desc
146 .hg/undo.dirstate
146 .hg/undo.dirstate
147 $ cd ..
147 $ cd ..
148
148
149 Encoding of reserved / long paths in the store
149 Encoding of reserved / long paths in the store
150
150
151 $ hg init r2
151 $ hg init r2
152 $ cd r2
152 $ cd r2
153 $ cat <<EOF > .hg/hgrc
153 $ cat <<EOF > .hg/hgrc
154 > [ui]
154 > [ui]
155 > portablefilenames = ignore
155 > portablefilenames = ignore
156 > EOF
156 > EOF
157
157
158 $ hg import -q --bypass - <<EOF
158 $ hg import -q --bypass - <<EOF
159 > # HG changeset patch
159 > # HG changeset patch
160 > # User test
160 > # User test
161 > # Date 0 0
161 > # Date 0 0
162 > # Node ID 1c7a2f7cb77be1a0def34e4c7cabc562ad98fbd7
162 > # Node ID 1c7a2f7cb77be1a0def34e4c7cabc562ad98fbd7
163 > # Parent 0000000000000000000000000000000000000000
163 > # Parent 0000000000000000000000000000000000000000
164 > 1
164 > 1
165 >
165 >
166 > diff --git a/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
166 > diff --git a/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
167 > new file mode 100644
167 > new file mode 100644
168 > --- /dev/null
168 > --- /dev/null
169 > +++ b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
169 > +++ b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
170 > @@ -0,0 +1,1 @@
170 > @@ -0,0 +1,1 @@
171 > +foo
171 > +foo
172 > diff --git a/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
172 > diff --git a/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
173 > new file mode 100644
173 > new file mode 100644
174 > --- /dev/null
174 > --- /dev/null
175 > +++ b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
175 > +++ b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
176 > @@ -0,0 +1,1 @@
176 > @@ -0,0 +1,1 @@
177 > +foo
177 > +foo
178 > diff --git a/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
178 > diff --git a/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
179 > new file mode 100644
179 > new file mode 100644
180 > --- /dev/null
180 > --- /dev/null
181 > +++ b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
181 > +++ b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
182 > @@ -0,0 +1,1 @@
182 > @@ -0,0 +1,1 @@
183 > +foo
183 > +foo
184 > diff --git a/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
184 > diff --git a/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
185 > new file mode 100644
185 > new file mode 100644
186 > --- /dev/null
186 > --- /dev/null
187 > +++ b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
187 > +++ b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
188 > @@ -0,0 +1,1 @@
188 > @@ -0,0 +1,1 @@
189 > +foo
189 > +foo
190 > diff --git a/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
190 > diff --git a/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
191 > new file mode 100644
191 > new file mode 100644
192 > --- /dev/null
192 > --- /dev/null
193 > +++ b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
193 > +++ b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
194 > @@ -0,0 +1,1 @@
194 > @@ -0,0 +1,1 @@
195 > +foo
195 > +foo
196 > EOF
196 > EOF
197
197
198 $ find .hg/store -name *.i | sort
198 $ find .hg/store -name *.i | sort
199 .hg/store/00changelog.i
199 .hg/store/00changelog.i
200 .hg/store/00manifest.i
200 .hg/store/00manifest.i
201 .hg/store/data/bla.aux/pr~6e/_p_r_n/lpt/co~6d3/nu~6c/coma/foo._n_u_l/normal.c.i
201 .hg/store/data/bla.aux/pr~6e/_p_r_n/lpt/co~6d3/nu~6c/coma/foo._n_u_l/normal.c.i
202 .hg/store/dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxx168e07b38e65eff86ab579afaaa8e30bfbe0f35f.i
202 .hg/store/dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxx168e07b38e65eff86ab579afaaa8e30bfbe0f35f.i
203 .hg/store/dh/au~78/second/x.prn/fourth/fi~3afth/sixth/seventh/eighth/nineth/tenth/loremia20419e358ddff1bf8751e38288aff1d7c32ec05.i
203 .hg/store/dh/au~78/second/x.prn/fourth/fi~3afth/sixth/seventh/eighth/nineth/tenth/loremia20419e358ddff1bf8751e38288aff1d7c32ec05.i
204 .hg/store/dh/enterpri/openesba/contrib-/corba-bc/netbeans/wsdlexte/src/main/java/org.net7018f27961fdf338a598a40c4683429e7ffb9743.i
204 .hg/store/dh/enterpri/openesba/contrib-/corba-bc/netbeans/wsdlexte/src/main/java/org.net7018f27961fdf338a598a40c4683429e7ffb9743.i
205 .hg/store/dh/project_/resource/anotherl/followed/andanoth/andthenanextremelylongfilename0d8e1f4187c650e2f1fdca9fd90f786bc0976b6b.i
205 .hg/store/dh/project_/resource/anotherl/followed/andanoth/andthenanextremelylongfilename0d8e1f4187c650e2f1fdca9fd90f786bc0976b6b.i
206
206
207 $ cd ..
207 $ cd ..
208
208
209 Aborting lock does not prevent fncache writes
209 Aborting lock does not prevent fncache writes
210
210
211 $ cat > exceptionext.py <<EOF
211 $ cat > exceptionext.py <<EOF
212 > from __future__ import absolute_import
212 > from __future__ import absolute_import
213 > import os
213 > import os
214 > from mercurial import commands, error, extensions
214 > from mercurial import commands, error, extensions
215 >
215 >
216 > def lockexception(orig, vfs, lockname, wait, releasefn, *args, **kwargs):
216 > def lockexception(orig, vfs, lockname, wait, releasefn, *args, **kwargs):
217 > def releasewrap():
217 > def releasewrap():
218 > l.held = False # ensure __del__ is a noop
218 > l.held = False # ensure __del__ is a noop
219 > raise error.Abort("forced lock failure")
219 > raise error.Abort("forced lock failure")
220 > l = orig(vfs, lockname, wait, releasewrap, *args, **kwargs)
220 > l = orig(vfs, lockname, wait, releasewrap, *args, **kwargs)
221 > return l
221 > return l
222 >
222 >
223 > def reposetup(ui, repo):
223 > def reposetup(ui, repo):
224 > extensions.wrapfunction(repo, '_lock', lockexception)
224 > extensions.wrapfunction(repo, '_lock', lockexception)
225 >
225 >
226 > cmdtable = {}
226 > cmdtable = {}
227 >
227 >
228 > # wrap "commit" command to prevent wlock from being '__del__()'-ed
228 > # wrap "commit" command to prevent wlock from being '__del__()'-ed
229 > # at the end of dispatching (for intentional "forced lcok failure")
229 > # at the end of dispatching (for intentional "forced lcok failure")
230 > def commitwrap(orig, ui, repo, *pats, **opts):
230 > def commitwrap(orig, ui, repo, *pats, **opts):
231 > repo = repo.unfiltered() # to use replaced repo._lock certainly
231 > repo = repo.unfiltered() # to use replaced repo._lock certainly
232 > wlock = repo.wlock()
232 > wlock = repo.wlock()
233 > try:
233 > try:
234 > return orig(ui, repo, *pats, **opts)
234 > return orig(ui, repo, *pats, **opts)
235 > finally:
235 > finally:
236 > # multiple 'relase()' is needed for complete releasing wlock,
236 > # multiple 'relase()' is needed for complete releasing wlock,
237 > # because "forced" abort at last releasing store lock
237 > # because "forced" abort at last releasing store lock
238 > # prevents wlock from being released at same 'lockmod.release()'
238 > # prevents wlock from being released at same 'lockmod.release()'
239 > for i in range(wlock.held):
239 > for i in range(wlock.held):
240 > wlock.release()
240 > wlock.release()
241 >
241 >
242 > def extsetup(ui):
242 > def extsetup(ui):
243 > extensions.wrapcommand(commands.table, b"commit", commitwrap)
243 > extensions.wrapcommand(commands.table, b"commit", commitwrap)
244 > EOF
244 > EOF
245 $ extpath=`pwd`/exceptionext.py
245 $ extpath=`pwd`/exceptionext.py
246 $ hg init fncachetxn
246 $ hg init fncachetxn
247 $ cd fncachetxn
247 $ cd fncachetxn
248 $ printf "[extensions]\nexceptionext=$extpath\n" >> .hg/hgrc
248 $ printf "[extensions]\nexceptionext=$extpath\n" >> .hg/hgrc
249 $ touch y
249 $ touch y
250 $ hg ci -qAm y
250 $ hg ci -qAm y
251 abort: forced lock failure
251 abort: forced lock failure
252 [255]
252 [255]
253 $ cat .hg/store/fncache
253 $ cat .hg/store/fncache
254 data/y.i
254 data/y.i
255
255
256 Aborting transaction prevents fncache change
256 Aborting transaction prevents fncache change
257
257
258 $ cat > ../exceptionext.py <<EOF
258 $ cat > ../exceptionext.py <<EOF
259 > from __future__ import absolute_import
259 > from __future__ import absolute_import
260 > import os
260 > import os
261 > from mercurial import commands, error, extensions, localrepo
261 > from mercurial import commands, error, extensions, localrepo
262 >
262 >
263 > def wrapper(orig, self, *args, **kwargs):
263 > def wrapper(orig, self, *args, **kwargs):
264 > tr = orig(self, *args, **kwargs)
264 > tr = orig(self, *args, **kwargs)
265 > def fail(tr):
265 > def fail(tr):
266 > raise error.Abort(b"forced transaction failure")
266 > raise error.Abort(b"forced transaction failure")
267 > # zzz prefix to ensure it sorted after store.write
267 > # zzz prefix to ensure it sorted after store.write
268 > tr.addfinalize(b'zzz-forcefails', fail)
268 > tr.addfinalize(b'zzz-forcefails', fail)
269 > return tr
269 > return tr
270 >
270 >
271 > def uisetup(ui):
271 > def uisetup(ui):
272 > extensions.wrapfunction(
272 > extensions.wrapfunction(
273 > localrepo.localrepository, b'transaction', wrapper)
273 > localrepo.localrepository, b'transaction', wrapper)
274 >
274 >
275 > cmdtable = {}
275 > cmdtable = {}
276 >
276 >
277 > EOF
277 > EOF
278
278
279 Clean cached version
279 Clean cached version
280 $ rm -f "${extpath}c"
280 $ rm -f "${extpath}c"
281 $ rm -Rf "`dirname $extpath`/__pycache__"
281 $ rm -Rf "`dirname $extpath`/__pycache__"
282
282
283 $ touch z
283 $ touch z
284 $ hg ci -qAm z
284 $ hg ci -qAm z
285 transaction abort!
285 transaction abort!
286 rollback completed
286 rollback completed
287 abort: forced transaction failure
287 abort: forced transaction failure
288 [255]
288 [255]
289 $ cat .hg/store/fncache
289 $ cat .hg/store/fncache
290 data/y.i
290 data/y.i
291
291
292 Aborted transactions can be recovered later
292 Aborted transactions can be recovered later
293
293
294 $ cat > ../exceptionext.py <<EOF
294 $ cat > ../exceptionext.py <<EOF
295 > from __future__ import absolute_import
295 > from __future__ import absolute_import
296 > import os
296 > import os
297 > from mercurial import (
297 > from mercurial import (
298 > commands,
298 > commands,
299 > error,
299 > error,
300 > extensions,
300 > extensions,
301 > localrepo,
301 > localrepo,
302 > transaction,
302 > transaction,
303 > )
303 > )
304 >
304 >
305 > def trwrapper(orig, self, *args, **kwargs):
305 > def trwrapper(orig, self, *args, **kwargs):
306 > tr = orig(self, *args, **kwargs)
306 > tr = orig(self, *args, **kwargs)
307 > def fail(tr):
307 > def fail(tr):
308 > raise error.Abort("forced transaction failure")
308 > raise error.Abort("forced transaction failure")
309 > # zzz prefix to ensure it sorted after store.write
309 > # zzz prefix to ensure it sorted after store.write
310 > tr.addfinalize('zzz-forcefails', fail)
310 > tr.addfinalize('zzz-forcefails', fail)
311 > return tr
311 > return tr
312 >
312 >
313 > def abortwrapper(orig, self, *args, **kwargs):
313 > def abortwrapper(orig, self, *args, **kwargs):
314 > raise error.Abort("forced transaction failure")
314 > raise error.Abort("forced transaction failure")
315 >
315 >
316 > def uisetup(ui):
316 > def uisetup(ui):
317 > extensions.wrapfunction(localrepo.localrepository, 'transaction',
317 > extensions.wrapfunction(localrepo.localrepository, 'transaction',
318 > trwrapper)
318 > trwrapper)
319 > extensions.wrapfunction(transaction.transaction, '_abort',
319 > extensions.wrapfunction(transaction.transaction, '_abort',
320 > abortwrapper)
320 > abortwrapper)
321 >
321 >
322 > cmdtable = {}
322 > cmdtable = {}
323 >
323 >
324 > EOF
324 > EOF
325
325
326 Clean cached versions
326 Clean cached versions
327 $ rm -f "${extpath}c"
327 $ rm -f "${extpath}c"
328 $ rm -Rf "`dirname $extpath`/__pycache__"
328 $ rm -Rf "`dirname $extpath`/__pycache__"
329
329
330 $ hg up -q 1
330 $ hg up -q 1
331 $ touch z
331 $ touch z
332 $ hg ci -qAm z 2>/dev/null
332 $ hg ci -qAm z 2>/dev/null
333 [255]
333 [255]
334 $ cat .hg/store/fncache | sort
334 $ cat .hg/store/fncache | sort
335 data/y.i
335 data/y.i
336 data/z.i
336 data/z.i
337 $ hg recover
337 $ hg recover
338 rolling back interrupted transaction
338 rolling back interrupted transaction
339 checking changesets
339 checking changesets
340 checking manifests
340 checking manifests
341 crosschecking files in changesets and manifests
341 crosschecking files in changesets and manifests
342 checking files
342 checking files
343 1 files, 1 changesets, 1 total revisions
343 1 files, 1 changesets, 1 total revisions
344 $ cat .hg/store/fncache
344 $ cat .hg/store/fncache
345 data/y.i
345 data/y.i
346
346
347 $ cd ..
347 $ cd ..
348
348
349 debugrebuildfncache does nothing unless repo has fncache requirement
349 debugrebuildfncache does nothing unless repo has fncache requirement
350
350
351 $ hg --config format.usefncache=false init nofncache
351 $ hg --config format.usefncache=false init nofncache
352 $ cd nofncache
352 $ cd nofncache
353 $ hg debugrebuildfncache
353 $ hg debugrebuildfncache
354 (not rebuilding fncache because repository does not support fncache)
354 (not rebuilding fncache because repository does not support fncache)
355
355
356 $ cd ..
356 $ cd ..
357
357
358 debugrebuildfncache works on empty repository
358 debugrebuildfncache works on empty repository
359
359
360 $ hg init empty
360 $ hg init empty
361 $ cd empty
361 $ cd empty
362 $ hg debugrebuildfncache
362 $ hg debugrebuildfncache
363 fncache already up to date
363 fncache already up to date
364 $ cd ..
364 $ cd ..
365
365
366 debugrebuildfncache on an up to date repository no-ops
366 debugrebuildfncache on an up to date repository no-ops
367
367
368 $ hg init repo
368 $ hg init repo
369 $ cd repo
369 $ cd repo
370 $ echo initial > foo
370 $ echo initial > foo
371 $ echo initial > .bar
371 $ echo initial > .bar
372 $ hg commit -A -m initial
372 $ hg commit -A -m initial
373 adding .bar
373 adding .bar
374 adding foo
374 adding foo
375
375
376 $ cat .hg/store/fncache | sort
376 $ cat .hg/store/fncache | sort
377 data/.bar.i
377 data/.bar.i
378 data/foo.i
378 data/foo.i
379
379
380 $ hg debugrebuildfncache
380 $ hg debugrebuildfncache
381 fncache already up to date
381 fncache already up to date
382
382
383 debugrebuildfncache restores deleted fncache file
383 debugrebuildfncache restores deleted fncache file
384
384
385 $ rm -f .hg/store/fncache
385 $ rm -f .hg/store/fncache
386 $ hg debugrebuildfncache
386 $ hg debugrebuildfncache
387 adding data/.bar.i
387 adding data/.bar.i
388 adding data/foo.i
388 adding data/foo.i
389 2 items added, 0 removed from fncache
389 2 items added, 0 removed from fncache
390
390
391 $ cat .hg/store/fncache | sort
391 $ cat .hg/store/fncache | sort
392 data/.bar.i
392 data/.bar.i
393 data/foo.i
393 data/foo.i
394
394
395 Rebuild after rebuild should no-op
395 Rebuild after rebuild should no-op
396
396
397 $ hg debugrebuildfncache
397 $ hg debugrebuildfncache
398 fncache already up to date
398 fncache already up to date
399
399
400 A single missing file should get restored, an extra file should be removed
400 A single missing file should get restored, an extra file should be removed
401
401
402 $ cat > .hg/store/fncache << EOF
402 $ cat > .hg/store/fncache << EOF
403 > data/foo.i
403 > data/foo.i
404 > data/bad-entry.i
404 > data/bad-entry.i
405 > EOF
405 > EOF
406
406
407 $ hg debugrebuildfncache
407 $ hg debugrebuildfncache
408 removing data/bad-entry.i
408 removing data/bad-entry.i
409 adding data/.bar.i
409 adding data/.bar.i
410 1 items added, 1 removed from fncache
410 1 items added, 1 removed from fncache
411
411
412 $ cat .hg/store/fncache | sort
412 $ cat .hg/store/fncache | sort
413 data/.bar.i
413 data/.bar.i
414 data/foo.i
414 data/foo.i
415
415
416 $ cd ..
416 $ cd ..
417
417
418 Try a simple variation without dotencode to ensure fncache is ignorant of encoding
418 Try a simple variation without dotencode to ensure fncache is ignorant of encoding
419
419
420 $ hg --config format.dotencode=false init nodotencode
420 $ hg --config format.dotencode=false init nodotencode
421 $ cd nodotencode
421 $ cd nodotencode
422 $ echo initial > foo
422 $ echo initial > foo
423 $ echo initial > .bar
423 $ echo initial > .bar
424 $ hg commit -A -m initial
424 $ hg commit -A -m initial
425 adding .bar
425 adding .bar
426 adding foo
426 adding foo
427
427
428 $ cat .hg/store/fncache | sort
428 $ cat .hg/store/fncache | sort
429 data/.bar.i
429 data/.bar.i
430 data/foo.i
430 data/foo.i
431
431
432 $ rm .hg/store/fncache
432 $ rm .hg/store/fncache
433 $ hg debugrebuildfncache
433 $ hg debugrebuildfncache
434 adding data/.bar.i
434 adding data/.bar.i
435 adding data/foo.i
435 adding data/foo.i
436 2 items added, 0 removed from fncache
436 2 items added, 0 removed from fncache
437
437
438 $ cat .hg/store/fncache | sort
438 $ cat .hg/store/fncache | sort
439 data/.bar.i
439 data/.bar.i
440 data/foo.i
440 data/foo.i
441
441
442 $ cd ..
442 $ cd ..
443
443
444 In repositories that have accumulated a large number of files over time, the
444 In repositories that have accumulated a large number of files over time, the
445 fncache file is going to be large. If we possibly can avoid loading it, so much the better.
445 fncache file is going to be large. If we possibly can avoid loading it, so much the better.
446 The cache should not loaded when committing changes to existing files, or when unbundling
446 The cache should not loaded when committing changes to existing files, or when unbundling
447 changesets that only contain changes to existing files:
447 changesets that only contain changes to existing files:
448
448
449 $ cat > fncacheloadwarn.py << EOF
449 $ cat > fncacheloadwarn.py << EOF
450 > from __future__ import absolute_import
450 > from __future__ import absolute_import
451 > from mercurial import extensions, store
451 > from mercurial import extensions, store
452 >
452 >
453 > def extsetup(ui):
453 > def extsetup(ui):
454 > def wrapstore(orig, requirements, *args):
454 > def wrapstore(orig, requirements, *args):
455 > store = orig(requirements, *args)
455 > store = orig(requirements, *args)
456 > if 'store' in requirements and 'fncache' in requirements:
456 > if 'store' in requirements and 'fncache' in requirements:
457 > instrumentfncachestore(store, ui)
457 > instrumentfncachestore(store, ui)
458 > return store
458 > return store
459 > extensions.wrapfunction(store, 'store', wrapstore)
459 > extensions.wrapfunction(store, 'store', wrapstore)
460 >
460 >
461 > def instrumentfncachestore(fncachestore, ui):
461 > def instrumentfncachestore(fncachestore, ui):
462 > class instrumentedfncache(type(fncachestore.fncache)):
462 > class instrumentedfncache(type(fncachestore.fncache)):
463 > def _load(self):
463 > def _load(self):
464 > ui.warn('fncache load triggered!\n')
464 > ui.warn('fncache load triggered!\n')
465 > super(instrumentedfncache, self)._load()
465 > super(instrumentedfncache, self)._load()
466 > fncachestore.fncache.__class__ = instrumentedfncache
466 > fncachestore.fncache.__class__ = instrumentedfncache
467 > EOF
467 > EOF
468
468
469 $ fncachextpath=`pwd`/fncacheloadwarn.py
469 $ fncachextpath=`pwd`/fncacheloadwarn.py
470 $ hg init nofncacheload
470 $ hg init nofncacheload
471 $ cd nofncacheload
471 $ cd nofncacheload
472 $ printf "[extensions]\nfncacheloadwarn=$fncachextpath\n" >> .hg/hgrc
472 $ printf "[extensions]\nfncacheloadwarn=$fncachextpath\n" >> .hg/hgrc
473
473
474 A new file should trigger a load, as we'd want to update the fncache set in that case:
474 A new file should trigger a load, as we'd want to update the fncache set in that case:
475
475
476 $ touch foo
476 $ touch foo
477 $ hg ci -qAm foo
477 $ hg ci -qAm foo
478 fncache load triggered!
478 fncache load triggered!
479
479
480 But modifying that file should not:
480 But modifying that file should not:
481
481
482 $ echo bar >> foo
482 $ echo bar >> foo
483 $ hg ci -qm foo
483 $ hg ci -qm foo
484
484
485 If a transaction has been aborted, the zero-size truncated index file will
485 If a transaction has been aborted, the zero-size truncated index file will
486 not prevent the fncache from being loaded; rather than actually abort
486 not prevent the fncache from being loaded; rather than actually abort
487 a transaction, we simulate the situation by creating a zero-size index file:
487 a transaction, we simulate the situation by creating a zero-size index file:
488
488
489 $ touch .hg/store/data/bar.i
489 $ touch .hg/store/data/bar.i
490 $ touch bar
490 $ touch bar
491 $ hg ci -qAm bar
491 $ hg ci -qAm bar
492 fncache load triggered!
492 fncache load triggered!
493
493
494 Unbundling should follow the same rules; existing files should not cause a load:
494 Unbundling should follow the same rules; existing files should not cause a load:
495
495
496 $ hg clone -q . tobundle
496 $ hg clone -q . tobundle
497 $ echo 'new line' > tobundle/bar
497 $ echo 'new line' > tobundle/bar
498 $ hg -R tobundle ci -qm bar
498 $ hg -R tobundle ci -qm bar
499 $ hg -R tobundle bundle -q barupdated.hg
499 $ hg -R tobundle bundle -q barupdated.hg
500 $ hg unbundle -q barupdated.hg
500 $ hg unbundle -q barupdated.hg
501
501
502 but adding new files should:
502 but adding new files should:
503
503
504 $ touch tobundle/newfile
504 $ touch tobundle/newfile
505 $ hg -R tobundle ci -qAm newfile
505 $ hg -R tobundle ci -qAm newfile
506 $ hg -R tobundle bundle -q newfile.hg
506 $ hg -R tobundle bundle -q newfile.hg
507 $ hg unbundle -q newfile.hg
507 $ hg unbundle -q newfile.hg
508 fncache load triggered!
508 fncache load triggered!
509
509
510 $ cd ..
510 $ cd ..
@@ -1,431 +1,431 b''
1 #require hardlink reporevlogstore
1 #require hardlink reporevlogstore
2
2
3 $ cat > nlinks.py <<EOF
3 $ cat > nlinks.py <<EOF
4 > from __future__ import print_function
4 > from __future__ import print_function
5 > import sys
5 > import sys
6 > from mercurial import util
6 > from mercurial import util
7 > for f in sorted(sys.stdin.readlines()):
7 > for f in sorted(sys.stdin.readlines()):
8 > f = f[:-1]
8 > f = f[:-1]
9 > print(util.nlinks(f), f)
9 > print(util.nlinks(f), f)
10 > EOF
10 > EOF
11
11
12 $ nlinksdir()
12 $ nlinksdir()
13 > {
13 > {
14 > find "$@" -type f | $PYTHON $TESTTMP/nlinks.py
14 > find "$@" -type f | $PYTHON $TESTTMP/nlinks.py
15 > }
15 > }
16
16
17 Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux):
17 Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux):
18
18
19 $ cat > linkcp.py <<EOF
19 $ cat > linkcp.py <<EOF
20 > from __future__ import absolute_import
20 > from __future__ import absolute_import
21 > import sys
21 > import sys
22 > from mercurial import util
22 > from mercurial import util
23 > util.copyfiles(sys.argv[1], sys.argv[2], hardlink=True)
23 > util.copyfiles(sys.argv[1], sys.argv[2], hardlink=True)
24 > EOF
24 > EOF
25
25
26 $ linkcp()
26 $ linkcp()
27 > {
27 > {
28 > $PYTHON $TESTTMP/linkcp.py $1 $2
28 > $PYTHON $TESTTMP/linkcp.py $1 $2
29 > }
29 > }
30
30
31 Prepare repo r1:
31 Prepare repo r1:
32
32
33 $ hg init r1
33 $ hg init r1
34 $ cd r1
34 $ cd r1
35
35
36 $ echo c1 > f1
36 $ echo c1 > f1
37 $ hg add f1
37 $ hg add f1
38 $ hg ci -m0
38 $ hg ci -m0
39
39
40 $ mkdir d1
40 $ mkdir d1
41 $ cd d1
41 $ cd d1
42 $ echo c2 > f2
42 $ echo c2 > f2
43 $ hg add f2
43 $ hg add f2
44 $ hg ci -m1
44 $ hg ci -m1
45 $ cd ../..
45 $ cd ../..
46
46
47 $ nlinksdir r1/.hg/store
47 $ nlinksdir r1/.hg/store
48 1 r1/.hg/store/00changelog.i
48 1 r1/.hg/store/00changelog.i
49 1 r1/.hg/store/00manifest.i
49 1 r1/.hg/store/00manifest.i
50 1 r1/.hg/store/data/d1/f2.i
50 1 r1/.hg/store/data/d1/f2.i
51 1 r1/.hg/store/data/f1.i
51 1 r1/.hg/store/data/f1.i
52 1 r1/.hg/store/fncache (repofncache !)
52 1 r1/.hg/store/fncache (repofncache !)
53 1 r1/.hg/store/phaseroots
53 1 r1/.hg/store/phaseroots
54 1 r1/.hg/store/undo
54 1 r1/.hg/store/undo
55 1 r1/.hg/store/undo.backup.fncache (repofncache !)
55 1 r1/.hg/store/undo.backup.fncache (repofncache !)
56 1 r1/.hg/store/undo.backupfiles
56 1 r1/.hg/store/undo.backupfiles
57 1 r1/.hg/store/undo.phaseroots
57 1 r1/.hg/store/undo.phaseroots
58
58
59
59
60 Create hardlinked clone r2:
60 Create hardlinked clone r2:
61
61
62 $ hg clone -U --debug r1 r2 --config progress.debug=true
62 $ hg clone -U --debug r1 r2 --config progress.debug=true
63 linking: 1
63 linking: 1
64 linking: 2
64 linking: 2
65 linking: 3
65 linking: 3
66 linking: 4
66 linking: 4
67 linking: 5
67 linking: 5
68 linking: 6
68 linking: 6
69 linking: 7
69 linking: 7
70 linked 7 files
70 linked 7 files
71
71
72 Create non-hardlinked clone r3:
72 Create non-hardlinked clone r3:
73
73
74 $ hg clone --pull r1 r3
74 $ hg clone --pull r1 r3
75 requesting all changes
75 requesting all changes
76 adding changesets
76 adding changesets
77 adding manifests
77 adding manifests
78 adding file changes
78 adding file changes
79 added 2 changesets with 2 changes to 2 files
79 added 2 changesets with 2 changes to 2 files
80 new changesets 40d85e9847f2:7069c422939c
80 new changesets 40d85e9847f2:7069c422939c
81 updating to branch default
81 updating to branch default
82 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
82 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
83
83
84
84
85 Repos r1 and r2 should now contain hardlinked files:
85 Repos r1 and r2 should now contain hardlinked files:
86
86
87 $ nlinksdir r1/.hg/store
87 $ nlinksdir r1/.hg/store
88 2 r1/.hg/store/00changelog.i
88 2 r1/.hg/store/00changelog.i
89 2 r1/.hg/store/00manifest.i
89 2 r1/.hg/store/00manifest.i
90 2 r1/.hg/store/data/d1/f2.i
90 2 r1/.hg/store/data/d1/f2.i
91 2 r1/.hg/store/data/f1.i
91 2 r1/.hg/store/data/f1.i
92 2 r1/.hg/store/fncache (repofncache !)
92 2 r1/.hg/store/fncache (repofncache !)
93 1 r1/.hg/store/phaseroots
93 1 r1/.hg/store/phaseroots
94 1 r1/.hg/store/undo
94 1 r1/.hg/store/undo
95 1 r1/.hg/store/undo.backup.fncache (repofncache !)
95 1 r1/.hg/store/undo.backup.fncache (repofncache !)
96 1 r1/.hg/store/undo.backupfiles
96 1 r1/.hg/store/undo.backupfiles
97 1 r1/.hg/store/undo.phaseroots
97 1 r1/.hg/store/undo.phaseroots
98
98
99 $ nlinksdir r2/.hg/store
99 $ nlinksdir r2/.hg/store
100 2 r2/.hg/store/00changelog.i
100 2 r2/.hg/store/00changelog.i
101 2 r2/.hg/store/00manifest.i
101 2 r2/.hg/store/00manifest.i
102 2 r2/.hg/store/data/d1/f2.i
102 2 r2/.hg/store/data/d1/f2.i
103 2 r2/.hg/store/data/f1.i
103 2 r2/.hg/store/data/f1.i
104 2 r2/.hg/store/fncache (repofncache !)
104 2 r2/.hg/store/fncache (repofncache !)
105
105
106 Repo r3 should not be hardlinked:
106 Repo r3 should not be hardlinked:
107
107
108 $ nlinksdir r3/.hg/store
108 $ nlinksdir r3/.hg/store
109 1 r3/.hg/store/00changelog.i
109 1 r3/.hg/store/00changelog.i
110 1 r3/.hg/store/00manifest.i
110 1 r3/.hg/store/00manifest.i
111 1 r3/.hg/store/data/d1/f2.i
111 1 r3/.hg/store/data/d1/f2.i
112 1 r3/.hg/store/data/f1.i
112 1 r3/.hg/store/data/f1.i
113 1 r3/.hg/store/fncache (repofncache !)
113 1 r3/.hg/store/fncache (repofncache !)
114 1 r3/.hg/store/phaseroots
114 1 r3/.hg/store/phaseroots
115 1 r3/.hg/store/undo
115 1 r3/.hg/store/undo
116 1 r3/.hg/store/undo.backupfiles
116 1 r3/.hg/store/undo.backupfiles
117 1 r3/.hg/store/undo.phaseroots
117 1 r3/.hg/store/undo.phaseroots
118
118
119
119
120 Create a non-inlined filelog in r3:
120 Create a non-inlined filelog in r3:
121
121
122 $ cd r3/d1
122 $ cd r3/d1
123 >>> f = open('data1', 'wb')
123 >>> f = open('data1', 'wb')
124 >>> for x in range(10000):
124 >>> for x in range(10000):
125 ... f.write(b"%d\n" % x) and None
125 ... f.write(b"%d\n" % x) and None
126 >>> f.close()
126 >>> f.close()
127 $ for j in 0 1 2 3 4 5 6 7 8 9; do
127 $ for j in 0 1 2 3 4 5 6 7 8 9; do
128 > cat data1 >> f2
128 > cat data1 >> f2
129 > hg commit -m$j
129 > hg commit -m$j
130 > done
130 > done
131 $ cd ../..
131 $ cd ../..
132
132
133 $ nlinksdir r3/.hg/store
133 $ nlinksdir r3/.hg/store
134 1 r3/.hg/store/00changelog.i
134 1 r3/.hg/store/00changelog.i
135 1 r3/.hg/store/00manifest.i
135 1 r3/.hg/store/00manifest.i
136 1 r3/.hg/store/data/d1/f2.d
136 1 r3/.hg/store/data/d1/f2.d
137 1 r3/.hg/store/data/d1/f2.i
137 1 r3/.hg/store/data/d1/f2.i
138 1 r3/.hg/store/data/f1.i
138 1 r3/.hg/store/data/f1.i
139 1 r3/.hg/store/fncache (repofncache !)
139 1 r3/.hg/store/fncache (repofncache !)
140 1 r3/.hg/store/phaseroots
140 1 r3/.hg/store/phaseroots
141 1 r3/.hg/store/undo
141 1 r3/.hg/store/undo
142 1 r3/.hg/store/undo.backup.fncache (repofncache !)
142 1 r3/.hg/store/undo.backup.fncache (repofncache !)
143 1 r3/.hg/store/undo.backup.phaseroots
143 1 r3/.hg/store/undo.backup.phaseroots
144 1 r3/.hg/store/undo.backupfiles
144 1 r3/.hg/store/undo.backupfiles
145 1 r3/.hg/store/undo.phaseroots
145 1 r3/.hg/store/undo.phaseroots
146
146
147 Push to repo r1 should break up most hardlinks in r2:
147 Push to repo r1 should break up most hardlinks in r2:
148
148
149 $ hg -R r2 verify
149 $ hg -R r2 verify
150 checking changesets
150 checking changesets
151 checking manifests
151 checking manifests
152 crosschecking files in changesets and manifests
152 crosschecking files in changesets and manifests
153 checking files
153 checking files
154 2 files, 2 changesets, 2 total revisions
154 2 files, 2 changesets, 2 total revisions
155
155
156 $ cd r3
156 $ cd r3
157 $ hg push
157 $ hg push
158 pushing to $TESTTMP/r1
158 pushing to $TESTTMP/r1
159 searching for changes
159 searching for changes
160 adding changesets
160 adding changesets
161 adding manifests
161 adding manifests
162 adding file changes
162 adding file changes
163 added 10 changesets with 10 changes to 1 files
163 added 10 changesets with 10 changes to 1 files
164
164
165 $ cd ..
165 $ cd ..
166
166
167 $ nlinksdir r2/.hg/store
167 $ nlinksdir r2/.hg/store
168 1 r2/.hg/store/00changelog.i
168 1 r2/.hg/store/00changelog.i
169 1 r2/.hg/store/00manifest.i
169 1 r2/.hg/store/00manifest.i
170 1 r2/.hg/store/data/d1/f2.i
170 1 r2/.hg/store/data/d1/f2.i
171 2 r2/.hg/store/data/f1.i
171 2 r2/.hg/store/data/f1.i
172 [12] r2/\.hg/store/fncache (re) (repofncache !)
172 [12] r2/\.hg/store/fncache (re) (repofncache !)
173
173
174 #if hardlink-whitelisted repofncache
174 #if hardlink-whitelisted repofncache
175 $ nlinksdir r2/.hg/store/fncache
175 $ nlinksdir r2/.hg/store/fncache
176 2 r2/.hg/store/fncache
176 2 r2/.hg/store/fncache
177 #endif
177 #endif
178
178
179 $ hg -R r2 verify
179 $ hg -R r2 verify
180 checking changesets
180 checking changesets
181 checking manifests
181 checking manifests
182 crosschecking files in changesets and manifests
182 crosschecking files in changesets and manifests
183 checking files
183 checking files
184 2 files, 2 changesets, 2 total revisions
184 2 files, 2 changesets, 2 total revisions
185
185
186
186
187 $ cd r1
187 $ cd r1
188 $ hg up
188 $ hg up
189 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
189 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
190
190
191 Committing a change to f1 in r1 must break up hardlink f1.i in r2:
191 Committing a change to f1 in r1 must break up hardlink f1.i in r2:
192
192
193 $ echo c1c1 >> f1
193 $ echo c1c1 >> f1
194 $ hg ci -m00
194 $ hg ci -m00
195 $ cd ..
195 $ cd ..
196
196
197 $ nlinksdir r2/.hg/store
197 $ nlinksdir r2/.hg/store
198 1 r2/.hg/store/00changelog.i
198 1 r2/.hg/store/00changelog.i
199 1 r2/.hg/store/00manifest.i
199 1 r2/.hg/store/00manifest.i
200 1 r2/.hg/store/data/d1/f2.i
200 1 r2/.hg/store/data/d1/f2.i
201 1 r2/.hg/store/data/f1.i
201 1 r2/.hg/store/data/f1.i
202 [12] r2/\.hg/store/fncache (re) (repofncache !)
202 [12] r2/\.hg/store/fncache (re) (repofncache !)
203
203
204 #if hardlink-whitelisted repofncache
204 #if hardlink-whitelisted repofncache
205 $ nlinksdir r2/.hg/store/fncache
205 $ nlinksdir r2/.hg/store/fncache
206 2 r2/.hg/store/fncache
206 2 r2/.hg/store/fncache
207 #endif
207 #endif
208
208
209 Create a file which exec permissions we will change
209 Create a file which exec permissions we will change
210 $ cd r3
210 $ cd r3
211 $ echo "echo hello world" > f3
211 $ echo "echo hello world" > f3
212 $ hg add f3
212 $ hg add f3
213 $ hg ci -mf3
213 $ hg ci -mf3
214 $ cd ..
214 $ cd ..
215
215
216 $ cd r3
216 $ cd r3
217 $ hg tip --template '{rev}:{node|short}\n'
217 $ hg tip --template '{rev}:{node|short}\n'
218 12:d3b77733a28a
218 12:d3b77733a28a
219 $ echo bla > f1
219 $ echo bla > f1
220 $ chmod +x f3
220 $ chmod +x f3
221 $ hg ci -m1
221 $ hg ci -m1
222 $ cd ..
222 $ cd ..
223
223
224 Create hardlinked copy r4 of r3 (on Linux, we would call 'cp -al'):
224 Create hardlinked copy r4 of r3 (on Linux, we would call 'cp -al'):
225
225
226 $ linkcp r3 r4
226 $ linkcp r3 r4
227
227
228 'checklink' is produced by hardlinking a symlink, which is undefined whether
228 'checklink' is produced by hardlinking a symlink, which is undefined whether
229 the symlink should be followed or not. It does behave differently on Linux and
229 the symlink should be followed or not. It does behave differently on Linux and
230 BSD. Just remove it so the test pass on both platforms.
230 BSD. Just remove it so the test pass on both platforms.
231
231
232 $ rm -f r4/.hg/cache/checklink
232 $ rm -f r4/.hg/cache/checklink
233
233
234 r4 has hardlinks in the working dir (not just inside .hg):
234 r4 has hardlinks in the working dir (not just inside .hg):
235
235
236 $ nlinksdir r4
236 $ nlinksdir r4
237 2 r4/.hg/00changelog.i
237 2 r4/.hg/00changelog.i
238 2 r4/.hg/branch
238 2 r4/.hg/branch
239 2 r4/.hg/cache/branch2-base
239 2 r4/.hg/cache/branch2-base
240 2 r4/.hg/cache/branch2-served
240 2 r4/.hg/cache/branch2-served
241 2 r4/.hg/cache/checkisexec (execbit !)
241 2 r4/.hg/cache/checkisexec (execbit !)
242 ? r4/.hg/cache/checklink-target (glob) (symlink !)
242 ? r4/.hg/cache/checklink-target (glob) (symlink !)
243 2 r4/.hg/cache/checknoexec (execbit !)
243 2 r4/.hg/cache/checknoexec (execbit !)
244 2 r4/.hg/cache/manifestfulltextcache
244 2 r4/.hg/cache/manifestfulltextcache (reporevlogstore !)
245 2 r4/.hg/cache/rbc-names-v1
245 2 r4/.hg/cache/rbc-names-v1
246 2 r4/.hg/cache/rbc-revs-v1
246 2 r4/.hg/cache/rbc-revs-v1
247 2 r4/.hg/dirstate
247 2 r4/.hg/dirstate
248 2 r4/.hg/fsmonitor.state (fsmonitor !)
248 2 r4/.hg/fsmonitor.state (fsmonitor !)
249 2 r4/.hg/hgrc
249 2 r4/.hg/hgrc
250 2 r4/.hg/last-message.txt
250 2 r4/.hg/last-message.txt
251 2 r4/.hg/requires
251 2 r4/.hg/requires
252 2 r4/.hg/store/00changelog.i
252 2 r4/.hg/store/00changelog.i
253 2 r4/.hg/store/00manifest.i
253 2 r4/.hg/store/00manifest.i
254 2 r4/.hg/store/data/d1/f2.d
254 2 r4/.hg/store/data/d1/f2.d
255 2 r4/.hg/store/data/d1/f2.i
255 2 r4/.hg/store/data/d1/f2.i
256 2 r4/.hg/store/data/f1.i
256 2 r4/.hg/store/data/f1.i
257 2 r4/.hg/store/data/f3.i
257 2 r4/.hg/store/data/f3.i
258 2 r4/.hg/store/fncache (repofncache !)
258 2 r4/.hg/store/fncache (repofncache !)
259 2 r4/.hg/store/phaseroots
259 2 r4/.hg/store/phaseroots
260 2 r4/.hg/store/undo
260 2 r4/.hg/store/undo
261 2 r4/.hg/store/undo.backup.fncache (repofncache !)
261 2 r4/.hg/store/undo.backup.fncache (repofncache !)
262 2 r4/.hg/store/undo.backup.phaseroots
262 2 r4/.hg/store/undo.backup.phaseroots
263 2 r4/.hg/store/undo.backupfiles
263 2 r4/.hg/store/undo.backupfiles
264 2 r4/.hg/store/undo.phaseroots
264 2 r4/.hg/store/undo.phaseroots
265 [24] r4/\.hg/undo\.backup\.dirstate (re)
265 [24] r4/\.hg/undo\.backup\.dirstate (re)
266 2 r4/.hg/undo.bookmarks
266 2 r4/.hg/undo.bookmarks
267 2 r4/.hg/undo.branch
267 2 r4/.hg/undo.branch
268 2 r4/.hg/undo.desc
268 2 r4/.hg/undo.desc
269 [24] r4/\.hg/undo\.dirstate (re)
269 [24] r4/\.hg/undo\.dirstate (re)
270 2 r4/d1/data1
270 2 r4/d1/data1
271 2 r4/d1/f2
271 2 r4/d1/f2
272 2 r4/f1
272 2 r4/f1
273 2 r4/f3
273 2 r4/f3
274
274
275 Update back to revision 12 in r4 should break hardlink of file f1 and f3:
275 Update back to revision 12 in r4 should break hardlink of file f1 and f3:
276 #if hardlink-whitelisted
276 #if hardlink-whitelisted
277 $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/undo.dirstate
277 $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/undo.dirstate
278 4 r4/.hg/undo.backup.dirstate
278 4 r4/.hg/undo.backup.dirstate
279 4 r4/.hg/undo.dirstate
279 4 r4/.hg/undo.dirstate
280 #endif
280 #endif
281
281
282
282
283 $ hg -R r4 up 12
283 $ hg -R r4 up 12
284 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (execbit !)
284 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (execbit !)
285 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-execbit !)
285 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-execbit !)
286
286
287 $ nlinksdir r4
287 $ nlinksdir r4
288 2 r4/.hg/00changelog.i
288 2 r4/.hg/00changelog.i
289 1 r4/.hg/branch
289 1 r4/.hg/branch
290 2 r4/.hg/cache/branch2-base
290 2 r4/.hg/cache/branch2-base
291 2 r4/.hg/cache/branch2-served
291 2 r4/.hg/cache/branch2-served
292 2 r4/.hg/cache/checkisexec (execbit !)
292 2 r4/.hg/cache/checkisexec (execbit !)
293 2 r4/.hg/cache/checklink-target (symlink !)
293 2 r4/.hg/cache/checklink-target (symlink !)
294 2 r4/.hg/cache/checknoexec (execbit !)
294 2 r4/.hg/cache/checknoexec (execbit !)
295 2 r4/.hg/cache/manifestfulltextcache
295 2 r4/.hg/cache/manifestfulltextcache (reporevlogstore !)
296 2 r4/.hg/cache/rbc-names-v1
296 2 r4/.hg/cache/rbc-names-v1
297 2 r4/.hg/cache/rbc-revs-v1
297 2 r4/.hg/cache/rbc-revs-v1
298 1 r4/.hg/dirstate
298 1 r4/.hg/dirstate
299 1 r4/.hg/fsmonitor.state (fsmonitor !)
299 1 r4/.hg/fsmonitor.state (fsmonitor !)
300 2 r4/.hg/hgrc
300 2 r4/.hg/hgrc
301 2 r4/.hg/last-message.txt
301 2 r4/.hg/last-message.txt
302 2 r4/.hg/requires
302 2 r4/.hg/requires
303 2 r4/.hg/store/00changelog.i
303 2 r4/.hg/store/00changelog.i
304 2 r4/.hg/store/00manifest.i
304 2 r4/.hg/store/00manifest.i
305 2 r4/.hg/store/data/d1/f2.d
305 2 r4/.hg/store/data/d1/f2.d
306 2 r4/.hg/store/data/d1/f2.i
306 2 r4/.hg/store/data/d1/f2.i
307 2 r4/.hg/store/data/f1.i
307 2 r4/.hg/store/data/f1.i
308 2 r4/.hg/store/data/f3.i
308 2 r4/.hg/store/data/f3.i
309 2 r4/.hg/store/fncache
309 2 r4/.hg/store/fncache
310 2 r4/.hg/store/phaseroots
310 2 r4/.hg/store/phaseroots
311 2 r4/.hg/store/undo
311 2 r4/.hg/store/undo
312 2 r4/.hg/store/undo.backup.fncache (repofncache !)
312 2 r4/.hg/store/undo.backup.fncache (repofncache !)
313 2 r4/.hg/store/undo.backup.phaseroots
313 2 r4/.hg/store/undo.backup.phaseroots
314 2 r4/.hg/store/undo.backupfiles
314 2 r4/.hg/store/undo.backupfiles
315 2 r4/.hg/store/undo.phaseroots
315 2 r4/.hg/store/undo.phaseroots
316 [24] r4/\.hg/undo\.backup\.dirstate (re)
316 [24] r4/\.hg/undo\.backup\.dirstate (re)
317 2 r4/.hg/undo.bookmarks
317 2 r4/.hg/undo.bookmarks
318 2 r4/.hg/undo.branch
318 2 r4/.hg/undo.branch
319 2 r4/.hg/undo.desc
319 2 r4/.hg/undo.desc
320 [24] r4/\.hg/undo\.dirstate (re)
320 [24] r4/\.hg/undo\.dirstate (re)
321 2 r4/d1/data1
321 2 r4/d1/data1
322 2 r4/d1/f2
322 2 r4/d1/f2
323 1 r4/f1
323 1 r4/f1
324 1 r4/f3 (execbit !)
324 1 r4/f3 (execbit !)
325 2 r4/f3 (no-execbit !)
325 2 r4/f3 (no-execbit !)
326
326
327 #if hardlink-whitelisted
327 #if hardlink-whitelisted
328 $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/undo.dirstate
328 $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/undo.dirstate
329 4 r4/.hg/undo.backup.dirstate
329 4 r4/.hg/undo.backup.dirstate
330 4 r4/.hg/undo.dirstate
330 4 r4/.hg/undo.dirstate
331 #endif
331 #endif
332
332
333 Test hardlinking outside hg:
333 Test hardlinking outside hg:
334
334
335 $ mkdir x
335 $ mkdir x
336 $ echo foo > x/a
336 $ echo foo > x/a
337
337
338 $ linkcp x y
338 $ linkcp x y
339 $ echo bar >> y/a
339 $ echo bar >> y/a
340
340
341 No diff if hardlink:
341 No diff if hardlink:
342
342
343 $ diff x/a y/a
343 $ diff x/a y/a
344
344
345 Test mq hardlinking:
345 Test mq hardlinking:
346
346
347 $ echo "[extensions]" >> $HGRCPATH
347 $ echo "[extensions]" >> $HGRCPATH
348 $ echo "mq=" >> $HGRCPATH
348 $ echo "mq=" >> $HGRCPATH
349
349
350 $ hg init a
350 $ hg init a
351 $ cd a
351 $ cd a
352
352
353 $ hg qimport -n foo - << EOF
353 $ hg qimport -n foo - << EOF
354 > # HG changeset patch
354 > # HG changeset patch
355 > # Date 1 0
355 > # Date 1 0
356 > diff -r 2588a8b53d66 a
356 > diff -r 2588a8b53d66 a
357 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
357 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
358 > +++ b/a Wed Jul 23 15:54:29 2008 +0200
358 > +++ b/a Wed Jul 23 15:54:29 2008 +0200
359 > @@ -0,0 +1,1 @@
359 > @@ -0,0 +1,1 @@
360 > +a
360 > +a
361 > EOF
361 > EOF
362 adding foo to series file
362 adding foo to series file
363
363
364 $ hg qpush
364 $ hg qpush
365 applying foo
365 applying foo
366 now at: foo
366 now at: foo
367
367
368 $ cd ..
368 $ cd ..
369 $ linkcp a b
369 $ linkcp a b
370 $ cd b
370 $ cd b
371
371
372 $ hg qimport -n bar - << EOF
372 $ hg qimport -n bar - << EOF
373 > # HG changeset patch
373 > # HG changeset patch
374 > # Date 2 0
374 > # Date 2 0
375 > diff -r 2588a8b53d66 a
375 > diff -r 2588a8b53d66 a
376 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
376 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
377 > +++ b/b Wed Jul 23 15:54:29 2008 +0200
377 > +++ b/b Wed Jul 23 15:54:29 2008 +0200
378 > @@ -0,0 +1,1 @@
378 > @@ -0,0 +1,1 @@
379 > +b
379 > +b
380 > EOF
380 > EOF
381 adding bar to series file
381 adding bar to series file
382
382
383 $ hg qpush
383 $ hg qpush
384 applying bar
384 applying bar
385 now at: bar
385 now at: bar
386
386
387 $ cat .hg/patches/status
387 $ cat .hg/patches/status
388 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
388 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
389 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar
389 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar
390
390
391 $ cat .hg/patches/series
391 $ cat .hg/patches/series
392 foo
392 foo
393 bar
393 bar
394
394
395 $ cat ../a/.hg/patches/status
395 $ cat ../a/.hg/patches/status
396 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
396 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
397
397
398 $ cat ../a/.hg/patches/series
398 $ cat ../a/.hg/patches/series
399 foo
399 foo
400
400
401 Test tags hardlinking:
401 Test tags hardlinking:
402
402
403 $ hg qdel -r qbase:qtip
403 $ hg qdel -r qbase:qtip
404 patch foo finalized without changeset message
404 patch foo finalized without changeset message
405 patch bar finalized without changeset message
405 patch bar finalized without changeset message
406
406
407 $ hg tag -l lfoo
407 $ hg tag -l lfoo
408 $ hg tag foo
408 $ hg tag foo
409
409
410 $ cd ..
410 $ cd ..
411 $ linkcp b c
411 $ linkcp b c
412 $ cd c
412 $ cd c
413
413
414 $ hg tag -l -r 0 lbar
414 $ hg tag -l -r 0 lbar
415 $ hg tag -r 0 bar
415 $ hg tag -r 0 bar
416
416
417 $ cat .hgtags
417 $ cat .hgtags
418 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
418 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
419 430ed4828a74fa4047bc816a25500f7472ab4bfe bar
419 430ed4828a74fa4047bc816a25500f7472ab4bfe bar
420
420
421 $ cat .hg/localtags
421 $ cat .hg/localtags
422 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
422 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
423 430ed4828a74fa4047bc816a25500f7472ab4bfe lbar
423 430ed4828a74fa4047bc816a25500f7472ab4bfe lbar
424
424
425 $ cat ../b/.hgtags
425 $ cat ../b/.hgtags
426 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
426 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
427
427
428 $ cat ../b/.hg/localtags
428 $ cat ../b/.hg/localtags
429 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
429 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
430
430
431 $ cd ..
431 $ cd ..
@@ -1,173 +1,173 b''
1 #require unix-permissions
1 #require unix-permissions
2
2
3 test that new files created in .hg inherit the permissions from .hg/store
3 test that new files created in .hg inherit the permissions from .hg/store
4
4
5 $ mkdir dir
5 $ mkdir dir
6
6
7 just in case somebody has a strange $TMPDIR
7 just in case somebody has a strange $TMPDIR
8
8
9 $ chmod g-s dir
9 $ chmod g-s dir
10 $ cd dir
10 $ cd dir
11
11
12 $ cat >printmodes.py <<EOF
12 $ cat >printmodes.py <<EOF
13 > from __future__ import absolute_import, print_function
13 > from __future__ import absolute_import, print_function
14 > import os
14 > import os
15 > import sys
15 > import sys
16 >
16 >
17 > allnames = []
17 > allnames = []
18 > isdir = {}
18 > isdir = {}
19 > for root, dirs, files in os.walk(sys.argv[1]):
19 > for root, dirs, files in os.walk(sys.argv[1]):
20 > for d in dirs:
20 > for d in dirs:
21 > name = os.path.join(root, d)
21 > name = os.path.join(root, d)
22 > isdir[name] = 1
22 > isdir[name] = 1
23 > allnames.append(name)
23 > allnames.append(name)
24 > for f in files:
24 > for f in files:
25 > name = os.path.join(root, f)
25 > name = os.path.join(root, f)
26 > allnames.append(name)
26 > allnames.append(name)
27 > allnames.sort()
27 > allnames.sort()
28 > for name in allnames:
28 > for name in allnames:
29 > suffix = name in isdir and '/' or ''
29 > suffix = name in isdir and '/' or ''
30 > print('%05o %s%s' % (os.lstat(name).st_mode & 0o7777, name, suffix))
30 > print('%05o %s%s' % (os.lstat(name).st_mode & 0o7777, name, suffix))
31 > EOF
31 > EOF
32
32
33 $ cat >mode.py <<EOF
33 $ cat >mode.py <<EOF
34 > from __future__ import absolute_import, print_function
34 > from __future__ import absolute_import, print_function
35 > import os
35 > import os
36 > import sys
36 > import sys
37 > print('%05o' % os.lstat(sys.argv[1]).st_mode)
37 > print('%05o' % os.lstat(sys.argv[1]).st_mode)
38 > EOF
38 > EOF
39
39
40 $ umask 077
40 $ umask 077
41
41
42 $ hg init repo
42 $ hg init repo
43 $ cd repo
43 $ cd repo
44
44
45 $ chmod 0770 .hg/store
45 $ chmod 0770 .hg/store
46
46
47 before commit
47 before commit
48 store can be written by the group, other files cannot
48 store can be written by the group, other files cannot
49 store is setgid
49 store is setgid
50
50
51 $ $PYTHON ../printmodes.py .
51 $ $PYTHON ../printmodes.py .
52 00700 ./.hg/
52 00700 ./.hg/
53 00600 ./.hg/00changelog.i
53 00600 ./.hg/00changelog.i
54 00600 ./.hg/requires
54 00600 ./.hg/requires
55 00770 ./.hg/store/
55 00770 ./.hg/store/
56
56
57 $ mkdir dir
57 $ mkdir dir
58 $ touch foo dir/bar
58 $ touch foo dir/bar
59 $ hg ci -qAm 'add files'
59 $ hg ci -qAm 'add files'
60
60
61 after commit
61 after commit
62 working dir files can only be written by the owner
62 working dir files can only be written by the owner
63 files created in .hg can be written by the group
63 files created in .hg can be written by the group
64 (in particular, store/**, dirstate, branch cache file, undo files)
64 (in particular, store/**, dirstate, branch cache file, undo files)
65 new directories are setgid
65 new directories are setgid
66
66
67 $ $PYTHON ../printmodes.py .
67 $ $PYTHON ../printmodes.py .
68 00700 ./.hg/
68 00700 ./.hg/
69 00600 ./.hg/00changelog.i
69 00600 ./.hg/00changelog.i
70 00770 ./.hg/cache/
70 00770 ./.hg/cache/
71 00660 ./.hg/cache/branch2-served
71 00660 ./.hg/cache/branch2-served
72 00660 ./.hg/cache/manifestfulltextcache
72 00660 ./.hg/cache/manifestfulltextcache (reporevlogstore !)
73 00660 ./.hg/cache/rbc-names-v1
73 00660 ./.hg/cache/rbc-names-v1
74 00660 ./.hg/cache/rbc-revs-v1
74 00660 ./.hg/cache/rbc-revs-v1
75 00660 ./.hg/dirstate
75 00660 ./.hg/dirstate
76 00660 ./.hg/fsmonitor.state (fsmonitor !)
76 00660 ./.hg/fsmonitor.state (fsmonitor !)
77 00660 ./.hg/last-message.txt
77 00660 ./.hg/last-message.txt
78 00600 ./.hg/requires
78 00600 ./.hg/requires
79 00770 ./.hg/store/
79 00770 ./.hg/store/
80 00660 ./.hg/store/00changelog.i
80 00660 ./.hg/store/00changelog.i
81 00660 ./.hg/store/00manifest.i
81 00660 ./.hg/store/00manifest.i
82 00770 ./.hg/store/data/
82 00770 ./.hg/store/data/
83 00770 ./.hg/store/data/dir/
83 00770 ./.hg/store/data/dir/
84 00660 ./.hg/store/data/dir/bar.i (reporevlogstore !)
84 00660 ./.hg/store/data/dir/bar.i (reporevlogstore !)
85 00660 ./.hg/store/data/foo.i (reporevlogstore !)
85 00660 ./.hg/store/data/foo.i (reporevlogstore !)
86 00770 ./.hg/store/data/dir/bar/ (reposimplestore !)
86 00770 ./.hg/store/data/dir/bar/ (reposimplestore !)
87 00660 ./.hg/store/data/dir/bar/b80de5d138758541c5f05265ad144ab9fa86d1db (reposimplestore !)
87 00660 ./.hg/store/data/dir/bar/b80de5d138758541c5f05265ad144ab9fa86d1db (reposimplestore !)
88 00660 ./.hg/store/data/dir/bar/index (reposimplestore !)
88 00660 ./.hg/store/data/dir/bar/index (reposimplestore !)
89 00770 ./.hg/store/data/foo/ (reposimplestore !)
89 00770 ./.hg/store/data/foo/ (reposimplestore !)
90 00660 ./.hg/store/data/foo/b80de5d138758541c5f05265ad144ab9fa86d1db (reposimplestore !)
90 00660 ./.hg/store/data/foo/b80de5d138758541c5f05265ad144ab9fa86d1db (reposimplestore !)
91 00660 ./.hg/store/data/foo/index (reposimplestore !)
91 00660 ./.hg/store/data/foo/index (reposimplestore !)
92 00660 ./.hg/store/fncache (repofncache !)
92 00660 ./.hg/store/fncache (repofncache !)
93 00660 ./.hg/store/phaseroots
93 00660 ./.hg/store/phaseroots
94 00660 ./.hg/store/undo
94 00660 ./.hg/store/undo
95 00660 ./.hg/store/undo.backupfiles
95 00660 ./.hg/store/undo.backupfiles
96 00660 ./.hg/store/undo.phaseroots
96 00660 ./.hg/store/undo.phaseroots
97 00660 ./.hg/undo.backup.dirstate
97 00660 ./.hg/undo.backup.dirstate
98 00660 ./.hg/undo.bookmarks
98 00660 ./.hg/undo.bookmarks
99 00660 ./.hg/undo.branch
99 00660 ./.hg/undo.branch
100 00660 ./.hg/undo.desc
100 00660 ./.hg/undo.desc
101 00660 ./.hg/undo.dirstate
101 00660 ./.hg/undo.dirstate
102 00700 ./dir/
102 00700 ./dir/
103 00600 ./dir/bar
103 00600 ./dir/bar
104 00600 ./foo
104 00600 ./foo
105
105
106 $ umask 007
106 $ umask 007
107 $ hg init ../push
107 $ hg init ../push
108
108
109 before push
109 before push
110 group can write everything
110 group can write everything
111
111
112 $ $PYTHON ../printmodes.py ../push
112 $ $PYTHON ../printmodes.py ../push
113 00770 ../push/.hg/
113 00770 ../push/.hg/
114 00660 ../push/.hg/00changelog.i
114 00660 ../push/.hg/00changelog.i
115 00660 ../push/.hg/requires
115 00660 ../push/.hg/requires
116 00770 ../push/.hg/store/
116 00770 ../push/.hg/store/
117
117
118 $ umask 077
118 $ umask 077
119 $ hg -q push ../push
119 $ hg -q push ../push
120
120
121 after push
121 after push
122 group can still write everything
122 group can still write everything
123
123
124 $ $PYTHON ../printmodes.py ../push
124 $ $PYTHON ../printmodes.py ../push
125 00770 ../push/.hg/
125 00770 ../push/.hg/
126 00660 ../push/.hg/00changelog.i
126 00660 ../push/.hg/00changelog.i
127 00770 ../push/.hg/cache/
127 00770 ../push/.hg/cache/
128 00660 ../push/.hg/cache/branch2-base
128 00660 ../push/.hg/cache/branch2-base
129 00660 ../push/.hg/dirstate
129 00660 ../push/.hg/dirstate
130 00660 ../push/.hg/requires
130 00660 ../push/.hg/requires
131 00770 ../push/.hg/store/
131 00770 ../push/.hg/store/
132 00660 ../push/.hg/store/00changelog.i
132 00660 ../push/.hg/store/00changelog.i
133 00660 ../push/.hg/store/00manifest.i
133 00660 ../push/.hg/store/00manifest.i
134 00770 ../push/.hg/store/data/
134 00770 ../push/.hg/store/data/
135 00770 ../push/.hg/store/data/dir/
135 00770 ../push/.hg/store/data/dir/
136 00660 ../push/.hg/store/data/dir/bar.i (reporevlogstore !)
136 00660 ../push/.hg/store/data/dir/bar.i (reporevlogstore !)
137 00660 ../push/.hg/store/data/foo.i (reporevlogstore !)
137 00660 ../push/.hg/store/data/foo.i (reporevlogstore !)
138 00770 ../push/.hg/store/data/dir/bar/ (reposimplestore !)
138 00770 ../push/.hg/store/data/dir/bar/ (reposimplestore !)
139 00660 ../push/.hg/store/data/dir/bar/b80de5d138758541c5f05265ad144ab9fa86d1db (reposimplestore !)
139 00660 ../push/.hg/store/data/dir/bar/b80de5d138758541c5f05265ad144ab9fa86d1db (reposimplestore !)
140 00660 ../push/.hg/store/data/dir/bar/index (reposimplestore !)
140 00660 ../push/.hg/store/data/dir/bar/index (reposimplestore !)
141 00770 ../push/.hg/store/data/foo/ (reposimplestore !)
141 00770 ../push/.hg/store/data/foo/ (reposimplestore !)
142 00660 ../push/.hg/store/data/foo/b80de5d138758541c5f05265ad144ab9fa86d1db (reposimplestore !)
142 00660 ../push/.hg/store/data/foo/b80de5d138758541c5f05265ad144ab9fa86d1db (reposimplestore !)
143 00660 ../push/.hg/store/data/foo/index (reposimplestore !)
143 00660 ../push/.hg/store/data/foo/index (reposimplestore !)
144 00660 ../push/.hg/store/fncache (repofncache !)
144 00660 ../push/.hg/store/fncache (repofncache !)
145 00660 ../push/.hg/store/undo
145 00660 ../push/.hg/store/undo
146 00660 ../push/.hg/store/undo.backupfiles
146 00660 ../push/.hg/store/undo.backupfiles
147 00660 ../push/.hg/store/undo.phaseroots
147 00660 ../push/.hg/store/undo.phaseroots
148 00660 ../push/.hg/undo.bookmarks
148 00660 ../push/.hg/undo.bookmarks
149 00660 ../push/.hg/undo.branch
149 00660 ../push/.hg/undo.branch
150 00660 ../push/.hg/undo.desc
150 00660 ../push/.hg/undo.desc
151 00660 ../push/.hg/undo.dirstate
151 00660 ../push/.hg/undo.dirstate
152
152
153
153
154 Test that we don't lose the setgid bit when we call chmod.
154 Test that we don't lose the setgid bit when we call chmod.
155 Not all systems support setgid directories (e.g. HFS+), so
155 Not all systems support setgid directories (e.g. HFS+), so
156 just check that directories have the same mode.
156 just check that directories have the same mode.
157
157
158 $ cd ..
158 $ cd ..
159 $ hg init setgid
159 $ hg init setgid
160 $ cd setgid
160 $ cd setgid
161 $ chmod g+rwx .hg/store
161 $ chmod g+rwx .hg/store
162 $ chmod g+s .hg/store 2> /dev/null || true
162 $ chmod g+s .hg/store 2> /dev/null || true
163 $ mkdir dir
163 $ mkdir dir
164 $ touch dir/file
164 $ touch dir/file
165 $ hg ci -qAm 'add dir/file'
165 $ hg ci -qAm 'add dir/file'
166 $ storemode=`$PYTHON ../mode.py .hg/store`
166 $ storemode=`$PYTHON ../mode.py .hg/store`
167 $ dirmode=`$PYTHON ../mode.py .hg/store/data/dir`
167 $ dirmode=`$PYTHON ../mode.py .hg/store/data/dir`
168 $ if [ "$storemode" != "$dirmode" ]; then
168 $ if [ "$storemode" != "$dirmode" ]; then
169 > echo "$storemode != $dirmode"
169 > echo "$storemode != $dirmode"
170 > fi
170 > fi
171 $ cd ..
171 $ cd ..
172
172
173 $ cd .. # g-s dir
173 $ cd .. # g-s dir
@@ -1,445 +1,445 b''
1 $ echo "[extensions]" >> $HGRCPATH
1 $ echo "[extensions]" >> $HGRCPATH
2 $ echo "share = " >> $HGRCPATH
2 $ echo "share = " >> $HGRCPATH
3
3
4 prepare repo1
4 prepare repo1
5
5
6 $ hg init repo1
6 $ hg init repo1
7 $ cd repo1
7 $ cd repo1
8 $ echo a > a
8 $ echo a > a
9 $ hg commit -A -m'init'
9 $ hg commit -A -m'init'
10 adding a
10 adding a
11
11
12 share it
12 share it
13
13
14 $ cd ..
14 $ cd ..
15 $ hg share repo1 repo2
15 $ hg share repo1 repo2
16 updating working directory
16 updating working directory
17 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
17 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
18
18
19 share shouldn't have a store dir
19 share shouldn't have a store dir
20
20
21 $ cd repo2
21 $ cd repo2
22 $ test -d .hg/store
22 $ test -d .hg/store
23 [1]
23 [1]
24
24
25 share shouldn't have a cache dir, original repo should
25 share shouldn't have a cache dir, original repo should
26
26
27 $ hg branches
27 $ hg branches
28 default 0:d3873e73d99e
28 default 0:d3873e73d99e
29 $ hg tags
29 $ hg tags
30 tip 0:d3873e73d99e
30 tip 0:d3873e73d99e
31 $ test -d .hg/cache
31 $ test -d .hg/cache
32 [1]
32 [1]
33 $ ls -1 ../repo1/.hg/cache
33 $ ls -1 ../repo1/.hg/cache
34 branch2-served
34 branch2-served
35 manifestfulltextcache
35 manifestfulltextcache (reporevlogstore !)
36 rbc-names-v1
36 rbc-names-v1
37 rbc-revs-v1
37 rbc-revs-v1
38 tags2-visible
38 tags2-visible
39
39
40 Some sed versions appends newline, some don't, and some just fails
40 Some sed versions appends newline, some don't, and some just fails
41
41
42 $ cat .hg/sharedpath; echo
42 $ cat .hg/sharedpath; echo
43 $TESTTMP/repo1/.hg
43 $TESTTMP/repo1/.hg
44
44
45 trailing newline on .hg/sharedpath is ok
45 trailing newline on .hg/sharedpath is ok
46 $ hg tip -q
46 $ hg tip -q
47 0:d3873e73d99e
47 0:d3873e73d99e
48 $ echo '' >> .hg/sharedpath
48 $ echo '' >> .hg/sharedpath
49 $ cat .hg/sharedpath
49 $ cat .hg/sharedpath
50 $TESTTMP/repo1/.hg
50 $TESTTMP/repo1/.hg
51 $ hg tip -q
51 $ hg tip -q
52 0:d3873e73d99e
52 0:d3873e73d99e
53
53
54 commit in shared clone
54 commit in shared clone
55
55
56 $ echo a >> a
56 $ echo a >> a
57 $ hg commit -m'change in shared clone'
57 $ hg commit -m'change in shared clone'
58
58
59 check original
59 check original
60
60
61 $ cd ../repo1
61 $ cd ../repo1
62 $ hg log
62 $ hg log
63 changeset: 1:8af4dc49db9e
63 changeset: 1:8af4dc49db9e
64 tag: tip
64 tag: tip
65 user: test
65 user: test
66 date: Thu Jan 01 00:00:00 1970 +0000
66 date: Thu Jan 01 00:00:00 1970 +0000
67 summary: change in shared clone
67 summary: change in shared clone
68
68
69 changeset: 0:d3873e73d99e
69 changeset: 0:d3873e73d99e
70 user: test
70 user: test
71 date: Thu Jan 01 00:00:00 1970 +0000
71 date: Thu Jan 01 00:00:00 1970 +0000
72 summary: init
72 summary: init
73
73
74 $ hg update
74 $ hg update
75 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
75 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
76 $ cat a # should be two lines of "a"
76 $ cat a # should be two lines of "a"
77 a
77 a
78 a
78 a
79
79
80 commit in original
80 commit in original
81
81
82 $ echo b > b
82 $ echo b > b
83 $ hg commit -A -m'another file'
83 $ hg commit -A -m'another file'
84 adding b
84 adding b
85
85
86 check in shared clone
86 check in shared clone
87
87
88 $ cd ../repo2
88 $ cd ../repo2
89 $ hg log
89 $ hg log
90 changeset: 2:c2e0ac586386
90 changeset: 2:c2e0ac586386
91 tag: tip
91 tag: tip
92 user: test
92 user: test
93 date: Thu Jan 01 00:00:00 1970 +0000
93 date: Thu Jan 01 00:00:00 1970 +0000
94 summary: another file
94 summary: another file
95
95
96 changeset: 1:8af4dc49db9e
96 changeset: 1:8af4dc49db9e
97 user: test
97 user: test
98 date: Thu Jan 01 00:00:00 1970 +0000
98 date: Thu Jan 01 00:00:00 1970 +0000
99 summary: change in shared clone
99 summary: change in shared clone
100
100
101 changeset: 0:d3873e73d99e
101 changeset: 0:d3873e73d99e
102 user: test
102 user: test
103 date: Thu Jan 01 00:00:00 1970 +0000
103 date: Thu Jan 01 00:00:00 1970 +0000
104 summary: init
104 summary: init
105
105
106 $ hg update
106 $ hg update
107 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
107 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
108 $ cat b # should exist with one "b"
108 $ cat b # should exist with one "b"
109 b
109 b
110
110
111 hg serve shared clone
111 hg serve shared clone
112
112
113 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid
113 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid
114 $ cat hg.pid >> $DAEMON_PIDS
114 $ cat hg.pid >> $DAEMON_PIDS
115 $ get-with-headers.py localhost:$HGPORT 'raw-file/'
115 $ get-with-headers.py localhost:$HGPORT 'raw-file/'
116 200 Script output follows
116 200 Script output follows
117
117
118
118
119 -rw-r--r-- 4 a
119 -rw-r--r-- 4 a
120 -rw-r--r-- 2 b
120 -rw-r--r-- 2 b
121
121
122
122
123
123
124 test unshare command
124 test unshare command
125
125
126 $ hg unshare
126 $ hg unshare
127 $ test -d .hg/store
127 $ test -d .hg/store
128 $ test -f .hg/sharedpath
128 $ test -f .hg/sharedpath
129 [1]
129 [1]
130 $ grep shared .hg/requires
130 $ grep shared .hg/requires
131 [1]
131 [1]
132 $ hg unshare
132 $ hg unshare
133 abort: this is not a shared repo
133 abort: this is not a shared repo
134 [255]
134 [255]
135
135
136 check that a change does not propagate
136 check that a change does not propagate
137
137
138 $ echo b >> b
138 $ echo b >> b
139 $ hg commit -m'change in unshared'
139 $ hg commit -m'change in unshared'
140 $ cd ../repo1
140 $ cd ../repo1
141 $ hg id -r tip
141 $ hg id -r tip
142 c2e0ac586386 tip
142 c2e0ac586386 tip
143
143
144 $ cd ..
144 $ cd ..
145
145
146
146
147 test sharing bookmarks
147 test sharing bookmarks
148
148
149 $ hg share -B repo1 repo3
149 $ hg share -B repo1 repo3
150 updating working directory
150 updating working directory
151 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
151 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
152 $ cd repo1
152 $ cd repo1
153 $ hg bookmark bm1
153 $ hg bookmark bm1
154 $ hg bookmarks
154 $ hg bookmarks
155 * bm1 2:c2e0ac586386
155 * bm1 2:c2e0ac586386
156 $ cd ../repo2
156 $ cd ../repo2
157 $ hg book bm2
157 $ hg book bm2
158 $ hg bookmarks
158 $ hg bookmarks
159 * bm2 3:0e6e70d1d5f1
159 * bm2 3:0e6e70d1d5f1
160 $ cd ../repo3
160 $ cd ../repo3
161 $ hg bookmarks
161 $ hg bookmarks
162 bm1 2:c2e0ac586386
162 bm1 2:c2e0ac586386
163 $ hg book bm3
163 $ hg book bm3
164 $ hg bookmarks
164 $ hg bookmarks
165 bm1 2:c2e0ac586386
165 bm1 2:c2e0ac586386
166 * bm3 2:c2e0ac586386
166 * bm3 2:c2e0ac586386
167 $ cd ../repo1
167 $ cd ../repo1
168 $ hg bookmarks
168 $ hg bookmarks
169 * bm1 2:c2e0ac586386
169 * bm1 2:c2e0ac586386
170 bm3 2:c2e0ac586386
170 bm3 2:c2e0ac586386
171
171
172 check whether HG_PENDING makes pending changes only in relatd
172 check whether HG_PENDING makes pending changes only in relatd
173 repositories visible to an external hook.
173 repositories visible to an external hook.
174
174
175 In "hg share" case, another transaction can't run in other
175 In "hg share" case, another transaction can't run in other
176 repositories sharing same source repository, because starting
176 repositories sharing same source repository, because starting
177 transaction requires locking store of source repository.
177 transaction requires locking store of source repository.
178
178
179 Therefore, this test scenario ignores checking visibility of
179 Therefore, this test scenario ignores checking visibility of
180 .hg/bookmakrs.pending in repo2, which shares repo1 without bookmarks.
180 .hg/bookmakrs.pending in repo2, which shares repo1 without bookmarks.
181
181
182 $ cat > $TESTTMP/checkbookmarks.sh <<EOF
182 $ cat > $TESTTMP/checkbookmarks.sh <<EOF
183 > echo "@repo1"
183 > echo "@repo1"
184 > hg -R "$TESTTMP/repo1" bookmarks
184 > hg -R "$TESTTMP/repo1" bookmarks
185 > echo "@repo2"
185 > echo "@repo2"
186 > hg -R "$TESTTMP/repo2" bookmarks
186 > hg -R "$TESTTMP/repo2" bookmarks
187 > echo "@repo3"
187 > echo "@repo3"
188 > hg -R "$TESTTMP/repo3" bookmarks
188 > hg -R "$TESTTMP/repo3" bookmarks
189 > exit 1 # to avoid adding new bookmark for subsequent tests
189 > exit 1 # to avoid adding new bookmark for subsequent tests
190 > EOF
190 > EOF
191
191
192 $ cd ../repo1
192 $ cd ../repo1
193 $ hg --config hooks.pretxnclose="sh $TESTTMP/checkbookmarks.sh" -q book bmX
193 $ hg --config hooks.pretxnclose="sh $TESTTMP/checkbookmarks.sh" -q book bmX
194 @repo1
194 @repo1
195 bm1 2:c2e0ac586386
195 bm1 2:c2e0ac586386
196 bm3 2:c2e0ac586386
196 bm3 2:c2e0ac586386
197 * bmX 2:c2e0ac586386
197 * bmX 2:c2e0ac586386
198 @repo2
198 @repo2
199 * bm2 3:0e6e70d1d5f1
199 * bm2 3:0e6e70d1d5f1
200 @repo3
200 @repo3
201 bm1 2:c2e0ac586386
201 bm1 2:c2e0ac586386
202 * bm3 2:c2e0ac586386
202 * bm3 2:c2e0ac586386
203 bmX 2:c2e0ac586386
203 bmX 2:c2e0ac586386
204 transaction abort!
204 transaction abort!
205 rollback completed
205 rollback completed
206 abort: pretxnclose hook exited with status 1
206 abort: pretxnclose hook exited with status 1
207 [255]
207 [255]
208 $ hg book bm1
208 $ hg book bm1
209
209
210 FYI, in contrast to above test, bmX is invisible in repo1 (= shared
210 FYI, in contrast to above test, bmX is invisible in repo1 (= shared
211 src), because (1) HG_PENDING refers only repo3 and (2)
211 src), because (1) HG_PENDING refers only repo3 and (2)
212 "bookmarks.pending" is written only into repo3.
212 "bookmarks.pending" is written only into repo3.
213
213
214 $ cd ../repo3
214 $ cd ../repo3
215 $ hg --config hooks.pretxnclose="sh $TESTTMP/checkbookmarks.sh" -q book bmX
215 $ hg --config hooks.pretxnclose="sh $TESTTMP/checkbookmarks.sh" -q book bmX
216 @repo1
216 @repo1
217 * bm1 2:c2e0ac586386
217 * bm1 2:c2e0ac586386
218 bm3 2:c2e0ac586386
218 bm3 2:c2e0ac586386
219 @repo2
219 @repo2
220 * bm2 3:0e6e70d1d5f1
220 * bm2 3:0e6e70d1d5f1
221 @repo3
221 @repo3
222 bm1 2:c2e0ac586386
222 bm1 2:c2e0ac586386
223 bm3 2:c2e0ac586386
223 bm3 2:c2e0ac586386
224 * bmX 2:c2e0ac586386
224 * bmX 2:c2e0ac586386
225 transaction abort!
225 transaction abort!
226 rollback completed
226 rollback completed
227 abort: pretxnclose hook exited with status 1
227 abort: pretxnclose hook exited with status 1
228 [255]
228 [255]
229 $ hg book bm3
229 $ hg book bm3
230
230
231 $ cd ../repo1
231 $ cd ../repo1
232
232
233 test that commits work
233 test that commits work
234
234
235 $ echo 'shared bookmarks' > a
235 $ echo 'shared bookmarks' > a
236 $ hg commit -m 'testing shared bookmarks'
236 $ hg commit -m 'testing shared bookmarks'
237 $ hg bookmarks
237 $ hg bookmarks
238 * bm1 3:b87954705719
238 * bm1 3:b87954705719
239 bm3 2:c2e0ac586386
239 bm3 2:c2e0ac586386
240 $ cd ../repo3
240 $ cd ../repo3
241 $ hg bookmarks
241 $ hg bookmarks
242 bm1 3:b87954705719
242 bm1 3:b87954705719
243 * bm3 2:c2e0ac586386
243 * bm3 2:c2e0ac586386
244 $ echo 'more shared bookmarks' > a
244 $ echo 'more shared bookmarks' > a
245 $ hg commit -m 'testing shared bookmarks'
245 $ hg commit -m 'testing shared bookmarks'
246 created new head
246 created new head
247 $ hg bookmarks
247 $ hg bookmarks
248 bm1 3:b87954705719
248 bm1 3:b87954705719
249 * bm3 4:62f4ded848e4
249 * bm3 4:62f4ded848e4
250 $ cd ../repo1
250 $ cd ../repo1
251 $ hg bookmarks
251 $ hg bookmarks
252 * bm1 3:b87954705719
252 * bm1 3:b87954705719
253 bm3 4:62f4ded848e4
253 bm3 4:62f4ded848e4
254 $ cd ..
254 $ cd ..
255
255
256 non largefiles repos won't enable largefiles
256 non largefiles repos won't enable largefiles
257
257
258 $ hg share --config extensions.largefiles= repo3 sharedrepo
258 $ hg share --config extensions.largefiles= repo3 sharedrepo
259 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
259 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
260 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
260 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
261 updating working directory
261 updating working directory
262 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
262 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
263 $ [ -f sharedrepo/.hg/hgrc ]
263 $ [ -f sharedrepo/.hg/hgrc ]
264 [1]
264 [1]
265
265
266 test pushing bookmarks works
266 test pushing bookmarks works
267
267
268 $ hg clone repo3 repo4
268 $ hg clone repo3 repo4
269 updating to branch default
269 updating to branch default
270 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
270 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
271 $ cd repo4
271 $ cd repo4
272 $ hg boo bm4
272 $ hg boo bm4
273 $ echo foo > b
273 $ echo foo > b
274 $ hg commit -m 'foo in b'
274 $ hg commit -m 'foo in b'
275 $ hg boo
275 $ hg boo
276 bm1 3:b87954705719
276 bm1 3:b87954705719
277 bm3 4:62f4ded848e4
277 bm3 4:62f4ded848e4
278 * bm4 5:92793bfc8cad
278 * bm4 5:92793bfc8cad
279 $ hg push -B bm4
279 $ hg push -B bm4
280 pushing to $TESTTMP/repo3
280 pushing to $TESTTMP/repo3
281 searching for changes
281 searching for changes
282 adding changesets
282 adding changesets
283 adding manifests
283 adding manifests
284 adding file changes
284 adding file changes
285 added 1 changesets with 1 changes to 1 files
285 added 1 changesets with 1 changes to 1 files
286 exporting bookmark bm4
286 exporting bookmark bm4
287 $ cd ../repo1
287 $ cd ../repo1
288 $ hg bookmarks
288 $ hg bookmarks
289 * bm1 3:b87954705719
289 * bm1 3:b87954705719
290 bm3 4:62f4ded848e4
290 bm3 4:62f4ded848e4
291 bm4 5:92793bfc8cad
291 bm4 5:92793bfc8cad
292 $ cd ../repo3
292 $ cd ../repo3
293 $ hg bookmarks
293 $ hg bookmarks
294 bm1 3:b87954705719
294 bm1 3:b87954705719
295 * bm3 4:62f4ded848e4
295 * bm3 4:62f4ded848e4
296 bm4 5:92793bfc8cad
296 bm4 5:92793bfc8cad
297 $ cd ..
297 $ cd ..
298
298
299 test behavior when sharing a shared repo
299 test behavior when sharing a shared repo
300
300
301 $ hg share -B repo3 missingdir/repo5
301 $ hg share -B repo3 missingdir/repo5
302 updating working directory
302 updating working directory
303 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
303 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
304 $ cd missingdir/repo5
304 $ cd missingdir/repo5
305 $ hg book
305 $ hg book
306 bm1 3:b87954705719
306 bm1 3:b87954705719
307 bm3 4:62f4ded848e4
307 bm3 4:62f4ded848e4
308 bm4 5:92793bfc8cad
308 bm4 5:92793bfc8cad
309 $ cd ../..
309 $ cd ../..
310
310
311 test what happens when an active bookmark is deleted
311 test what happens when an active bookmark is deleted
312
312
313 $ cd repo1
313 $ cd repo1
314 $ hg boo -d bm3
314 $ hg boo -d bm3
315 $ hg boo
315 $ hg boo
316 * bm1 3:b87954705719
316 * bm1 3:b87954705719
317 bm4 5:92793bfc8cad
317 bm4 5:92793bfc8cad
318 $ cd ../repo3
318 $ cd ../repo3
319 $ hg boo
319 $ hg boo
320 bm1 3:b87954705719
320 bm1 3:b87954705719
321 bm4 5:92793bfc8cad
321 bm4 5:92793bfc8cad
322 $ cd ..
322 $ cd ..
323
323
324 verify that bookmarks are not written on failed transaction
324 verify that bookmarks are not written on failed transaction
325
325
326 $ cat > failpullbookmarks.py << EOF
326 $ cat > failpullbookmarks.py << EOF
327 > """A small extension that makes bookmark pulls fail, for testing"""
327 > """A small extension that makes bookmark pulls fail, for testing"""
328 > from __future__ import absolute_import
328 > from __future__ import absolute_import
329 > from mercurial import (
329 > from mercurial import (
330 > error,
330 > error,
331 > exchange,
331 > exchange,
332 > extensions,
332 > extensions,
333 > )
333 > )
334 > def _pullbookmarks(orig, pullop):
334 > def _pullbookmarks(orig, pullop):
335 > orig(pullop)
335 > orig(pullop)
336 > raise error.HookAbort('forced failure by extension')
336 > raise error.HookAbort('forced failure by extension')
337 > def extsetup(ui):
337 > def extsetup(ui):
338 > extensions.wrapfunction(exchange, '_pullbookmarks', _pullbookmarks)
338 > extensions.wrapfunction(exchange, '_pullbookmarks', _pullbookmarks)
339 > EOF
339 > EOF
340 $ cd repo4
340 $ cd repo4
341 $ hg boo
341 $ hg boo
342 bm1 3:b87954705719
342 bm1 3:b87954705719
343 bm3 4:62f4ded848e4
343 bm3 4:62f4ded848e4
344 * bm4 5:92793bfc8cad
344 * bm4 5:92793bfc8cad
345 $ cd ../repo3
345 $ cd ../repo3
346 $ hg boo
346 $ hg boo
347 bm1 3:b87954705719
347 bm1 3:b87954705719
348 bm4 5:92793bfc8cad
348 bm4 5:92793bfc8cad
349 $ hg --config "extensions.failpullbookmarks=$TESTTMP/failpullbookmarks.py" pull $TESTTMP/repo4
349 $ hg --config "extensions.failpullbookmarks=$TESTTMP/failpullbookmarks.py" pull $TESTTMP/repo4
350 pulling from $TESTTMP/repo4
350 pulling from $TESTTMP/repo4
351 searching for changes
351 searching for changes
352 no changes found
352 no changes found
353 adding remote bookmark bm3
353 adding remote bookmark bm3
354 abort: forced failure by extension
354 abort: forced failure by extension
355 [255]
355 [255]
356 $ hg boo
356 $ hg boo
357 bm1 3:b87954705719
357 bm1 3:b87954705719
358 bm4 5:92793bfc8cad
358 bm4 5:92793bfc8cad
359 $ hg pull $TESTTMP/repo4
359 $ hg pull $TESTTMP/repo4
360 pulling from $TESTTMP/repo4
360 pulling from $TESTTMP/repo4
361 searching for changes
361 searching for changes
362 no changes found
362 no changes found
363 adding remote bookmark bm3
363 adding remote bookmark bm3
364 1 local changesets published
364 1 local changesets published
365 $ hg boo
365 $ hg boo
366 bm1 3:b87954705719
366 bm1 3:b87954705719
367 * bm3 4:62f4ded848e4
367 * bm3 4:62f4ded848e4
368 bm4 5:92793bfc8cad
368 bm4 5:92793bfc8cad
369 $ cd ..
369 $ cd ..
370
370
371 verify bookmark behavior after unshare
371 verify bookmark behavior after unshare
372
372
373 $ cd repo3
373 $ cd repo3
374 $ hg unshare
374 $ hg unshare
375 $ hg boo
375 $ hg boo
376 bm1 3:b87954705719
376 bm1 3:b87954705719
377 * bm3 4:62f4ded848e4
377 * bm3 4:62f4ded848e4
378 bm4 5:92793bfc8cad
378 bm4 5:92793bfc8cad
379 $ hg boo -d bm4
379 $ hg boo -d bm4
380 $ hg boo bm5
380 $ hg boo bm5
381 $ hg boo
381 $ hg boo
382 bm1 3:b87954705719
382 bm1 3:b87954705719
383 bm3 4:62f4ded848e4
383 bm3 4:62f4ded848e4
384 * bm5 4:62f4ded848e4
384 * bm5 4:62f4ded848e4
385 $ cd ../repo1
385 $ cd ../repo1
386 $ hg boo
386 $ hg boo
387 * bm1 3:b87954705719
387 * bm1 3:b87954705719
388 bm3 4:62f4ded848e4
388 bm3 4:62f4ded848e4
389 bm4 5:92793bfc8cad
389 bm4 5:92793bfc8cad
390 $ cd ..
390 $ cd ..
391
391
392 test shared clones using relative paths work
392 test shared clones using relative paths work
393
393
394 $ mkdir thisdir
394 $ mkdir thisdir
395 $ hg init thisdir/orig
395 $ hg init thisdir/orig
396 $ hg share -U thisdir/orig thisdir/abs
396 $ hg share -U thisdir/orig thisdir/abs
397 $ hg share -U --relative thisdir/abs thisdir/rel
397 $ hg share -U --relative thisdir/abs thisdir/rel
398 $ cat thisdir/rel/.hg/sharedpath
398 $ cat thisdir/rel/.hg/sharedpath
399 ../../orig/.hg (no-eol)
399 ../../orig/.hg (no-eol)
400 $ grep shared thisdir/*/.hg/requires
400 $ grep shared thisdir/*/.hg/requires
401 thisdir/abs/.hg/requires:shared
401 thisdir/abs/.hg/requires:shared
402 thisdir/rel/.hg/requires:shared
402 thisdir/rel/.hg/requires:shared
403 thisdir/rel/.hg/requires:relshared
403 thisdir/rel/.hg/requires:relshared
404
404
405 test that relative shared paths aren't relative to $PWD
405 test that relative shared paths aren't relative to $PWD
406
406
407 $ cd thisdir
407 $ cd thisdir
408 $ hg -R rel root
408 $ hg -R rel root
409 $TESTTMP/thisdir/rel
409 $TESTTMP/thisdir/rel
410 $ cd ..
410 $ cd ..
411
411
412 now test that relative paths really are relative, survive across
412 now test that relative paths really are relative, survive across
413 renames and changes of PWD
413 renames and changes of PWD
414
414
415 $ hg -R thisdir/abs root
415 $ hg -R thisdir/abs root
416 $TESTTMP/thisdir/abs
416 $TESTTMP/thisdir/abs
417 $ hg -R thisdir/rel root
417 $ hg -R thisdir/rel root
418 $TESTTMP/thisdir/rel
418 $TESTTMP/thisdir/rel
419 $ mv thisdir thatdir
419 $ mv thisdir thatdir
420 $ hg -R thatdir/abs root
420 $ hg -R thatdir/abs root
421 abort: .hg/sharedpath points to nonexistent directory $TESTTMP/thisdir/orig/.hg!
421 abort: .hg/sharedpath points to nonexistent directory $TESTTMP/thisdir/orig/.hg!
422 [255]
422 [255]
423 $ hg -R thatdir/rel root
423 $ hg -R thatdir/rel root
424 $TESTTMP/thatdir/rel
424 $TESTTMP/thatdir/rel
425
425
426 test unshare relshared repo
426 test unshare relshared repo
427
427
428 $ cd thatdir/rel
428 $ cd thatdir/rel
429 $ hg unshare
429 $ hg unshare
430 $ test -d .hg/store
430 $ test -d .hg/store
431 $ test -f .hg/sharedpath
431 $ test -f .hg/sharedpath
432 [1]
432 [1]
433 $ grep shared .hg/requires
433 $ grep shared .hg/requires
434 [1]
434 [1]
435 $ hg unshare
435 $ hg unshare
436 abort: this is not a shared repo
436 abort: this is not a shared repo
437 [255]
437 [255]
438 $ cd ../..
438 $ cd ../..
439
439
440 $ rm -r thatdir
440 $ rm -r thatdir
441
441
442 Explicitly kill daemons to let the test exit on Windows
442 Explicitly kill daemons to let the test exit on Windows
443
443
444 $ killdaemons.py
444 $ killdaemons.py
445
445
General Comments 0
You need to be logged in to leave comments. Login now