comparison tests/test-share-safe.t @ 46331:8788981c95f8

localrepo: disallow share if there is a version mismatch by default Earlier we used to allow shares which don't use share-safe mechanism to access repository which uses share-safe mechanism. This defeats the purpose and is bad behavior. This patch disallows that. Next patch will introduce a config option to allow that and have clearer understanding around various options. Differential Revision: https://phab.mercurial-scm.org/D9784
author Pulkit Goyal <7895pulkit@gmail.com>
date Thu, 14 Jan 2021 21:34:12 +0530
parents fc2d5c0aed7f
children cc3452d2dfa4
comparison
equal deleted inserted replaced
46330:02f3badf9011 46331:8788981c95f8
390 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar 390 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
391 | 391 |
392 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo 392 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
393 393
394 394
395 Make sure existing shares still works 395 Make sure existing shares dont work with default config
396
397 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-warn-outdated-shares=false
398 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
399 |
400 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
401
402 396
403 $ hg log -GT "{node}: {desc}\n" -R ../nss-share 397 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
404 warning: source repository supports share-safe functionality. Reshare to upgrade. 398 abort: version mismatch: source uses share-safe functionality while the current share does not
405 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar 399 [255]
406 |
407 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
408
409 400
410 401
411 Create a safe share from upgrade one 402 Create a safe share from upgrade one
412 403
413 $ cd .. 404 $ cd ..
536 generaldelta 527 generaldelta
537 revlogv1 528 revlogv1
538 sparserevlog 529 sparserevlog
539 store 530 store
540 $ hg log -GT "{node}: {desc}\n" -R ../nss-share 531 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
541 warning: source repository supports share-safe functionality. Reshare to upgrade. 532 abort: version mismatch: source uses share-safe functionality while the current share does not
542 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar 533 [255]
543 |
544 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
545
546 534
547 Check that if lock is taken, upgrade fails but read operation are successful 535 Check that if lock is taken, upgrade fails but read operation are successful
548 $ touch ../nss-share/.hg/wlock 536 $ touch ../nss-share/.hg/wlock
549 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-auto-upgrade-shares=true 537 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-auto-upgrade-shares=true
550 failed to upgrade share, got error: Lock held 538 failed to upgrade share, got error: Lock held