Mercurial > hg
comparison mercurial/bundle2.py @ 45106:a03c177a4679
scmutil: add writereporequirements() and route requires writing through it
In upcoming patches, to implement Share Safe plan we will be introducing
requires file in store. We need to route all callers to a single function
to check for a share-safe requirement and if present, write requirements to
.hg/store/requires instead.
After this patch, callers directly calling scmutil.writerequires() are only
those where we don't have the repo object, for example when initializing
the repository object itself.
Differential Revision: https://phab.mercurial-scm.org/D8631
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Tue, 14 Apr 2020 16:43:54 +0530 |
parents | 8407031f195f |
children | b1e51ef4e536 |
comparison
equal
deleted
inserted
replaced
45105:5d09a120b4be | 45106:a03c177a4679 |
---|---|
164 node as nodemod, | 164 node as nodemod, |
165 obsolete, | 165 obsolete, |
166 phases, | 166 phases, |
167 pushkey, | 167 pushkey, |
168 pycompat, | 168 pycompat, |
169 scmutil, | |
169 streamclone, | 170 streamclone, |
170 tags, | 171 tags, |
171 url, | 172 url, |
172 util, | 173 util, |
173 ) | 174 ) |
1975 ) | 1976 ) |
1976 op.repo.requirements.add(b'treemanifest') | 1977 op.repo.requirements.add(b'treemanifest') |
1977 op.repo.svfs.options = localrepo.resolvestorevfsoptions( | 1978 op.repo.svfs.options = localrepo.resolvestorevfsoptions( |
1978 op.repo.ui, op.repo.requirements, op.repo.features | 1979 op.repo.ui, op.repo.requirements, op.repo.features |
1979 ) | 1980 ) |
1980 op.repo._writerequirements() | 1981 scmutil.writereporequirements(op.repo) |
1981 | 1982 |
1982 bundlesidedata = bool(b'exp-sidedata' in inpart.params) | 1983 bundlesidedata = bool(b'exp-sidedata' in inpart.params) |
1983 reposidedata = bool(b'exp-sidedata-flag' in op.repo.requirements) | 1984 reposidedata = bool(b'exp-sidedata-flag' in op.repo.requirements) |
1984 if reposidedata and not bundlesidedata: | 1985 if reposidedata and not bundlesidedata: |
1985 msg = b"repository is using sidedata but the bundle source do not" | 1986 msg = b"repository is using sidedata but the bundle source do not" |