##// END OF EJS Templates
localrepo: document and test bug around opening shared repos...
Gregory Szorc -
r39732:9de1a1c8 default
parent child Browse files
Show More
@@ -438,6 +438,19 b' def makelocalrepository(baseui, path, in'
438 # Then we validate that the known set is reasonable to use together.
438 # Then we validate that the known set is reasonable to use together.
439 ensurerequirementscompatible(ui, requirements)
439 ensurerequirementscompatible(ui, requirements)
440
440
441 # TODO there are unhandled edge cases related to opening repositories with
442 # shared storage. If storage is shared, we should also test for requirements
443 # compatibility in the pointed-to repo. This entails loading the .hg/hgrc in
444 # that repo, as that repo may load extensions needed to open it. This is a
445 # bit complicated because we don't want the other hgrc to overwrite settings
446 # in this hgrc.
447 #
448 # This bug is somewhat mitigated by the fact that we copy the .hg/requires
449 # file when sharing repos. But if a requirement is added after the share is
450 # performed, thereby introducing a new requirement for the opener, we may
451 # will not see that and could encounter a run-time error interacting with
452 # that shared store since it has an unknown-to-us requirement.
453
441 # At this point, we know we should be capable of opening the repository.
454 # At this point, we know we should be capable of opening the repository.
442 # Now get on with doing that.
455 # Now get on with doing that.
443
456
@@ -439,6 +439,29 b' test unshare relshared repo'
439
439
440 $ rm -r thatdir
440 $ rm -r thatdir
441
441
442 Demonstrate buggy behavior around requirements validation
443 See comment in localrepo.py:makelocalrepository() for more.
444
445 $ hg init sharenewrequires
446 $ hg share sharenewrequires shareoldrequires
447 updating working directory
448 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
449
450 $ cat >> sharenewrequires/.hg/requires << EOF
451 > missing-requirement
452 > EOF
453
454 We cannot open the repo with the unknown requirement
455
456 $ hg -R sharenewrequires status
457 abort: repository requires features unknown to this Mercurial: missing-requirement!
458 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
459 [255]
460
461 BUG: we don't get the same error when opening the shared repo pointing to it
462
463 $ hg -R shareoldrequires status
464
442 Explicitly kill daemons to let the test exit on Windows
465 Explicitly kill daemons to let the test exit on Windows
443
466
444 $ killdaemons.py
467 $ killdaemons.py
General Comments 0
You need to be logged in to leave comments. Login now