comparison rust/hg-core/src/repo.rs @ 46613:f64b6953db70

rhg: Bug fix: with share-safe, always read store requirements That is, the `store/requires` file, regardless of whether the repository is a shared. Differential Revision: https://phab.mercurial-scm.org/D10078
author Simon Sapin <simon.sapin@octobus.net>
date Thu, 25 Feb 2021 23:14:35 +0100
parents 755c31a1caf9
children e8cd519a0a34
comparison
equal deleted inserted replaced
46612:80f7567ac9bb 46613:f64b6953db70
114 let share_safe = reqs.contains(requirements::SHARESAFE_REQUIREMENT); 114 let share_safe = reqs.contains(requirements::SHARESAFE_REQUIREMENT);
115 115
116 let store_path; 116 let store_path;
117 if !shared { 117 if !shared {
118 store_path = dot_hg.join("store"); 118 store_path = dot_hg.join("store");
119 if share_safe {
120 reqs.extend(requirements::load(Vfs { base: &store_path })?);
121 }
122 } else { 119 } else {
123 let bytes = hg_vfs.read("sharedpath")?; 120 let bytes = hg_vfs.read("sharedpath")?;
124 let mut shared_path = get_path_from_bytes(&bytes).to_owned(); 121 let mut shared_path = get_path_from_bytes(&bytes).to_owned();
125 if relative { 122 if relative {
126 shared_path = dot_hg.join(shared_path) 123 shared_path = dot_hg.join(shared_path)
164 161
165 if share_safe { 162 if share_safe {
166 repo_config_files.insert(0, shared_path.join("hgrc")) 163 repo_config_files.insert(0, shared_path.join("hgrc"))
167 } 164 }
168 } 165 }
166 if share_safe {
167 reqs.extend(requirements::load(Vfs { base: &store_path })?);
168 }
169 169
170 let repo_config = config.combine_with_repo(&repo_config_files)?; 170 let repo_config = config.combine_with_repo(&repo_config_files)?;
171 171
172 let repo = Self { 172 let repo = Self {
173 requirements: reqs, 173 requirements: reqs,