Patchwork D10078: rhg: Bug fix: with share-safe, always read store requirements

login
register
mail settings
Submitter phabricator
Date Feb. 25, 2021, 10:15 p.m.
Message ID <differential-rev-PHID-DREV-6xduwxlrwpuekmrrv5k6-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48393/
State Superseded
Headers show

Comments

phabricator - Feb. 25, 2021, 10:15 p.m.
SimonSapin created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  That is, the `store/requires` file,
  regardless of whether the repository is a shared.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10078

AFFECTED FILES
  rust/hg-core/src/repo.rs

CHANGE DETAILS




To: SimonSapin, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/rust/hg-core/src/repo.rs b/rust/hg-core/src/repo.rs
--- a/rust/hg-core/src/repo.rs
+++ b/rust/hg-core/src/repo.rs
@@ -116,9 +116,6 @@ 
         let store_path;
         if !shared {
             store_path = dot_hg.join("store");
-            if share_safe {
-                reqs.extend(requirements::load(Vfs { base: &store_path })?);
-            }
         } else {
             let bytes = hg_vfs.read("sharedpath")?;
             let mut shared_path = get_path_from_bytes(&bytes).to_owned();
@@ -166,6 +163,9 @@ 
                 repo_config_files.insert(0, shared_path.join("hgrc"))
             }
         }
+        if share_safe {
+            reqs.extend(requirements::load(Vfs { base: &store_path })?);
+        }
 
         let repo_config = config.combine_with_repo(&repo_config_files)?;