comparison mercurial/hg.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 b14fdf1fb615
children 09a37a5d8f5d e5f54c4ec075
comparison
equal deleted inserted replaced
40389:1b183edbb68e 40390:7e3b6c4f01a2
575 # Include everything by default if only exclusion patterns defined. 575 # Include everything by default if only exclusion patterns defined.
576 if storeexcludepats and not storeincludepats: 576 if storeexcludepats and not storeincludepats:
577 storeincludepats = {'path:.'} 577 storeincludepats = {'path:.'}
578 578
579 createopts['narrowfiles'] = True 579 createopts['narrowfiles'] = True
580
581 if depth:
582 createopts['shallowfilestore'] = True
580 583
581 if srcpeer.capable(b'lfs-serve'): 584 if srcpeer.capable(b'lfs-serve'):
582 # Repository creation honors the config if it disabled the extension, so 585 # Repository creation honors the config if it disabled the extension, so
583 # we can't just announce that lfs will be enabled. This check avoids 586 # we can't just announce that lfs will be enabled. This check avoids
584 # saying that lfs will be enabled, and then saying it's an unknown 587 # saying that lfs will be enabled, and then saying it's an unknown