Show More
@@ -137,6 +137,7 b' def allowednewrequirements(repo):' | |||
|
137 | 137 | requirements.SIDEDATA_REQUIREMENT, |
|
138 | 138 | requirements.COPIESSDC_REQUIREMENT, |
|
139 | 139 | requirements.NODEMAP_REQUIREMENT, |
|
140 | requirements.SHARESAFE_REQUIREMENT, | |
|
140 | 141 | } |
|
141 | 142 | for name in compression.compengines: |
|
142 | 143 | engine = compression.compengines[name] |
@@ -337,6 +338,26 b' class generaldelta(requirementformatvari' | |||
|
337 | 338 | |
|
338 | 339 | |
|
339 | 340 | @registerformatvariant |
|
341 | class sharedsafe(requirementformatvariant): | |
|
342 | name = b'exp-sharesafe' | |
|
343 | _requirement = requirements.SHARESAFE_REQUIREMENT | |
|
344 | ||
|
345 | default = False | |
|
346 | ||
|
347 | description = _( | |
|
348 | b'old shared repositories do not share source repository ' | |
|
349 | b'requirements and config. This leads to various problems ' | |
|
350 | b'when the source repository format is upgraded or some new ' | |
|
351 | b'extensions are enabled.' | |
|
352 | ) | |
|
353 | ||
|
354 | upgrademessage = _( | |
|
355 | b'Upgrades a repository to share-safe format so that future ' | |
|
356 | b'shares of this repository share its requirements and configs.' | |
|
357 | ) | |
|
358 | ||
|
359 | ||
|
360 | @registerformatvariant | |
|
340 | 361 | class sparserevlog(requirementformatvariant): |
|
341 | 362 | name = b'sparserevlog' |
|
342 | 363 | |
@@ -1439,3 +1460,13 b' def upgraderepo(' | |||
|
1439 | 1460 | b'repository is verified\n' |
|
1440 | 1461 | ) |
|
1441 | 1462 | ) |
|
1463 | ||
|
1464 | if sharedsafe.name in addedreqs: | |
|
1465 | ui.warn( | |
|
1466 | _( | |
|
1467 | b'repository upgraded to share safe mode, existing' | |
|
1468 | b' shares will still work in old non-safe mode. ' | |
|
1469 | b'Re-share existing shares to use them in safe mode' | |
|
1470 | b' New shares will be created in safe mode.\n' | |
|
1471 | ) | |
|
1472 | ) |
@@ -649,6 +649,7 b' We upgrade a repository that is not usin' | |||
|
649 | 649 | fncache: yes yes yes |
|
650 | 650 | dotencode: yes yes yes |
|
651 | 651 | generaldelta: yes yes yes |
|
652 | exp-sharesafe: no no no | |
|
652 | 653 | sparserevlog: yes yes yes |
|
653 | 654 | sidedata: no yes no |
|
654 | 655 | persistent-nodemap: no no no |
@@ -37,6 +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 | 41 | sparserevlog: yes yes yes |
|
41 | 42 | sidedata: yes yes no |
|
42 | 43 | persistent-nodemap: no no no |
@@ -50,6 +51,7 b' Check that copies are recorded correctly' | |||
|
50 | 51 | fncache: yes yes yes |
|
51 | 52 | dotencode: yes yes yes |
|
52 | 53 | generaldelta: yes yes yes |
|
54 | exp-sharesafe: no no no | |
|
53 | 55 | sparserevlog: yes yes yes |
|
54 | 56 | sidedata: no no no |
|
55 | 57 | persistent-nodemap: no no no |
@@ -417,6 +419,7 b' downgrading (keeping some sidedata)' | |||
|
417 | 419 | fncache: yes yes yes |
|
418 | 420 | dotencode: yes yes yes |
|
419 | 421 | generaldelta: yes yes yes |
|
422 | exp-sharesafe: no no no | |
|
420 | 423 | sparserevlog: yes yes yes |
|
421 | 424 | sidedata: yes yes no |
|
422 | 425 | persistent-nodemap: no no no |
@@ -442,6 +445,7 b' downgrading (keeping some sidedata)' | |||
|
442 | 445 | fncache: yes yes yes |
|
443 | 446 | dotencode: yes yes yes |
|
444 | 447 | generaldelta: yes yes yes |
|
448 | exp-sharesafe: no no no | |
|
445 | 449 | sparserevlog: yes yes yes |
|
446 | 450 | sidedata: yes yes no |
|
447 | 451 | persistent-nodemap: no no no |
@@ -469,6 +473,7 b' upgrading' | |||
|
469 | 473 | fncache: yes yes yes |
|
470 | 474 | dotencode: yes yes yes |
|
471 | 475 | generaldelta: yes yes yes |
|
476 | exp-sharesafe: no no no | |
|
472 | 477 | sparserevlog: yes yes yes |
|
473 | 478 | sidedata: yes yes no |
|
474 | 479 | persistent-nodemap: no no no |
@@ -15,6 +15,7 b' Test the persistent on-disk nodemap' | |||
|
15 | 15 | fncache: yes |
|
16 | 16 | dotencode: yes |
|
17 | 17 | generaldelta: yes |
|
18 | exp-sharesafe: no | |
|
18 | 19 | sparserevlog: yes |
|
19 | 20 | sidedata: no |
|
20 | 21 | persistent-nodemap: yes |
@@ -476,6 +477,7 b' downgrading' | |||
|
476 | 477 | fncache: yes yes yes |
|
477 | 478 | dotencode: yes yes yes |
|
478 | 479 | generaldelta: yes yes yes |
|
480 | exp-sharesafe: no no no | |
|
479 | 481 | sparserevlog: yes yes yes |
|
480 | 482 | sidedata: no no no |
|
481 | 483 | persistent-nodemap: yes no no |
@@ -506,6 +508,7 b' upgrading' | |||
|
506 | 508 | fncache: yes yes yes |
|
507 | 509 | dotencode: yes yes yes |
|
508 | 510 | generaldelta: yes yes yes |
|
511 | exp-sharesafe: no no no | |
|
509 | 512 | sparserevlog: yes yes yes |
|
510 | 513 | sidedata: no no no |
|
511 | 514 | persistent-nodemap: no yes no |
@@ -292,3 +292,89 b' of current repo is still respected over ' | |||
|
292 | 292 | [255] |
|
293 | 293 | $ hg showconfig ui.curses -R ../shared1 |
|
294 | 294 | false |
|
295 | ||
|
296 | $ cd ../ | |
|
297 | ||
|
298 | Test that upgrading using debugupgraderepo works | |
|
299 | ================================================= | |
|
300 | ||
|
301 | $ hg init non-share-safe --config format.exp-share-safe=false | |
|
302 | $ cd non-share-safe | |
|
303 | $ hg debugrequirements | |
|
304 | dotencode | |
|
305 | fncache | |
|
306 | generaldelta | |
|
307 | revlogv1 | |
|
308 | sparserevlog | |
|
309 | store | |
|
310 | $ echo foo > foo | |
|
311 | $ hg ci -Aqm 'added foo' | |
|
312 | $ echo bar > bar | |
|
313 | $ hg ci -Aqm 'added bar' | |
|
314 | ||
|
315 | Create a share before upgrading | |
|
316 | ||
|
317 | $ cd .. | |
|
318 | $ hg share non-share-safe nss-share | |
|
319 | updating working directory | |
|
320 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
321 | $ hg debugrequirements -R nss-share | |
|
322 | dotencode | |
|
323 | fncache | |
|
324 | generaldelta | |
|
325 | revlogv1 | |
|
326 | shared | |
|
327 | sparserevlog | |
|
328 | store | |
|
329 | $ cd non-share-safe | |
|
330 | ||
|
331 | Upgrade | |
|
332 | ||
|
333 | $ hg debugupgraderepo -q | |
|
334 | requirements | |
|
335 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store | |
|
336 | added: exp-sharesafe | |
|
337 | ||
|
338 | $ hg debugupgraderepo --run -q | |
|
339 | upgrade will perform the following actions: | |
|
340 | ||
|
341 | requirements | |
|
342 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store | |
|
343 | added: exp-sharesafe | |
|
344 | ||
|
345 | 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. | |
|
346 | ||
|
347 | $ hg debugrequirements | |
|
348 | dotencode | |
|
349 | exp-sharesafe | |
|
350 | fncache | |
|
351 | generaldelta | |
|
352 | revlogv1 | |
|
353 | sparserevlog | |
|
354 | store | |
|
355 | ||
|
356 | $ cat .hg/requires | |
|
357 | exp-sharesafe | |
|
358 | ||
|
359 | $ cat .hg/store/requires | |
|
360 | dotencode | |
|
361 | fncache | |
|
362 | generaldelta | |
|
363 | revlogv1 | |
|
364 | sparserevlog | |
|
365 | store | |
|
366 | ||
|
367 | $ hg log -GT "{node}: {desc}\n" | |
|
368 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar | |
|
369 | | | |
|
370 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo | |
|
371 | ||
|
372 | ||
|
373 | Make sure existing shares still works | |
|
374 | ||
|
375 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share | |
|
376 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar | |
|
377 | | | |
|
378 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo | |
|
379 | ||
|
380 | $ hg unshare -R ../nss-share |
@@ -54,6 +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 | 58 | sparserevlog: yes yes yes |
|
58 | 59 | sidedata: no no no |
|
59 | 60 | persistent-nodemap: no no no |
@@ -66,6 +67,7 b' Check that we can upgrade to sidedata' | |||
|
66 | 67 | fncache: yes yes yes |
|
67 | 68 | dotencode: yes yes yes |
|
68 | 69 | generaldelta: yes yes yes |
|
70 | exp-sharesafe: no no no | |
|
69 | 71 | sparserevlog: yes yes yes |
|
70 | 72 | sidedata: no yes no |
|
71 | 73 | persistent-nodemap: no no no |
@@ -84,6 +86,7 b' Check that we can downgrade from sidedat' | |||
|
84 | 86 | fncache: yes yes yes |
|
85 | 87 | dotencode: yes yes yes |
|
86 | 88 | generaldelta: yes yes yes |
|
89 | exp-sharesafe: no no no | |
|
87 | 90 | sparserevlog: yes yes yes |
|
88 | 91 | sidedata: yes no no |
|
89 | 92 | persistent-nodemap: no no no |
@@ -96,6 +99,7 b' Check that we can downgrade from sidedat' | |||
|
96 | 99 | fncache: yes yes yes |
|
97 | 100 | dotencode: yes yes yes |
|
98 | 101 | generaldelta: yes yes yes |
|
102 | exp-sharesafe: no no no | |
|
99 | 103 | sparserevlog: yes yes yes |
|
100 | 104 | sidedata: yes no no |
|
101 | 105 | persistent-nodemap: no no no |
@@ -56,6 +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 | 60 | sparserevlog: yes |
|
60 | 61 | sidedata: no |
|
61 | 62 | persistent-nodemap: no |
@@ -68,6 +69,7 b' An upgrade of a repository created with ' | |||
|
68 | 69 | fncache: yes yes yes |
|
69 | 70 | dotencode: yes yes yes |
|
70 | 71 | generaldelta: yes yes yes |
|
72 | exp-sharesafe: no no no | |
|
71 | 73 | sparserevlog: yes yes yes |
|
72 | 74 | sidedata: no no no |
|
73 | 75 | persistent-nodemap: no no no |
@@ -80,6 +82,7 b' An upgrade of a repository created with ' | |||
|
80 | 82 | fncache: yes no yes |
|
81 | 83 | dotencode: yes no yes |
|
82 | 84 | generaldelta: yes yes yes |
|
85 | exp-sharesafe: no no no | |
|
83 | 86 | sparserevlog: yes yes yes |
|
84 | 87 | sidedata: no no no |
|
85 | 88 | persistent-nodemap: no no no |
@@ -92,6 +95,7 b' An upgrade of a repository created with ' | |||
|
92 | 95 | [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes] |
|
93 | 96 | [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes] |
|
94 | 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] | |
|
95 | 99 | [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes] |
|
96 | 100 | [formatvariant.name.uptodate|sidedata: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] |
|
97 | 101 | [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] |
@@ -120,6 +124,12 b' An upgrade of a repository created with ' | |||
|
120 | 124 | "repo": true |
|
121 | 125 | }, |
|
122 | 126 | { |
|
127 | "config": false, | |
|
128 | "default": false, | |
|
129 | "name": "exp-sharesafe", | |
|
130 | "repo": false | |
|
131 | }, | |
|
132 | { | |
|
123 | 133 | "config": true, |
|
124 | 134 | "default": true, |
|
125 | 135 | "name": "sparserevlog", |
@@ -266,6 +276,7 b' Various sub-optimal detections work' | |||
|
266 | 276 | fncache: no |
|
267 | 277 | dotencode: no |
|
268 | 278 | generaldelta: no |
|
279 | exp-sharesafe: no | |
|
269 | 280 | sparserevlog: no |
|
270 | 281 | sidedata: no |
|
271 | 282 | persistent-nodemap: no |
@@ -278,6 +289,7 b' Various sub-optimal detections work' | |||
|
278 | 289 | fncache: no yes yes |
|
279 | 290 | dotencode: no yes yes |
|
280 | 291 | generaldelta: no yes yes |
|
292 | exp-sharesafe: no no no | |
|
281 | 293 | sparserevlog: no yes yes |
|
282 | 294 | sidedata: no no no |
|
283 | 295 | persistent-nodemap: no no no |
@@ -290,6 +302,7 b' Various sub-optimal detections work' | |||
|
290 | 302 | fncache: no yes yes |
|
291 | 303 | dotencode: no yes yes |
|
292 | 304 | generaldelta: no no yes |
|
305 | exp-sharesafe: no no no | |
|
293 | 306 | sparserevlog: no no yes |
|
294 | 307 | sidedata: no no no |
|
295 | 308 | persistent-nodemap: no no no |
@@ -302,6 +315,7 b' Various sub-optimal detections work' | |||
|
302 | 315 | [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes] |
|
303 | 316 | [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes] |
|
304 | 317 | [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes] |
|
318 | [formatvariant.name.uptodate|exp-sharesafe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] | |
|
305 | 319 | [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes] |
|
306 | 320 | [formatvariant.name.uptodate|sidedata: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] |
|
307 | 321 | [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] |
@@ -1289,6 +1303,7 b' upgrade' | |||
|
1289 | 1303 | fncache: yes yes yes |
|
1290 | 1304 | dotencode: yes yes yes |
|
1291 | 1305 | generaldelta: yes yes yes |
|
1306 | exp-sharesafe: no no no | |
|
1292 | 1307 | sparserevlog: yes yes yes |
|
1293 | 1308 | sidedata: no no no |
|
1294 | 1309 | persistent-nodemap: no no no |
@@ -1319,6 +1334,7 b' downgrade' | |||
|
1319 | 1334 | fncache: yes yes yes |
|
1320 | 1335 | dotencode: yes yes yes |
|
1321 | 1336 | generaldelta: yes yes yes |
|
1337 | exp-sharesafe: no no no | |
|
1322 | 1338 | sparserevlog: yes yes yes |
|
1323 | 1339 | sidedata: no no no |
|
1324 | 1340 | persistent-nodemap: no no no |
@@ -1352,6 +1368,7 b' upgrade from hgrc' | |||
|
1352 | 1368 | fncache: yes yes yes |
|
1353 | 1369 | dotencode: yes yes yes |
|
1354 | 1370 | generaldelta: yes yes yes |
|
1371 | exp-sharesafe: no no no | |
|
1355 | 1372 | sparserevlog: yes yes yes |
|
1356 | 1373 | sidedata: no no no |
|
1357 | 1374 | persistent-nodemap: no no no |
@@ -1389,6 +1406,7 b' upgrade' | |||
|
1389 | 1406 | fncache: yes yes yes |
|
1390 | 1407 | dotencode: yes yes yes |
|
1391 | 1408 | generaldelta: yes yes yes |
|
1409 | exp-sharesafe: no no no | |
|
1392 | 1410 | sparserevlog: yes yes yes |
|
1393 | 1411 | sidedata: yes no no |
|
1394 | 1412 | persistent-nodemap: no no no |
@@ -1426,6 +1444,7 b' downgrade' | |||
|
1426 | 1444 | fncache: yes yes yes |
|
1427 | 1445 | dotencode: yes yes yes |
|
1428 | 1446 | generaldelta: yes yes yes |
|
1447 | exp-sharesafe: no no no | |
|
1429 | 1448 | sparserevlog: yes yes yes |
|
1430 | 1449 | sidedata: no no no |
|
1431 | 1450 | persistent-nodemap: no no no |
@@ -1463,6 +1482,7 b' upgrade from hgrc' | |||
|
1463 | 1482 | fncache: yes yes yes |
|
1464 | 1483 | dotencode: yes yes yes |
|
1465 | 1484 | generaldelta: yes yes yes |
|
1485 | exp-sharesafe: no no no | |
|
1466 | 1486 | sparserevlog: yes yes yes |
|
1467 | 1487 | sidedata: yes yes no |
|
1468 | 1488 | persistent-nodemap: no no no |
General Comments 0
You need to be logged in to leave comments.
Login now