diff mercurial/dispatch.py @ 52453:8a52fd131d3b

repo-config: adjust "root" path for parsing shared config That "root" argument is used to resolve relative path in the config. For a repository config it is expected to be the root of the working copy (the directory that contains the `.hg` directory). Before this patch, the config was loaded using the `.hg/` directory of the share source, this is not the right directory and would break in all cases. Instead we use the working copy directory of the share. This is not always good, if some relative path we pointing inside the source's `.hg`. However that is better than something plain wrong. Also this is the right answer for all path that refer to the actual working copy. Fixing this ambiguity is left as an exercises to a future developer. At least we no longer use a plain invalid value.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 23 Oct 2024 00:00:17 +0200
parents 8ac33b3f2552
children 0b791c90280a
line wrap: on
line diff
--- a/mercurial/dispatch.py	Tue Oct 22 23:50:11 2024 +0200
+++ b/mercurial/dispatch.py	Wed Oct 23 00:00:17 2024 +0200
@@ -947,8 +947,7 @@
                 return
             hgvfs = vfs.vfs(os.path.join(path, b".hg"))
             sharedvfs = localrepo._getsharedvfs(hgvfs, requirements)
-            root = sharedvfs.base
-            ui.readconfig(sharedvfs.join(b"hgrc"), root)
+            ui.readconfig(sharedvfs.join(b"hgrc"), root=path)
     except IOError:
         pass