Thu, 20 Sep 2018 15:06:43 -0700 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 20 Sep 2018 15:06:43 -0700] rev 39852
localrepo: automatically load lfs extension when required (BC) If an unrecognized requirement is present (possibly due to an unloaded extension), the user will get an error message telling them to go to https://mercurial-scm.org/wiki/MissingRequirement for more info. And some requirements clearly map to known extensions shipped by Mercurial. This commit teaches repository loading to automatically map requirements to extensions. We implement support for loading the lfs extension when the "lfs" requirement is present. This behavior feels more user-friendly to me and I'm having trouble coming up with a compelling reason to not do it. The strongest argument I have against is that - strictly speaking - requirements are general repository features and there could be N providers of that feature. e.g. in the case of LFS, there could be another extension implementing LFS support. And the user would want to use this non-official extension rather than the built-in one. The way this patch implements things, the non-official extension could be missing and Mercurial would load the official lfs extension, leading to unexpected behavior. But this feels like a highly marginal use case to me and doesn't outweigh the user benefit of "it just works." If someone really wanted to e.g. use a custom LFS extension, they could prevent the built-in one from being loaded by either defining "extensions.lfs=/path/to/custom/extension" or "extensions.lfs=!", as the automatic extension loading only occurs if there is no config entry for that extension. Differential Revision: https://phab.mercurial-scm.org/D4711
Wed, 19 Sep 2018 13:48:59 -0700 lfs: add repository feature denoting the use of LFS
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 19 Sep 2018 13:48:59 -0700] rev 39851
lfs: add repository feature denoting the use of LFS Whether LFS is enabled seems like a useful feature to expose. This will also facilitate some future work around LFS feature compatibility. Differential Revision: https://phab.mercurial-scm.org/D4710
Wed, 19 Sep 2018 14:36:57 -0700 localrepo: define "features" on repository instances (API)
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 19 Sep 2018 14:36:57 -0700] rev 39850
localrepo: define "features" on repository instances (API) There are a handful of attributes/methods on repository instances that describe the behavior of the repository. Furthermore, there is an unbound set of repository descriptors that we may wish to expose. For example, an extension may wish to add a descriptor and have monkeypatched functions look for the presence of an attribute before taking actions. This commit introduces a "features" mechanism to allow repositories to self-advertise an arbitrary set of strings that describe repository behavior or capabilities. We implement basic support for advertising a few features to give an idea of what I want to use this for. Differential Revision: https://phab.mercurial-scm.org/D4709
Wed, 19 Sep 2018 17:27:37 -0700 localrepo: support writing shared file (API)
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 19 Sep 2018 17:27:37 -0700] rev 39849
localrepo: support writing shared file (API) Now that we can create a shared repository via creation options, we can handle other special actions related to share at repo creation time as well. One of the things we do after creating a shared repository is write out a .hg/shared file containing the list of additional things to share. Of which only "bookmarks" is supported. We add a creation option to hold the set of additional items to share. If items are defined, we write out the .hg/shared file at repo creation time. As part of this, we no longer hold the repo lock when writing the file. I'm pretty sure we don't care about the tiny race condition window. I'm also pretty sure the reason we used the lock was because the vfs auditor on the repo instance complained otherwise. Since the repo creation code doesn't have an audited vfs, we don't need to appease it. Because we no longer need to tell the post share hook what items are shared, the "bookmarks" argument to that function has been dropped, incurring an API change. Differential Revision: https://phab.mercurial-scm.org/D4708
Wed, 19 Sep 2018 17:05:59 -0700 localrepo: support shared repo creation
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 19 Sep 2018 17:05:59 -0700] rev 39848
localrepo: support shared repo creation Previously, hg.share() had its own logic for creating a new repository on the filesystem. With the recent introduction of the createopts dict for passing options to influence repository creation, it is now possible to consolidate the repo creation code for both the normal and shared use cases. This commit teaches the repo creation code in localrepo to recognize when we're creating a shared repo and to act appropriately. Meaningful behavior should be identical. However, there are a few subtle changes: * The .hg/requires file is written out in sorted order (rather than having share-related requirements appended at end). * The .hg directory is created with notindexed=True when a shared repo is being created. Differential Revision: https://phab.mercurial-scm.org/D4707
Wed, 19 Sep 2018 16:51:57 -0700 localrepo: validate directories before creating any
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 19 Sep 2018 16:51:57 -0700] rev 39847
localrepo: validate directories before creating any There is no meaningful change in behavior because wdir would already exist in the case where we raised RepoError. But I think the code is easier to read if we do all validation first then take actions with side-effects. Differential Revision: https://phab.mercurial-scm.org/D4706
Wed, 19 Sep 2018 16:15:22 -0700 localrepo: add missing join()
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 19 Sep 2018 16:15:22 -0700] rev 39846
localrepo: add missing join() Differential Revision: https://phab.mercurial-scm.org/D4705
Wed, 19 Sep 2018 11:38:05 -0700 revlog: use proper version comparison during verify
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 19 Sep 2018 11:38:05 -0700] rev 39845
revlog: use proper version comparison during verify Verify appears to want to compare the changelog's revlog version number with the version number of filelogs and error if they are different. But what it was actually doing was comparing the full 32-bit header integer, which contains 2 shorts: 1 for the revlog version number and 1 for feature flags. This commit tweaks the verification code so it only looks at the version number component of the header and emits a warning if they differ. The new code is more robust because it accounts for future revlog version numbers without them needing to be special cased. Differential Revision: https://phab.mercurial-scm.org/D4704
Wed, 19 Sep 2018 11:22:56 -0700 filelog: stop proxying checksize() (API)
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 19 Sep 2018 11:22:56 -0700] rev 39844
filelog: stop proxying checksize() (API) This was only used by verify code. And the check using it is now implemented as part of verifyintegrity(). The method is unused and is revlog-centric, which means it isn't appropriate for the file storage interface. So remove it. Differential Revision: https://phab.mercurial-scm.org/D4703
Wed, 19 Sep 2018 11:20:02 -0700 filelog: remove version attribute (API)
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 19 Sep 2018 11:20:02 -0700] rev 39843
filelog: remove version attribute (API) This was only used by verify code. The check it was used for is now implemented as part of the verifyintegrity() implementation. The attribute is now unused, is revlog-specific, and isn't appropriate to be exposing on the file storage interface. So drop it. Differential Revision: https://phab.mercurial-scm.org/D4702
(0) -30000 -10000 -3000 -1000 -300 -100 -10 +10 +100 +300 +1000 +3000 +10000 tip