Show More
@@ -568,6 +568,7 b' def makelocalrepository(baseui, path, in' | |||
|
568 | 568 | # repository was shared the old way. We check the share source .hg/requires |
|
569 | 569 | # for SHARESAFE_REQUIREMENT to detect whether the current repository needs |
|
570 | 570 | # to be reshared |
|
571 | hint = _("see `hg help config.format.use-share-safe` for more information") | |
|
571 | 572 | if requirementsmod.SHARESAFE_REQUIREMENT in requirements: |
|
572 | 573 | |
|
573 | 574 | if ( |
@@ -601,12 +602,10 b' def makelocalrepository(baseui, path, in' | |||
|
601 | 602 | raise error.Abort( |
|
602 | 603 | _( |
|
603 | 604 | b"share source does not support exp-sharesafe requirement" |
|
604 | ) | |
|
605 | ), | |
|
606 | hint=hint, | |
|
605 | 607 | ) |
|
606 | 608 | else: |
|
607 | hint = _( | |
|
608 | "run `hg help config.share.safe-mismatch.source-not-safe`" | |
|
609 | ) | |
|
610 | 609 | raise error.Abort( |
|
611 | 610 | _( |
|
612 | 611 | b"share-safe mismatch with source.\nUnrecognized" |
@@ -646,10 +645,10 b' def makelocalrepository(baseui, path, in' | |||
|
646 | 645 | _( |
|
647 | 646 | b'version mismatch: source uses share-safe' |
|
648 | 647 | b' functionality while the current share does not' |
|
649 | ) | |
|
648 | ), | |
|
649 | hint=hint, | |
|
650 | 650 | ) |
|
651 | 651 | else: |
|
652 | hint = _("run `hg help config.share.safe-mismatch.source-safe`") | |
|
653 | 652 | raise error.Abort( |
|
654 | 653 | _( |
|
655 | 654 | b"share-safe mismatch with source.\nUnrecognized" |
@@ -282,15 +282,20 b' def upgrade_share_to_safe(' | |||
|
282 | 282 | scmutil.writerequires(hgvfs, diffrequires) |
|
283 | 283 | ui.warn(_(b'repository upgraded to use share-safe mode\n')) |
|
284 | 284 | except error.LockError as e: |
|
285 | hint = _( | |
|
286 | "see `hg help config.format.use-share-safe` for more information" | |
|
287 | ) | |
|
285 | 288 | if mismatch_config == b'upgrade-abort': |
|
286 | 289 | raise error.Abort( |
|
287 | 290 | _(b'failed to upgrade share, got error: %s') |
|
288 | % stringutil.forcebytestr(e.strerror) | |
|
291 | % stringutil.forcebytestr(e.strerror), | |
|
292 | hint=hint, | |
|
289 | 293 | ) |
|
290 | 294 | elif mismatch_warn: |
|
291 | 295 | ui.warn( |
|
292 | 296 | _(b'failed to upgrade share, got error: %s\n') |
|
293 | % stringutil.forcebytestr(e.strerror) | |
|
297 | % stringutil.forcebytestr(e.strerror), | |
|
298 | hint=hint, | |
|
294 | 299 | ) |
|
295 | 300 | finally: |
|
296 | 301 | if wlock: |
@@ -334,17 +339,22 b' def downgrade_share_to_non_safe(' | |||
|
334 | 339 | scmutil.writerequires(hgvfs, current_requirements) |
|
335 | 340 | ui.warn(_(b'repository downgraded to not use share-safe mode\n')) |
|
336 | 341 | except error.LockError as e: |
|
342 | hint = _( | |
|
343 | "see `hg help config.format.use-share-safe` for more information" | |
|
344 | ) | |
|
337 | 345 | # If upgrade-abort is set, abort when upgrade fails, else let the |
|
338 | 346 | # process continue as `upgrade-allow` is set |
|
339 | 347 | if mismatch_config == b'downgrade-abort': |
|
340 | 348 | raise error.Abort( |
|
341 | 349 | _(b'failed to downgrade share, got error: %s') |
|
342 | % stringutil.forcebytestr(e.strerror) | |
|
350 | % stringutil.forcebytestr(e.strerror), | |
|
351 | hint=hint, | |
|
343 | 352 | ) |
|
344 | 353 | elif mismatch_warn: |
|
345 | 354 | ui.warn( |
|
346 | 355 | _(b'failed to downgrade share, got error: %s\n') |
|
347 | % stringutil.forcebytestr(e.strerror) | |
|
356 | % stringutil.forcebytestr(e.strerror), | |
|
357 | hint=hint, | |
|
348 | 358 | ) |
|
349 | 359 | finally: |
|
350 | 360 | if wlock: |
@@ -396,6 +396,7 b' Make sure existing shares dont work with' | |||
|
396 | 396 | |
|
397 | 397 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share |
|
398 | 398 | abort: version mismatch: source uses share-safe functionality while the current share does not |
|
399 | (see `hg help config.format.use-share-safe` for more information) | |
|
399 | 400 | [255] |
|
400 | 401 | |
|
401 | 402 | |
@@ -481,6 +482,7 b' Make sure existing shares still works' | |||
|
481 | 482 | |
|
482 | 483 | $ hg log -GT "{node}: {desc}\n" -R ../ss-share |
|
483 | 484 | abort: share source does not support exp-sharesafe requirement |
|
485 | (see `hg help config.format.use-share-safe` for more information) | |
|
484 | 486 | [255] |
|
485 | 487 | |
|
486 | 488 | Testing automatic downgrade of shares when config is set |
@@ -488,6 +490,7 b' Testing automatic downgrade of shares wh' | |||
|
488 | 490 | $ touch ../ss-share/.hg/wlock |
|
489 | 491 | $ hg log -GT "{node}: {desc}\n" -R ../ss-share --config share.safe-mismatch.source-not-safe=downgrade-abort |
|
490 | 492 | abort: failed to downgrade share, got error: Lock held |
|
493 | (see `hg help config.format.use-share-safe` for more information) | |
|
491 | 494 | [255] |
|
492 | 495 | $ rm ../ss-share/.hg/wlock |
|
493 | 496 | |
@@ -530,13 +533,14 b' Testing automatic upgrade of shares when' | |||
|
530 | 533 | store |
|
531 | 534 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share |
|
532 | 535 | abort: version mismatch: source uses share-safe functionality while the current share does not |
|
536 | (see `hg help config.format.use-share-safe` for more information) | |
|
533 | 537 | [255] |
|
534 | 538 | |
|
535 | 539 | Check that if lock is taken, upgrade fails but read operation are successful |
|
536 | 540 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgra |
|
537 | 541 | abort: share-safe mismatch with source. |
|
538 | 542 | Unrecognized value 'upgra' of `share.safe-mismatch.source-safe` set. |
|
539 | (run `hg help config.share.safe-mismatch.source-safe`) | |
|
543 | (see `hg help config.format.use-share-safe` for more information) | |
|
540 | 544 | [255] |
|
541 | 545 | $ touch ../nss-share/.hg/wlock |
|
542 | 546 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-allow |
@@ -554,6 +558,7 b' Check that if lock is taken, upgrade fai' | |||
|
554 | 558 | |
|
555 | 559 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-abort |
|
556 | 560 | abort: failed to upgrade share, got error: Lock held |
|
561 | (see `hg help config.format.use-share-safe` for more information) | |
|
557 | 562 | [255] |
|
558 | 563 | |
|
559 | 564 | $ rm ../nss-share/.hg/wlock |
General Comments 0
You need to be logged in to leave comments.
Login now