changeset 51632:a4b3b8dee0a8

hgrc: search XDG_CONFIG_HOME on mac Searching for hgrc was special cased not to look through ~/.config/hg on Mac, but that’s unnecessary: Macs support it as do other unix based systems. There are plenty tools that use it there, e.g. git, and people expect it to work, e.g. "https://stackoverflow.com/questions/72499837/mercurial-on-macos-doesnt-read-config-hg-hgrc". Initial code introduced in 354020079723.
author Hraban Luyat <hraban@0brg.net>
date Tue, 26 Mar 2024 01:27:27 -0400
parents 55e7784eb3bc
children 59f846fbc11d
files mercurial/scmposix.py tests/test-xdg.t
diffstat 2 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/scmposix.py	Tue Apr 16 09:51:11 2024 +0200
+++ b/mercurial/scmposix.py	Tue Mar 26 01:27:27 2024 -0400
@@ -60,8 +60,6 @@
 def userrcpath() -> List[bytes]:
     if pycompat.sysplatform == b'plan9':
         return [encoding.environ[b'home'] + b'/lib/hgrc']
-    elif pycompat.isdarwin:
-        return [os.path.expanduser(b'~/.hgrc')]
     else:
         confighome = encoding.environ.get(b'XDG_CONFIG_HOME')
         if confighome is None or not os.path.isabs(confighome):
--- a/tests/test-xdg.t	Tue Apr 16 09:51:11 2024 +0200
+++ b/tests/test-xdg.t	Tue Mar 26 01:27:27 2024 -0400
@@ -1,4 +1,4 @@
-#if no-windows no-osx
+#if no-windows
 
   $ mkdir -p xdgconf/hg
   $ echo '[ui]' > xdgconf/hg/hgrc