##// END OF EJS Templates
test: unquiet few tests to demonstrate changes in upcoming patches...
Pulkit Goyal -
r47095:8b02f132 default
parent child Browse files
Show More
@@ -1,574 +1,626
1 setup
1 setup
2
2
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
4 > [extensions]
5 > share =
5 > share =
6 > [format]
6 > [format]
7 > use-share-safe = True
7 > use-share-safe = True
8 > [storage]
8 > [storage]
9 > revlog.persistent-nodemap.slow-path=allow
9 > revlog.persistent-nodemap.slow-path=allow
10 > EOF
10 > EOF
11
11
12 prepare source repo
12 prepare source repo
13
13
14 $ hg init source
14 $ hg init source
15 $ cd source
15 $ cd source
16 $ cat .hg/requires
16 $ cat .hg/requires
17 share-safe
17 share-safe
18 $ cat .hg/store/requires
18 $ cat .hg/store/requires
19 dotencode
19 dotencode
20 fncache
20 fncache
21 generaldelta
21 generaldelta
22 revlogv1
22 revlogv1
23 sparserevlog
23 sparserevlog
24 store
24 store
25 $ hg debugrequirements
25 $ hg debugrequirements
26 dotencode
26 dotencode
27 fncache
27 fncache
28 generaldelta
28 generaldelta
29 revlogv1
29 revlogv1
30 share-safe
30 share-safe
31 sparserevlog
31 sparserevlog
32 store
32 store
33
33
34 $ echo a > a
34 $ echo a > a
35 $ hg ci -Aqm "added a"
35 $ hg ci -Aqm "added a"
36 $ echo b > b
36 $ echo b > b
37 $ hg ci -Aqm "added b"
37 $ hg ci -Aqm "added b"
38
38
39 $ HGEDITOR=cat hg config --shared
39 $ HGEDITOR=cat hg config --shared
40 abort: repository is not shared; can't use --shared
40 abort: repository is not shared; can't use --shared
41 [10]
41 [10]
42 $ cd ..
42 $ cd ..
43
43
44 Create a shared repo and check the requirements are shared and read correctly
44 Create a shared repo and check the requirements are shared and read correctly
45 $ hg share source shared1
45 $ hg share source shared1
46 updating working directory
46 updating working directory
47 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
47 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
48 $ cd shared1
48 $ cd shared1
49 $ cat .hg/requires
49 $ cat .hg/requires
50 share-safe
50 share-safe
51 shared
51 shared
52
52
53 $ hg debugrequirements -R ../source
53 $ hg debugrequirements -R ../source
54 dotencode
54 dotencode
55 fncache
55 fncache
56 generaldelta
56 generaldelta
57 revlogv1
57 revlogv1
58 share-safe
58 share-safe
59 sparserevlog
59 sparserevlog
60 store
60 store
61
61
62 $ hg debugrequirements
62 $ hg debugrequirements
63 dotencode
63 dotencode
64 fncache
64 fncache
65 generaldelta
65 generaldelta
66 revlogv1
66 revlogv1
67 share-safe
67 share-safe
68 shared
68 shared
69 sparserevlog
69 sparserevlog
70 store
70 store
71
71
72 $ echo c > c
72 $ echo c > c
73 $ hg ci -Aqm "added c"
73 $ hg ci -Aqm "added c"
74
74
75 Check that config of the source repository is also loaded
75 Check that config of the source repository is also loaded
76
76
77 $ hg showconfig ui.curses
77 $ hg showconfig ui.curses
78 [1]
78 [1]
79
79
80 $ echo "[ui]" >> ../source/.hg/hgrc
80 $ echo "[ui]" >> ../source/.hg/hgrc
81 $ echo "curses=true" >> ../source/.hg/hgrc
81 $ echo "curses=true" >> ../source/.hg/hgrc
82
82
83 $ hg showconfig ui.curses
83 $ hg showconfig ui.curses
84 true
84 true
85
85
86 Test that extensions of source repository are also loaded
86 Test that extensions of source repository are also loaded
87
87
88 $ hg debugextensions
88 $ hg debugextensions
89 share
89 share
90 $ hg extdiff -p echo
90 $ hg extdiff -p echo
91 hg: unknown command 'extdiff'
91 hg: unknown command 'extdiff'
92 'extdiff' is provided by the following extension:
92 'extdiff' is provided by the following extension:
93
93
94 extdiff command to allow external programs to compare revisions
94 extdiff command to allow external programs to compare revisions
95
95
96 (use 'hg help extensions' for information on enabling extensions)
96 (use 'hg help extensions' for information on enabling extensions)
97 [10]
97 [10]
98
98
99 $ echo "[extensions]" >> ../source/.hg/hgrc
99 $ echo "[extensions]" >> ../source/.hg/hgrc
100 $ echo "extdiff=" >> ../source/.hg/hgrc
100 $ echo "extdiff=" >> ../source/.hg/hgrc
101
101
102 $ hg debugextensions -R ../source
102 $ hg debugextensions -R ../source
103 extdiff
103 extdiff
104 share
104 share
105 $ hg extdiff -R ../source -p echo
105 $ hg extdiff -R ../source -p echo
106
106
107 BROKEN: the command below will not work if config of shared source is not loaded
107 BROKEN: the command below will not work if config of shared source is not loaded
108 on dispatch but debugextensions says that extension
108 on dispatch but debugextensions says that extension
109 is loaded
109 is loaded
110 $ hg debugextensions
110 $ hg debugextensions
111 extdiff
111 extdiff
112 share
112 share
113
113
114 $ hg extdiff -p echo
114 $ hg extdiff -p echo
115
115
116 However, local .hg/hgrc should override the config set by share source
116 However, local .hg/hgrc should override the config set by share source
117
117
118 $ echo "[ui]" >> .hg/hgrc
118 $ echo "[ui]" >> .hg/hgrc
119 $ echo "curses=false" >> .hg/hgrc
119 $ echo "curses=false" >> .hg/hgrc
120
120
121 $ hg showconfig ui.curses
121 $ hg showconfig ui.curses
122 false
122 false
123
123
124 $ HGEDITOR=cat hg config --shared
124 $ HGEDITOR=cat hg config --shared
125 [ui]
125 [ui]
126 curses=true
126 curses=true
127 [extensions]
127 [extensions]
128 extdiff=
128 extdiff=
129
129
130 $ HGEDITOR=cat hg config --local
130 $ HGEDITOR=cat hg config --local
131 [ui]
131 [ui]
132 curses=false
132 curses=false
133
133
134 Testing that hooks set in source repository also runs in shared repo
134 Testing that hooks set in source repository also runs in shared repo
135
135
136 $ cd ../source
136 $ cd ../source
137 $ cat <<EOF >> .hg/hgrc
137 $ cat <<EOF >> .hg/hgrc
138 > [extensions]
138 > [extensions]
139 > hooklib=
139 > hooklib=
140 > [hooks]
140 > [hooks]
141 > pretxnchangegroup.reject_merge_commits = \
141 > pretxnchangegroup.reject_merge_commits = \
142 > python:hgext.hooklib.reject_merge_commits.hook
142 > python:hgext.hooklib.reject_merge_commits.hook
143 > EOF
143 > EOF
144
144
145 $ cd ..
145 $ cd ..
146 $ hg clone source cloned
146 $ hg clone source cloned
147 updating to branch default
147 updating to branch default
148 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
148 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
149 $ cd cloned
149 $ cd cloned
150 $ hg up 0
150 $ hg up 0
151 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
151 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
152 $ echo bar > bar
152 $ echo bar > bar
153 $ hg ci -Aqm "added bar"
153 $ hg ci -Aqm "added bar"
154 $ hg merge
154 $ hg merge
155 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
155 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
156 (branch merge, don't forget to commit)
156 (branch merge, don't forget to commit)
157 $ hg ci -m "merge commit"
157 $ hg ci -m "merge commit"
158
158
159 $ hg push ../source
159 $ hg push ../source
160 pushing to ../source
160 pushing to ../source
161 searching for changes
161 searching for changes
162 adding changesets
162 adding changesets
163 adding manifests
163 adding manifests
164 adding file changes
164 adding file changes
165 error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
165 error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
166 transaction abort!
166 transaction abort!
167 rollback completed
167 rollback completed
168 abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
168 abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
169 [255]
169 [255]
170
170
171 $ hg push ../shared1
171 $ hg push ../shared1
172 pushing to ../shared1
172 pushing to ../shared1
173 searching for changes
173 searching for changes
174 adding changesets
174 adding changesets
175 adding manifests
175 adding manifests
176 adding file changes
176 adding file changes
177 error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
177 error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
178 transaction abort!
178 transaction abort!
179 rollback completed
179 rollback completed
180 abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
180 abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
181 [255]
181 [255]
182
182
183 Test that if share source config is untrusted, we dont read it
183 Test that if share source config is untrusted, we dont read it
184
184
185 $ cd ../shared1
185 $ cd ../shared1
186
186
187 $ cat << EOF > $TESTTMP/untrusted.py
187 $ cat << EOF > $TESTTMP/untrusted.py
188 > from mercurial import scmutil, util
188 > from mercurial import scmutil, util
189 > def uisetup(ui):
189 > def uisetup(ui):
190 > class untrustedui(ui.__class__):
190 > class untrustedui(ui.__class__):
191 > def _trusted(self, fp, f):
191 > def _trusted(self, fp, f):
192 > if util.normpath(fp.name).endswith(b'source/.hg/hgrc'):
192 > if util.normpath(fp.name).endswith(b'source/.hg/hgrc'):
193 > return False
193 > return False
194 > return super(untrustedui, self)._trusted(fp, f)
194 > return super(untrustedui, self)._trusted(fp, f)
195 > ui.__class__ = untrustedui
195 > ui.__class__ = untrustedui
196 > EOF
196 > EOF
197
197
198 $ hg showconfig hooks
198 $ hg showconfig hooks
199 hooks.pretxnchangegroup.reject_merge_commits=python:hgext.hooklib.reject_merge_commits.hook
199 hooks.pretxnchangegroup.reject_merge_commits=python:hgext.hooklib.reject_merge_commits.hook
200
200
201 $ hg showconfig hooks --config extensions.untrusted=$TESTTMP/untrusted.py
201 $ hg showconfig hooks --config extensions.untrusted=$TESTTMP/untrusted.py
202 [1]
202 [1]
203
203
204 Update the source repository format and check that shared repo works
204 Update the source repository format and check that shared repo works
205
205
206 $ cd ../source
206 $ cd ../source
207
207
208 Disable zstd related tests because its not present on pure version
208 Disable zstd related tests because its not present on pure version
209 #if zstd
209 #if zstd
210 $ echo "[format]" >> .hg/hgrc
210 $ echo "[format]" >> .hg/hgrc
211 $ echo "revlog-compression=zstd" >> .hg/hgrc
211 $ echo "revlog-compression=zstd" >> .hg/hgrc
212
212
213 $ hg debugupgraderepo --run -q
213 $ hg debugupgraderepo --run -q
214 upgrade will perform the following actions:
214 upgrade will perform the following actions:
215
215
216 requirements
216 requirements
217 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store
217 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store
218 added: revlog-compression-zstd
218 added: revlog-compression-zstd
219
219
220 processed revlogs:
220 processed revlogs:
221 - all-filelogs
221 - all-filelogs
222 - changelog
222 - changelog
223 - manifest
223 - manifest
224
224
225 $ hg log -r .
225 $ hg log -r .
226 changeset: 1:5f6d8a4bf34a
226 changeset: 1:5f6d8a4bf34a
227 user: test
227 user: test
228 date: Thu Jan 01 00:00:00 1970 +0000
228 date: Thu Jan 01 00:00:00 1970 +0000
229 summary: added b
229 summary: added b
230
230
231 #endif
231 #endif
232 $ echo "[format]" >> .hg/hgrc
232 $ echo "[format]" >> .hg/hgrc
233 $ echo "use-persistent-nodemap=True" >> .hg/hgrc
233 $ echo "use-persistent-nodemap=True" >> .hg/hgrc
234
234
235 $ hg debugupgraderepo --run -q -R ../shared1
235 $ hg debugupgraderepo --run -q -R ../shared1
236 abort: cannot upgrade repository; unsupported source requirement: shared
236 abort: cannot upgrade repository; unsupported source requirement: shared
237 [255]
237 [255]
238
238
239 $ hg debugupgraderepo --run -q
239 $ hg debugupgraderepo --run -q
240 upgrade will perform the following actions:
240 upgrade will perform the following actions:
241
241
242 requirements
242 requirements
243 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-zstd !)
243 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-zstd !)
244 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, share-safe, sparserevlog, store (zstd !)
244 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, share-safe, sparserevlog, store (zstd !)
245 added: persistent-nodemap
245 added: persistent-nodemap
246
246
247 processed revlogs:
247 processed revlogs:
248 - all-filelogs
248 - all-filelogs
249 - changelog
249 - changelog
250 - manifest
250 - manifest
251
251
252 $ hg log -r .
252 $ hg log -r .
253 changeset: 1:5f6d8a4bf34a
253 changeset: 1:5f6d8a4bf34a
254 user: test
254 user: test
255 date: Thu Jan 01 00:00:00 1970 +0000
255 date: Thu Jan 01 00:00:00 1970 +0000
256 summary: added b
256 summary: added b
257
257
258
258
259 Shared one should work
259 Shared one should work
260 $ cd ../shared1
260 $ cd ../shared1
261 $ hg log -r .
261 $ hg log -r .
262 changeset: 2:155349b645be
262 changeset: 2:155349b645be
263 tag: tip
263 tag: tip
264 user: test
264 user: test
265 date: Thu Jan 01 00:00:00 1970 +0000
265 date: Thu Jan 01 00:00:00 1970 +0000
266 summary: added c
266 summary: added c
267
267
268
268
269 Testing that nonsharedrc is loaded for source and not shared
269 Testing that nonsharedrc is loaded for source and not shared
270
270
271 $ cd ../source
271 $ cd ../source
272 $ touch .hg/hgrc-not-shared
272 $ touch .hg/hgrc-not-shared
273 $ echo "[ui]" >> .hg/hgrc-not-shared
273 $ echo "[ui]" >> .hg/hgrc-not-shared
274 $ echo "traceback=true" >> .hg/hgrc-not-shared
274 $ echo "traceback=true" >> .hg/hgrc-not-shared
275
275
276 $ hg showconfig ui.traceback
276 $ hg showconfig ui.traceback
277 true
277 true
278
278
279 $ HGEDITOR=cat hg config --non-shared
279 $ HGEDITOR=cat hg config --non-shared
280 [ui]
280 [ui]
281 traceback=true
281 traceback=true
282
282
283 $ cd ../shared1
283 $ cd ../shared1
284 $ hg showconfig ui.traceback
284 $ hg showconfig ui.traceback
285 [1]
285 [1]
286
286
287 Unsharing works
287 Unsharing works
288
288
289 $ hg unshare
289 $ hg unshare
290
290
291 Test that source config is added to the shared one after unshare, and the config
291 Test that source config is added to the shared one after unshare, and the config
292 of current repo is still respected over the config which came from source config
292 of current repo is still respected over the config which came from source config
293 $ cd ../cloned
293 $ cd ../cloned
294 $ hg push ../shared1
294 $ hg push ../shared1
295 pushing to ../shared1
295 pushing to ../shared1
296 searching for changes
296 searching for changes
297 adding changesets
297 adding changesets
298 adding manifests
298 adding manifests
299 adding file changes
299 adding file changes
300 error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
300 error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
301 transaction abort!
301 transaction abort!
302 rollback completed
302 rollback completed
303 abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
303 abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
304 [255]
304 [255]
305 $ hg showconfig ui.curses -R ../shared1
305 $ hg showconfig ui.curses -R ../shared1
306 false
306 false
307
307
308 $ cd ../
308 $ cd ../
309
309
310 Test that upgrading using debugupgraderepo works
310 Test that upgrading using debugupgraderepo works
311 =================================================
311 =================================================
312
312
313 $ hg init non-share-safe --config format.use-share-safe=false
313 $ hg init non-share-safe --config format.use-share-safe=false
314 $ cd non-share-safe
314 $ cd non-share-safe
315 $ hg debugrequirements
315 $ hg debugrequirements
316 dotencode
316 dotencode
317 fncache
317 fncache
318 generaldelta
318 generaldelta
319 revlogv1
319 revlogv1
320 sparserevlog
320 sparserevlog
321 store
321 store
322 $ echo foo > foo
322 $ echo foo > foo
323 $ hg ci -Aqm 'added foo'
323 $ hg ci -Aqm 'added foo'
324 $ echo bar > bar
324 $ echo bar > bar
325 $ hg ci -Aqm 'added bar'
325 $ hg ci -Aqm 'added bar'
326
326
327 Create a share before upgrading
327 Create a share before upgrading
328
328
329 $ cd ..
329 $ cd ..
330 $ hg share non-share-safe nss-share
330 $ hg share non-share-safe nss-share
331 updating working directory
331 updating working directory
332 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
332 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
333 $ hg debugrequirements -R nss-share
333 $ hg debugrequirements -R nss-share
334 dotencode
334 dotencode
335 fncache
335 fncache
336 generaldelta
336 generaldelta
337 revlogv1
337 revlogv1
338 shared
338 shared
339 sparserevlog
339 sparserevlog
340 store
340 store
341 $ cd non-share-safe
341 $ cd non-share-safe
342
342
343 Upgrade
343 Upgrade
344
344
345 $ hg debugupgraderepo -q
345 $ hg debugupgraderepo -q
346 requirements
346 requirements
347 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
347 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
348 added: share-safe
348 added: share-safe
349
349
350 processed revlogs:
350 processed revlogs:
351 - all-filelogs
351 - all-filelogs
352 - changelog
352 - changelog
353 - manifest
353 - manifest
354
354
355 $ hg debugupgraderepo --run -q
355 $ hg debugupgraderepo --run
356 upgrade will perform the following actions:
356 upgrade will perform the following actions:
357
357
358 requirements
358 requirements
359 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
359 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
360 added: share-safe
360 added: share-safe
361
361
362 share-safe
363 Upgrades a repository to share-safe format so that future shares of this repository share its requirements and configs.
364
362 processed revlogs:
365 processed revlogs:
363 - all-filelogs
366 - all-filelogs
364 - changelog
367 - changelog
365 - manifest
368 - manifest
366
369
370 beginning upgrade...
371 repository locked and read-only
372 creating temporary repository to stage upgraded data: $TESTTMP/non-share-safe/.hg/upgrade.* (glob)
373 (it is safe to interrupt this process any time before data migration completes)
374 migrating 6 total revisions (2 in filelogs, 2 in manifests, 2 in changelog)
375 migrating 626 bytes in store; 271 bytes tracked data
376 migrating 2 filelogs containing 2 revisions (138 bytes in store; 8 bytes tracked data)
377 finished migrating 2 filelog revisions across 2 filelogs; change in size: 0 bytes
378 migrating 1 manifests containing 2 revisions (230 bytes in store; 135 bytes tracked data)
379 finished migrating 2 manifest revisions across 1 manifests; change in size: 0 bytes
380 migrating changelog containing 2 revisions (258 bytes in store; 128 bytes tracked data)
381 finished migrating 2 changelog revisions; change in size: 0 bytes
382 finished migrating 6 total revisions; total change in store size: 0 bytes
383 copying phaseroots
384 data fully upgraded in a temporary repository
385 marking source repository as being upgraded; clients will be unable to read from repository
386 starting in-place swap of repository data
387 replaced files will be backed up at $TESTTMP/non-share-safe/.hg/upgradebackup.* (glob)
388 replacing store...
389 store replacement complete; repository was inconsistent for *s (glob)
390 finalizing requirements file and making repository readable again
391 removing temporary repository $TESTTMP/non-share-safe/.hg/upgrade.* (glob)
392 copy of old repository backed up at $TESTTMP/non-share-safe/.hg/upgradebackup.* (glob)
393 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
367 repository upgraded to share safe mode, existing shares will still work in old non-safe mode. Re-share existing shares to use them in safe mode New shares will be created in safe mode.
394 repository upgraded to share safe mode, existing shares will still work in old non-safe mode. Re-share existing shares to use them in safe mode New shares will be created in safe mode.
368
395
369 $ hg debugrequirements
396 $ hg debugrequirements
370 dotencode
397 dotencode
371 fncache
398 fncache
372 generaldelta
399 generaldelta
373 revlogv1
400 revlogv1
374 share-safe
401 share-safe
375 sparserevlog
402 sparserevlog
376 store
403 store
377
404
378 $ cat .hg/requires
405 $ cat .hg/requires
379 share-safe
406 share-safe
380
407
381 $ cat .hg/store/requires
408 $ cat .hg/store/requires
382 dotencode
409 dotencode
383 fncache
410 fncache
384 generaldelta
411 generaldelta
385 revlogv1
412 revlogv1
386 sparserevlog
413 sparserevlog
387 store
414 store
388
415
389 $ hg log -GT "{node}: {desc}\n"
416 $ hg log -GT "{node}: {desc}\n"
390 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
417 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
391 |
418 |
392 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
419 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
393
420
394
421
395 Make sure existing shares dont work with default config
422 Make sure existing shares dont work with default config
396
423
397 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
424 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
398 abort: version mismatch: source uses share-safe functionality while the current share does not
425 abort: version mismatch: source uses share-safe functionality while the current share does not
399 [255]
426 [255]
400
427
401
428
402 Create a safe share from upgrade one
429 Create a safe share from upgrade one
403
430
404 $ cd ..
431 $ cd ..
405 $ hg share non-share-safe ss-share
432 $ hg share non-share-safe ss-share
406 updating working directory
433 updating working directory
407 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
434 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
408 $ cd ss-share
435 $ cd ss-share
409 $ hg log -GT "{node}: {desc}\n"
436 $ hg log -GT "{node}: {desc}\n"
410 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
437 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
411 |
438 |
412 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
439 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
413
440
414 $ cd ../non-share-safe
441 $ cd ../non-share-safe
415
442
416 Test that downgrading works too
443 Test that downgrading works too
417
444
418 $ cat >> $HGRCPATH <<EOF
445 $ cat >> $HGRCPATH <<EOF
419 > [extensions]
446 > [extensions]
420 > share =
447 > share =
421 > [format]
448 > [format]
422 > use-share-safe = False
449 > use-share-safe = False
423 > EOF
450 > EOF
424
451
425 $ hg debugupgraderepo -q
452 $ hg debugupgraderepo -q
426 requirements
453 requirements
427 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
454 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
428 removed: share-safe
455 removed: share-safe
429
456
430 processed revlogs:
457 processed revlogs:
431 - all-filelogs
458 - all-filelogs
432 - changelog
459 - changelog
433 - manifest
460 - manifest
434
461
435 $ hg debugupgraderepo -q --run
462 $ hg debugupgraderepo --run
436 upgrade will perform the following actions:
463 upgrade will perform the following actions:
437
464
438 requirements
465 requirements
439 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
466 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
440 removed: share-safe
467 removed: share-safe
441
468
442 processed revlogs:
469 processed revlogs:
443 - all-filelogs
470 - all-filelogs
444 - changelog
471 - changelog
445 - manifest
472 - manifest
446
473
474 beginning upgrade...
475 repository locked and read-only
476 creating temporary repository to stage upgraded data: $TESTTMP/non-share-safe/.hg/upgrade.* (glob)
477 (it is safe to interrupt this process any time before data migration completes)
478 migrating 6 total revisions (2 in filelogs, 2 in manifests, 2 in changelog)
479 migrating 626 bytes in store; 271 bytes tracked data
480 migrating 2 filelogs containing 2 revisions (138 bytes in store; 8 bytes tracked data)
481 finished migrating 2 filelog revisions across 2 filelogs; change in size: 0 bytes
482 migrating 1 manifests containing 2 revisions (230 bytes in store; 135 bytes tracked data)
483 finished migrating 2 manifest revisions across 1 manifests; change in size: 0 bytes
484 migrating changelog containing 2 revisions (258 bytes in store; 128 bytes tracked data)
485 finished migrating 2 changelog revisions; change in size: 0 bytes
486 finished migrating 6 total revisions; total change in store size: 0 bytes
487 copying phaseroots
488 copying requires
489 data fully upgraded in a temporary repository
490 marking source repository as being upgraded; clients will be unable to read from repository
491 starting in-place swap of repository data
492 replaced files will be backed up at $TESTTMP/non-share-safe/.hg/upgradebackup.* (glob)
493 replacing store...
494 store replacement complete; repository was inconsistent for *s (glob)
495 finalizing requirements file and making repository readable again
496 removing temporary repository $TESTTMP/non-share-safe/.hg/upgrade.* (glob)
497 copy of old repository backed up at $TESTTMP/non-share-safe/.hg/upgradebackup.* (glob)
498 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
447 repository downgraded to not use share safe mode, existing shares will not work and needs to be reshared.
499 repository downgraded to not use share safe mode, existing shares will not work and needs to be reshared.
448
500
449 $ hg debugrequirements
501 $ hg debugrequirements
450 dotencode
502 dotencode
451 fncache
503 fncache
452 generaldelta
504 generaldelta
453 revlogv1
505 revlogv1
454 sparserevlog
506 sparserevlog
455 store
507 store
456
508
457 $ cat .hg/requires
509 $ cat .hg/requires
458 dotencode
510 dotencode
459 fncache
511 fncache
460 generaldelta
512 generaldelta
461 revlogv1
513 revlogv1
462 sparserevlog
514 sparserevlog
463 store
515 store
464
516
465 $ test -f .hg/store/requires
517 $ test -f .hg/store/requires
466 [1]
518 [1]
467
519
468 $ hg log -GT "{node}: {desc}\n"
520 $ hg log -GT "{node}: {desc}\n"
469 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
521 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
470 |
522 |
471 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
523 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
472
524
473
525
474 Make sure existing shares still works
526 Make sure existing shares still works
475
527
476 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
528 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
477 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
529 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
478 |
530 |
479 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
531 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
480
532
481
533
482 $ hg log -GT "{node}: {desc}\n" -R ../ss-share
534 $ hg log -GT "{node}: {desc}\n" -R ../ss-share
483 abort: share source does not support exp-sharesafe requirement
535 abort: share source does not support exp-sharesafe requirement
484 [255]
536 [255]
485
537
486 Testing automatic downgrade of shares when config is set
538 Testing automatic downgrade of shares when config is set
487
539
488 $ touch ../ss-share/.hg/wlock
540 $ touch ../ss-share/.hg/wlock
489 $ hg log -GT "{node}: {desc}\n" -R ../ss-share --config share.safe-mismatch.source-not-safe=downgrade-abort
541 $ hg log -GT "{node}: {desc}\n" -R ../ss-share --config share.safe-mismatch.source-not-safe=downgrade-abort
490 abort: failed to downgrade share, got error: Lock held
542 abort: failed to downgrade share, got error: Lock held
491 [255]
543 [255]
492 $ rm ../ss-share/.hg/wlock
544 $ rm ../ss-share/.hg/wlock
493
545
494 $ hg log -GT "{node}: {desc}\n" -R ../ss-share --config share.safe-mismatch.source-not-safe=downgrade-abort
546 $ hg log -GT "{node}: {desc}\n" -R ../ss-share --config share.safe-mismatch.source-not-safe=downgrade-abort
495 repository downgraded to not use share-safe mode
547 repository downgraded to not use share-safe mode
496 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
548 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
497 |
549 |
498 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
550 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
499
551
500
552
501 $ hg log -GT "{node}: {desc}\n" -R ../ss-share
553 $ hg log -GT "{node}: {desc}\n" -R ../ss-share
502 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
554 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
503 |
555 |
504 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
556 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
505
557
506
558
507
559
508 Testing automatic upgrade of shares when config is set
560 Testing automatic upgrade of shares when config is set
509
561
510 $ hg debugupgraderepo -q --run --config format.use-share-safe=True
562 $ hg debugupgraderepo -q --run --config format.use-share-safe=True
511 upgrade will perform the following actions:
563 upgrade will perform the following actions:
512
564
513 requirements
565 requirements
514 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
566 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
515 added: share-safe
567 added: share-safe
516
568
517 processed revlogs:
569 processed revlogs:
518 - all-filelogs
570 - all-filelogs
519 - changelog
571 - changelog
520 - manifest
572 - manifest
521
573
522 repository upgraded to share safe mode, existing shares will still work in old non-safe mode. Re-share existing shares to use them in safe mode New shares will be created in safe mode.
574 repository upgraded to share safe mode, existing shares will still work in old non-safe mode. Re-share existing shares to use them in safe mode New shares will be created in safe mode.
523 $ hg debugrequirements
575 $ hg debugrequirements
524 dotencode
576 dotencode
525 fncache
577 fncache
526 generaldelta
578 generaldelta
527 revlogv1
579 revlogv1
528 share-safe
580 share-safe
529 sparserevlog
581 sparserevlog
530 store
582 store
531 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
583 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
532 abort: version mismatch: source uses share-safe functionality while the current share does not
584 abort: version mismatch: source uses share-safe functionality while the current share does not
533 [255]
585 [255]
534
586
535 Check that if lock is taken, upgrade fails but read operation are successful
587 Check that if lock is taken, upgrade fails but read operation are successful
536 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgra
588 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgra
537 abort: share-safe mismatch with source.
589 abort: share-safe mismatch with source.
538 Unrecognized value 'upgra' of `share.safe-mismatch.source-safe` set.
590 Unrecognized value 'upgra' of `share.safe-mismatch.source-safe` set.
539 (run `hg help config.share.safe-mismatch.source-safe`)
591 (run `hg help config.share.safe-mismatch.source-safe`)
540 [255]
592 [255]
541 $ touch ../nss-share/.hg/wlock
593 $ touch ../nss-share/.hg/wlock
542 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-allow
594 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-allow
543 failed to upgrade share, got error: Lock held
595 failed to upgrade share, got error: Lock held
544 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
596 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
545 |
597 |
546 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
598 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
547
599
548
600
549 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-allow --config share.safe-mismatch.source-safe.warn=False
601 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-allow --config share.safe-mismatch.source-safe.warn=False
550 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
602 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
551 |
603 |
552 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
604 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
553
605
554
606
555 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-abort
607 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-abort
556 abort: failed to upgrade share, got error: Lock held
608 abort: failed to upgrade share, got error: Lock held
557 [255]
609 [255]
558
610
559 $ rm ../nss-share/.hg/wlock
611 $ rm ../nss-share/.hg/wlock
560 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-abort
612 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-abort
561 repository upgraded to use share-safe mode
613 repository upgraded to use share-safe mode
562 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
614 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
563 |
615 |
564 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
616 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
565
617
566
618
567 Test that unshare works
619 Test that unshare works
568
620
569 $ hg unshare -R ../nss-share
621 $ hg unshare -R ../nss-share
570 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
622 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
571 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
623 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
572 |
624 |
573 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
625 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
574
626
General Comments 0
You need to be logged in to leave comments. Login now