Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 40390:7e3b6c4f01a2
localrepo: support marking repos as having shallow file storage
Various operations against repositories need to know if repository
storage is full or partial. For example, a checkout (including possibly
a widening of a sparse checkout), needs to know if it can assume all file
revisions are available or whether to look for missing revisions first.
This commit lays the plumbing for doing that.
We define a repo creation option that indicates that shallow file storage
is desired.
The SQLite store uses this creation option to add an extra repo requirement
indicating file storage is shallow.
A new repository feature has been added to indicate that file storage is
shallow. The SQLite store adds this feature when the shallow file store
requirement is present.
Code can now look at repo.features to determine if repo file storage may
be shallow and take additional actions if so.
While we're here, we also teach the SQLite store to handle the narrow repo
requirement, which gets added when making narrow clones.
Differential Revision: https://phab.mercurial-scm.org/D5166
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Fri, 19 Oct 2018 14:59:03 +0200 |
parents | dee73a97e132 |
children | 597bb5a6867f |
comparison
equal
deleted
inserted
replaced
40389:1b183edbb68e | 40390:7e3b6c4f01a2 |
---|---|
2920 'lfs', | 2920 'lfs', |
2921 'narrowfiles', | 2921 'narrowfiles', |
2922 'sharedrepo', | 2922 'sharedrepo', |
2923 'sharedrelative', | 2923 'sharedrelative', |
2924 'shareditems', | 2924 'shareditems', |
2925 'shallowfilestore', | |
2925 } | 2926 } |
2926 | 2927 |
2927 return {k: v for k, v in createopts.items() if k not in known} | 2928 return {k: v for k, v in createopts.items() if k not in known} |
2928 | 2929 |
2929 def createrepository(ui, path, createopts=None): | 2930 def createrepository(ui, path, createopts=None): |
2947 Boolean indicating if the path to the shared repo should be | 2948 Boolean indicating if the path to the shared repo should be |
2948 stored as relative. By default, the pointer to the "parent" repo | 2949 stored as relative. By default, the pointer to the "parent" repo |
2949 is stored as an absolute path. | 2950 is stored as an absolute path. |
2950 shareditems | 2951 shareditems |
2951 Set of items to share to the new repository (in addition to storage). | 2952 Set of items to share to the new repository (in addition to storage). |
2953 shallowfilestore | |
2954 Indicates that storage for files should be shallow (not all ancestor | |
2955 revisions are known). | |
2952 """ | 2956 """ |
2953 createopts = defaultcreateopts(ui, createopts=createopts) | 2957 createopts = defaultcreateopts(ui, createopts=createopts) |
2954 | 2958 |
2955 unknownopts = filterknowncreateopts(ui, createopts) | 2959 unknownopts = filterknowncreateopts(ui, createopts) |
2956 | 2960 |