Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 45355:a1f51c7dce0f
repository: introduce constant for sparse repo requirement and use it
In future we will like to much cleaner logic around which requirement is for
working copy and which can go in store. To start with that, we first need to
de-clutter the requirement values spread around and replace them with constants.
Differential Revision: https://phab.mercurial-scm.org/D8911
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sat, 08 Aug 2020 10:06:32 -0700 |
parents | c4fe2262435e |
children | f025b97f3758 |
comparison
equal
deleted
inserted
replaced
45354:c4fe2262435e | 45355:a1f51c7dce0f |
---|---|
814 Extensions can monkeypatch this function to perform additional | 814 Extensions can monkeypatch this function to perform additional |
815 checking. | 815 checking. |
816 | 816 |
817 ``error.RepoError`` should be raised on failure. | 817 ``error.RepoError`` should be raised on failure. |
818 """ | 818 """ |
819 if b'exp-sparse' in requirements and not sparse.enabled: | 819 if repository.SPARSE_REQUIREMENT in requirements and not sparse.enabled: |
820 raise error.RepoError( | 820 raise error.RepoError( |
821 _( | 821 _( |
822 b'repository is using sparse feature but ' | 822 b'repository is using sparse feature but ' |
823 b'sparse is not enabled; enable the ' | 823 b'sparse is not enabled; enable the ' |
824 b'"sparse" extensions to access' | 824 b'"sparse" extensions to access' |
1065 b'store', | 1065 b'store', |
1066 b'fncache', | 1066 b'fncache', |
1067 b'shared', | 1067 b'shared', |
1068 b'relshared', | 1068 b'relshared', |
1069 b'dotencode', | 1069 b'dotencode', |
1070 b'exp-sparse', | 1070 repository.SPARSE_REQUIREMENT, |
1071 b'internal-phase', | 1071 b'internal-phase', |
1072 } | 1072 } |
1073 | 1073 |
1074 # list of prefix for file which can be written without 'wlock' | 1074 # list of prefix for file which can be written without 'wlock' |
1075 # Extensions should extend this list when needed | 1075 # Extensions should extend this list when needed |