##// END OF EJS Templates
share: move share safe functionality out of experimental...
Pulkit Goyal -
r47052:4b0192f5 default
parent child Browse files
Show More
@@ -1272,9 +1272,8 b' coreconfigitem('
1272 1272 )
1273 1273 coreconfigitem(
1274 1274 b'format',
1275 b'exp-share-safe',
1275 b'use-share-safe',
1276 1276 default=False,
1277 experimental=True,
1278 1277 )
1279 1278 coreconfigitem(
1280 1279 b'format',
@@ -914,6 +914,12 b' https://www.mercurial-scm.org/wiki/Missi'
914 914
915 915 Disabled by default.
916 916
917 ``use-share-safe``
918 Enable or disable the "share-safe" functionality, which enables shares
919 to read requirements and configuration of its source repository.
920
921 Disabled by default.
922
917 923 ``usestore``
918 924 Enable or disable the "store" repository format which improves
919 925 compatibility with systems that fold case or otherwise mangle
@@ -159,10 +159,6 b' keep the index up to date, but will suff'
159 159 exp-sharesafe
160 160 =============
161 161
162 NOTE: This requirement is for internal development only. The semantics are not
163 frozed yet, the feature is experimental. It's not advised to use it for any
164 production repository yet.
165
166 162 Represents that the repository can be shared safely. Requirements and config of
167 163 the source repository will be shared.
168 164 Requirements are stored in ``.hg/store`` instead of directly in ``.hg/`` where
@@ -172,5 +168,5 b' Shares read the ``.hg/hgrc`` of the sour'
172 168
173 169 Support for this requirement was added in Mercurial 5.7 (released
174 170 February 2021). The requirement will only be present on repositories that have
175 opted in to this format (by having ``format.exp-share-safe=true`` set when
171 opted in to this format (by having ``format.use-share-safe=true`` set when
176 172 they were created).
@@ -3474,7 +3474,7 b' def newreporequirements(ui, createopts):'
3474 3474
3475 3475 # if share-safe is enabled, let's create the new repository with the new
3476 3476 # requirement
3477 if ui.configbool(b'format', b'exp-share-safe'):
3477 if ui.configbool(b'format', b'use-share-safe'):
3478 3478 requirements.add(requirementsmod.SHARESAFE_REQUIREMENT)
3479 3479
3480 3480 return requirements
@@ -3513,7 +3513,7 b' def checkrequirementscompat(ui, requirem'
3513 3513 if requirementsmod.SHARESAFE_REQUIREMENT in requirements:
3514 3514 ui.warn(
3515 3515 _(
3516 b"ignoring enabled 'format.exp-share-safe' config because "
3516 b"ignoring enabled 'format.use-share-safe' config because "
3517 3517 b"it is incompatible with disabled 'format.usestore'"
3518 3518 b" config\n"
3519 3519 )
@@ -55,7 +55,7 b" RELATIVE_SHARED_REQUIREMENT = b'relshare"
55 55 # A repository with share implemented safely. The repository has different
56 56 # store and working copy requirements i.e. both `.hg/requires` and
57 57 # `.hg/store/requires` are present.
58 SHARESAFE_REQUIREMENT = b'exp-sharesafe'
58 SHARESAFE_REQUIREMENT = b'share-safe'
59 59
60 60 # List of requirements which are working directory specific
61 61 # These requirements cannot be shared between repositories if they
@@ -237,7 +237,7 b' class generaldelta(requirementformatvari'
237 237
238 238 @registerformatvariant
239 239 class sharesafe(requirementformatvariant):
240 name = b'exp-sharesafe'
240 name = b'share-safe'
241 241 _requirement = requirements.SHARESAFE_REQUIREMENT
242 242
243 243 default = False
@@ -696,7 +696,7 b' We upgrade a repository that is not usin'
696 696 fncache: yes yes yes
697 697 dotencode: yes yes yes
698 698 generaldelta: yes yes yes
699 exp-sharesafe: no no no
699 share-safe: no no no
700 700 sparserevlog: yes yes yes
701 701 sidedata: no yes no
702 702 persistent-nodemap: no no no
@@ -37,7 +37,7 b' Check that copies are recorded correctly'
37 37 fncache: yes yes yes
38 38 dotencode: yes yes yes
39 39 generaldelta: yes yes yes
40 exp-sharesafe: no no no
40 share-safe: no no no
41 41 sparserevlog: yes yes yes
42 42 sidedata: yes yes no
43 43 persistent-nodemap: no no no
@@ -51,7 +51,7 b' Check that copies are recorded correctly'
51 51 fncache: yes yes yes
52 52 dotencode: yes yes yes
53 53 generaldelta: yes yes yes
54 exp-sharesafe: no no no
54 share-safe: no no no
55 55 sparserevlog: yes yes yes
56 56 sidedata: no no no
57 57 persistent-nodemap: no no no
@@ -419,7 +419,7 b' downgrading (keeping some sidedata)'
419 419 fncache: yes yes yes
420 420 dotencode: yes yes yes
421 421 generaldelta: yes yes yes
422 exp-sharesafe: no no no
422 share-safe: no no no
423 423 sparserevlog: yes yes yes
424 424 sidedata: yes yes no
425 425 persistent-nodemap: no no no
@@ -445,7 +445,7 b' downgrading (keeping some sidedata)'
445 445 fncache: yes yes yes
446 446 dotencode: yes yes yes
447 447 generaldelta: yes yes yes
448 exp-sharesafe: no no no
448 share-safe: no no no
449 449 sparserevlog: yes yes yes
450 450 sidedata: yes yes no
451 451 persistent-nodemap: no no no
@@ -473,7 +473,7 b' upgrading'
473 473 fncache: yes yes yes
474 474 dotencode: yes yes yes
475 475 generaldelta: yes yes yes
476 exp-sharesafe: no no no
476 share-safe: no no no
477 477 sparserevlog: yes yes yes
478 478 sidedata: yes yes no
479 479 persistent-nodemap: no no no
@@ -1553,6 +1553,8 b' Separate sections from subsections'
1553 1553
1554 1554 "use-persistent-nodemap"
1555 1555
1556 "use-share-safe"
1557
1556 1558 "usestore"
1557 1559
1558 1560 "sparse-revlog"
@@ -37,7 +37,7 b' Unlock further check (we are here to tes'
37 37 fncache: yes
38 38 dotencode: yes
39 39 generaldelta: yes
40 exp-sharesafe: no
40 share-safe: no
41 41 sparserevlog: yes
42 42 sidedata: no
43 43 persistent-nodemap: yes
@@ -556,7 +556,7 b' downgrading'
556 556 fncache: yes yes yes
557 557 dotencode: yes yes yes
558 558 generaldelta: yes yes yes
559 exp-sharesafe: no no no
559 share-safe: no no no
560 560 sparserevlog: yes yes yes
561 561 sidedata: no no no
562 562 persistent-nodemap: yes no no
@@ -592,7 +592,7 b' upgrading'
592 592 fncache: yes yes yes
593 593 dotencode: yes yes yes
594 594 generaldelta: yes yes yes
595 exp-sharesafe: no no no
595 share-safe: no no no
596 596 sparserevlog: yes yes yes
597 597 sidedata: no no no
598 598 persistent-nodemap: no yes no
@@ -3,7 +3,7 b''
3 3
4 4 #if safe
5 5 $ echo "[format]" >> $HGRCPATH
6 $ echo "exp-share-safe = True" >> $HGRCPATH
6 $ echo "use-share-safe = True" >> $HGRCPATH
7 7 #endif
8 8
9 9 $ echo "[extensions]" >> $HGRCPATH
@@ -290,4 +290,4 b' Test that if store is disabled, we drop '
290 290
291 291 $ hg init brokenrepo --config format.bookmarks-in-store=True --config format.usestore=false
292 292 ignoring enabled 'format.bookmarks-in-store' config beacuse it is incompatible with disabled 'format.usestore' config
293 ignoring enabled 'format.exp-share-safe' config because it is incompatible with disabled 'format.usestore' config (safe !)
293 ignoring enabled 'format.use-share-safe' config because it is incompatible with disabled 'format.usestore' config (safe !)
@@ -4,7 +4,7 b' setup'
4 4 > [extensions]
5 5 > share =
6 6 > [format]
7 > exp-share-safe = True
7 > use-share-safe = True
8 8 > [storage]
9 9 > revlog.persistent-nodemap.slow-path=allow
10 10 > EOF
@@ -14,7 +14,7 b' prepare source repo'
14 14 $ hg init source
15 15 $ cd source
16 16 $ cat .hg/requires
17 exp-sharesafe
17 share-safe
18 18 $ cat .hg/store/requires
19 19 dotencode
20 20 fncache
@@ -24,10 +24,10 b' prepare source repo'
24 24 store
25 25 $ hg debugrequirements
26 26 dotencode
27 exp-sharesafe
28 27 fncache
29 28 generaldelta
30 29 revlogv1
30 share-safe
31 31 sparserevlog
32 32 store
33 33
@@ -47,24 +47,24 b' Create a shared repo and check the requi'
47 47 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
48 48 $ cd shared1
49 49 $ cat .hg/requires
50 exp-sharesafe
50 share-safe
51 51 shared
52 52
53 53 $ hg debugrequirements -R ../source
54 54 dotencode
55 exp-sharesafe
56 55 fncache
57 56 generaldelta
58 57 revlogv1
58 share-safe
59 59 sparserevlog
60 60 store
61 61
62 62 $ hg debugrequirements
63 63 dotencode
64 exp-sharesafe
65 64 fncache
66 65 generaldelta
67 66 revlogv1
67 share-safe
68 68 shared
69 69 sparserevlog
70 70 store
@@ -214,7 +214,7 b' Disable zstd related tests because its n'
214 214 upgrade will perform the following actions:
215 215
216 216 requirements
217 preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlogv1, sparserevlog, store
217 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store
218 218 added: revlog-compression-zstd
219 219
220 220 processed revlogs:
@@ -240,8 +240,8 b' Disable zstd related tests because its n'
240 240 upgrade will perform the following actions:
241 241
242 242 requirements
243 preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !)
244 preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (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 !)
245 245 added: persistent-nodemap
246 246
247 247 processed revlogs:
@@ -310,7 +310,7 b' of current repo is still respected over '
310 310 Test that upgrading using debugupgraderepo works
311 311 =================================================
312 312
313 $ hg init non-share-safe --config format.exp-share-safe=false
313 $ hg init non-share-safe --config format.use-share-safe=false
314 314 $ cd non-share-safe
315 315 $ hg debugrequirements
316 316 dotencode
@@ -345,7 +345,7 b' Upgrade'
345 345 $ hg debugupgraderepo -q
346 346 requirements
347 347 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
348 added: exp-sharesafe
348 added: share-safe
349 349
350 350 processed revlogs:
351 351 - all-filelogs
@@ -357,7 +357,7 b' Upgrade'
357 357
358 358 requirements
359 359 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
360 added: exp-sharesafe
360 added: share-safe
361 361
362 362 processed revlogs:
363 363 - all-filelogs
@@ -368,15 +368,15 b' Upgrade'
368 368
369 369 $ hg debugrequirements
370 370 dotencode
371 exp-sharesafe
372 371 fncache
373 372 generaldelta
374 373 revlogv1
374 share-safe
375 375 sparserevlog
376 376 store
377 377
378 378 $ cat .hg/requires
379 exp-sharesafe
379 share-safe
380 380
381 381 $ cat .hg/store/requires
382 382 dotencode
@@ -419,13 +419,13 b' Test that downgrading works too'
419 419 > [extensions]
420 420 > share =
421 421 > [format]
422 > exp-share-safe = False
422 > use-share-safe = False
423 423 > EOF
424 424
425 425 $ hg debugupgraderepo -q
426 426 requirements
427 427 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
428 removed: exp-sharesafe
428 removed: share-safe
429 429
430 430 processed revlogs:
431 431 - all-filelogs
@@ -437,7 +437,7 b' Test that downgrading works too'
437 437
438 438 requirements
439 439 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
440 removed: exp-sharesafe
440 removed: share-safe
441 441
442 442 processed revlogs:
443 443 - all-filelogs
@@ -507,12 +507,12 b' Testing automatic downgrade of shares wh'
507 507
508 508 Testing automatic upgrade of shares when config is set
509 509
510 $ hg debugupgraderepo -q --run --config format.exp-share-safe=True
510 $ hg debugupgraderepo -q --run --config format.use-share-safe=True
511 511 upgrade will perform the following actions:
512 512
513 513 requirements
514 514 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
515 added: exp-sharesafe
515 added: share-safe
516 516
517 517 processed revlogs:
518 518 - all-filelogs
@@ -522,10 +522,10 b' Testing automatic upgrade of shares when'
522 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.
523 523 $ hg debugrequirements
524 524 dotencode
525 exp-sharesafe
526 525 fncache
527 526 generaldelta
528 527 revlogv1
528 share-safe
529 529 sparserevlog
530 530 store
531 531 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
@@ -2,7 +2,7 b''
2 2
3 3 #if safe
4 4 $ echo "[format]" >> $HGRCPATH
5 $ echo "exp-share-safe = True" >> $HGRCPATH
5 $ echo "use-share-safe = True" >> $HGRCPATH
6 6 #endif
7 7
8 8 $ echo "[extensions]" >> $HGRCPATH
@@ -281,7 +281,7 b' Explicitly kill daemons to let the test '
281 281 Test sharing a repository which was created with store requirement disable
282 282
283 283 $ hg init nostore --config format.usestore=false
284 ignoring enabled 'format.exp-share-safe' config because it is incompatible with disabled 'format.usestore' config (safe !)
284 ignoring enabled 'format.use-share-safe' config because it is incompatible with disabled 'format.usestore' config (safe !)
285 285 $ hg share nostore sharednostore
286 286 abort: cannot create shared repository as source was created with 'format.usestore' config disabled
287 287 [255]
@@ -54,7 +54,7 b' Check that we can upgrade to sidedata'
54 54 fncache: yes yes yes
55 55 dotencode: yes yes yes
56 56 generaldelta: yes yes yes
57 exp-sharesafe: no no no
57 share-safe: no no no
58 58 sparserevlog: yes yes yes
59 59 sidedata: no no no
60 60 persistent-nodemap: no no no
@@ -67,7 +67,7 b' Check that we can upgrade to sidedata'
67 67 fncache: yes yes yes
68 68 dotencode: yes yes yes
69 69 generaldelta: yes yes yes
70 exp-sharesafe: no no no
70 share-safe: no no no
71 71 sparserevlog: yes yes yes
72 72 sidedata: no yes no
73 73 persistent-nodemap: no no no
@@ -86,7 +86,7 b' Check that we can downgrade from sidedat'
86 86 fncache: yes yes yes
87 87 dotencode: yes yes yes
88 88 generaldelta: yes yes yes
89 exp-sharesafe: no no no
89 share-safe: no no no
90 90 sparserevlog: yes yes yes
91 91 sidedata: yes no no
92 92 persistent-nodemap: no no no
@@ -99,7 +99,7 b' Check that we can downgrade from sidedat'
99 99 fncache: yes yes yes
100 100 dotencode: yes yes yes
101 101 generaldelta: yes yes yes
102 exp-sharesafe: no no no
102 share-safe: no no no
103 103 sparserevlog: yes yes yes
104 104 sidedata: yes no no
105 105 persistent-nodemap: no no no
@@ -56,7 +56,7 b' An upgrade of a repository created with '
56 56 fncache: yes
57 57 dotencode: yes
58 58 generaldelta: yes
59 exp-sharesafe: no
59 share-safe: no
60 60 sparserevlog: yes
61 61 sidedata: no
62 62 persistent-nodemap: no
@@ -69,7 +69,7 b' An upgrade of a repository created with '
69 69 fncache: yes yes yes
70 70 dotencode: yes yes yes
71 71 generaldelta: yes yes yes
72 exp-sharesafe: no no no
72 share-safe: no no no
73 73 sparserevlog: yes yes yes
74 74 sidedata: no no no
75 75 persistent-nodemap: no no no
@@ -82,7 +82,7 b' An upgrade of a repository created with '
82 82 fncache: yes no yes
83 83 dotencode: yes no yes
84 84 generaldelta: yes yes yes
85 exp-sharesafe: no no no
85 share-safe: no no no
86 86 sparserevlog: yes yes yes
87 87 sidedata: no no no
88 88 persistent-nodemap: no no no
@@ -95,7 +95,7 b' An upgrade of a repository created with '
95 95 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
96 96 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
97 97 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
98 [formatvariant.name.uptodate|exp-sharesafe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
98 [formatvariant.name.uptodate|share-safe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
99 99 [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
100 100 [formatvariant.name.uptodate|sidedata: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
101 101 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
@@ -126,7 +126,7 b' An upgrade of a repository created with '
126 126 {
127 127 "config": false,
128 128 "default": false,
129 "name": "exp-sharesafe",
129 "name": "share-safe",
130 130 "repo": false
131 131 },
132 132 {
@@ -301,7 +301,7 b' Various sub-optimal detections work'
301 301 fncache: no
302 302 dotencode: no
303 303 generaldelta: no
304 exp-sharesafe: no
304 share-safe: no
305 305 sparserevlog: no
306 306 sidedata: no
307 307 persistent-nodemap: no
@@ -314,7 +314,7 b' Various sub-optimal detections work'
314 314 fncache: no yes yes
315 315 dotencode: no yes yes
316 316 generaldelta: no yes yes
317 exp-sharesafe: no no no
317 share-safe: no no no
318 318 sparserevlog: no yes yes
319 319 sidedata: no no no
320 320 persistent-nodemap: no no no
@@ -327,7 +327,7 b' Various sub-optimal detections work'
327 327 fncache: no yes yes
328 328 dotencode: no yes yes
329 329 generaldelta: no no yes
330 exp-sharesafe: no no no
330 share-safe: no no no
331 331 sparserevlog: no no yes
332 332 sidedata: no no no
333 333 persistent-nodemap: no no no
@@ -340,7 +340,7 b' Various sub-optimal detections work'
340 340 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
341 341 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
342 342 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
343 [formatvariant.name.uptodate|exp-sharesafe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
343 [formatvariant.name.uptodate|share-safe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
344 344 [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
345 345 [formatvariant.name.uptodate|sidedata: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
346 346 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
@@ -1297,7 +1297,7 b' upgrade'
1297 1297 fncache: yes yes yes
1298 1298 dotencode: yes yes yes
1299 1299 generaldelta: yes yes yes
1300 exp-sharesafe: no no no
1300 share-safe: no no no
1301 1301 sparserevlog: yes yes yes
1302 1302 sidedata: no no no
1303 1303 persistent-nodemap: no no no
@@ -1333,7 +1333,7 b' downgrade'
1333 1333 fncache: yes yes yes
1334 1334 dotencode: yes yes yes
1335 1335 generaldelta: yes yes yes
1336 exp-sharesafe: no no no
1336 share-safe: no no no
1337 1337 sparserevlog: yes yes yes
1338 1338 sidedata: no no no
1339 1339 persistent-nodemap: no no no
@@ -1372,7 +1372,7 b' upgrade from hgrc'
1372 1372 fncache: yes yes yes
1373 1373 dotencode: yes yes yes
1374 1374 generaldelta: yes yes yes
1375 exp-sharesafe: no no no
1375 share-safe: no no no
1376 1376 sparserevlog: yes yes yes
1377 1377 sidedata: no no no
1378 1378 persistent-nodemap: no no no
@@ -1415,7 +1415,7 b' upgrade'
1415 1415 fncache: yes yes yes
1416 1416 dotencode: yes yes yes
1417 1417 generaldelta: yes yes yes
1418 exp-sharesafe: no no no
1418 share-safe: no no no
1419 1419 sparserevlog: yes yes yes
1420 1420 sidedata: yes no no
1421 1421 persistent-nodemap: no no no
@@ -1458,7 +1458,7 b' downgrade'
1458 1458 fncache: yes yes yes
1459 1459 dotencode: yes yes yes
1460 1460 generaldelta: yes yes yes
1461 exp-sharesafe: no no no
1461 share-safe: no no no
1462 1462 sparserevlog: yes yes yes
1463 1463 sidedata: no no no
1464 1464 persistent-nodemap: no no no
@@ -1501,7 +1501,7 b' upgrade from hgrc'
1501 1501 fncache: yes yes yes
1502 1502 dotencode: yes yes yes
1503 1503 generaldelta: yes yes yes
1504 exp-sharesafe: no no no
1504 share-safe: no no no
1505 1505 sparserevlog: yes yes yes
1506 1506 sidedata: yes yes no
1507 1507 persistent-nodemap: no no no
General Comments 0
You need to be logged in to leave comments. Login now