Mercurial > hg
comparison mercurial/upgrade.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 | 4c1d39215034 |
children | e58e234096de |
comparison
equal
deleted
inserted
replaced
45105:5d09a120b4be | 45106:a03c177a4679 |
---|---|
1089 _( | 1089 _( |
1090 b'marking source repository as being upgraded; clients will be ' | 1090 b'marking source repository as being upgraded; clients will be ' |
1091 b'unable to read from repository\n' | 1091 b'unable to read from repository\n' |
1092 ) | 1092 ) |
1093 ) | 1093 ) |
1094 scmutil.writerequires( | 1094 scmutil.writereporequirements( |
1095 srcrepo.vfs, srcrepo.requirements | {b'upgradeinprogress'} | 1095 srcrepo, srcrepo.requirements | {b'upgradeinprogress'} |
1096 ) | 1096 ) |
1097 | 1097 |
1098 ui.status(_(b'starting in-place swap of repository data\n')) | 1098 ui.status(_(b'starting in-place swap of repository data\n')) |
1099 ui.status(_(b'replaced files will be backed up at %s\n') % backuppath) | 1099 ui.status(_(b'replaced files will be backed up at %s\n') % backuppath) |
1100 | 1100 |
1120 _( | 1120 _( |
1121 b'finalizing requirements file and making repository readable ' | 1121 b'finalizing requirements file and making repository readable ' |
1122 b'again\n' | 1122 b'again\n' |
1123 ) | 1123 ) |
1124 ) | 1124 ) |
1125 scmutil.writerequires(srcrepo.vfs, requirements) | 1125 scmutil.writereporequirements(srcrepo, requirements) |
1126 | 1126 |
1127 # The lock file from the old store won't be removed because nothing has a | 1127 # The lock file from the old store won't be removed because nothing has a |
1128 # reference to its new location. So clean it up manually. Alternatively, we | 1128 # reference to its new location. So clean it up manually. Alternatively, we |
1129 # could update srcrepo.svfs and other variables to point to the new | 1129 # could update srcrepo.svfs and other variables to point to the new |
1130 # location. This is simpler. | 1130 # location. This is simpler. |