Patchwork D8691: hg: allow usage of XDG_CONFIG_HOME/hg/hgrc on OSX

login
register
mail settings
Submitter phabricator
Date July 7, 2020, 12:31 p.m.
Message ID <differential-rev-PHID-DREV-dmg6oxfalbe6w22v7pbi-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46644/
State Superseded
Headers show

Comments

phabricator - July 7, 2020, 12:31 p.m.
graemenail created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  As per mercurial/help/config.txt, XDG_CONFIG_HOME/hg/hgrc should be consulted
  on Unix systems.
  
  This patch removes the Darwin specific code in changeset 354020079723 <https://phab.mercurial-scm.org/rHG354020079723e02ad6db68f58ef26eb7ebd005a8> to enable
  this behaviour. As such, backwards compatibility is retained in the same manner;
  creating ~/.hgrc when no hgrc exists.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/scmposix.py
  tests/test-xdg.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-xdg.t b/tests/test-xdg.t
--- a/tests/test-xdg.t
+++ b/tests/test-xdg.t
@@ -1,4 +1,4 @@ 
-#if no-windows no-osx
+#if no-windows
 
   $ mkdir -p xdgconf/hg
   $ echo '[ui]' > xdgconf/hg/hgrc
diff --git a/mercurial/scmposix.py b/mercurial/scmposix.py
--- a/mercurial/scmposix.py
+++ b/mercurial/scmposix.py
@@ -54,8 +54,6 @@ 
 def userrcpath():
     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):