Rev 6596: (richard-wilbur) Also honor $XDG_CONFIG_HOME specification on Mac OS X in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/
Patch Queue Manager
pqm at pqm.ubuntu.com
Wed May 7 22:20:28 UTC 2014
At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 6596 [merge]
revision-id: pqm at pqm.ubuntu.com-20140507222027-mne60p2viqptfcmz
parent: pqm at pqm.ubuntu.com-20140416071826-k66siaq8sk5rci1v
parent: fme at openerp.com-20140214102949-mee83zlgwq5caakt
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2014-05-07 22:20:27 +0000
message:
(richard-wilbur) Also honor $XDG_CONFIG_HOME specification on Mac OS X
platform. (Fabien Meghazi) (Fabien Meghazi (OpenERP))
modified:
bzrlib/config.py config.py-20051011043216-070c74f4e9e338e8
bzrlib/tests/test_config.py testconfig.py-20051011041908-742d0c15d8d8c8eb
doc/developers/xdg_config_spec.txt xdg_config_spec.txt-20101101151358-mqniaqpr56xpb5gu-1
doc/en/release-notes/bzr-2.7.txt bzr2.7.txt-20130727124539-wnx897hy9l2h9f7x-1
=== modified file 'bzrlib/config.py'
--- a/bzrlib/config.py 2014-01-23 19:00:51 +0000
+++ b/bzrlib/config.py 2014-02-14 10:29:49 +0000
@@ -1488,7 +1488,7 @@
"""Return per-user configuration directory as unicode string
By default this is %APPDATA%/bazaar/2.0 on Windows, ~/.bazaar on Mac OS X
- and Linux. On Linux, if there is a $XDG_CONFIG_HOME/bazaar directory,
+ and Linux. On Mac OS X and Linux, if there is a $XDG_CONFIG_HOME/bazaar directory,
that will be used instead.
TODO: Global option --config-dir to override this.
@@ -1503,16 +1503,14 @@
# APPDATA, but hard to move. See bug 348640 for more.
return osutils.pathjoin(base, 'bazaar', '2.0')
if base is None:
- # GZ 2012-02-01: What should OSX use instead of XDG if anything?
- if sys.platform != 'darwin':
- xdg_dir = osutils.path_from_environ('XDG_CONFIG_HOME')
- if xdg_dir is None:
- xdg_dir = osutils.pathjoin(osutils._get_home_dir(), ".config")
- xdg_dir = osutils.pathjoin(xdg_dir, 'bazaar')
- if osutils.isdir(xdg_dir):
- trace.mutter(
- "Using configuration in XDG directory %s." % xdg_dir)
- return xdg_dir
+ xdg_dir = osutils.path_from_environ('XDG_CONFIG_HOME')
+ if xdg_dir is None:
+ xdg_dir = osutils.pathjoin(osutils._get_home_dir(), ".config")
+ xdg_dir = osutils.pathjoin(xdg_dir, 'bazaar')
+ if osutils.isdir(xdg_dir):
+ trace.mutter(
+ "Using configuration in XDG directory %s." % xdg_dir)
+ return xdg_dir
base = osutils._get_home_dir()
return osutils.pathjoin(base, ".bazaar")
=== modified file 'bzrlib/tests/test_config.py'
--- a/bzrlib/tests/test_config.py 2014-01-23 19:00:51 +0000
+++ b/bzrlib/tests/test_config.py 2014-02-14 10:29:49 +0000
@@ -595,7 +595,7 @@
# subdirectory of $XDG_CONFIG_HOME
def setUp(self):
- if sys.platform in ('darwin', 'win32'):
+ if sys.platform == 'win32':
raise tests.TestNotApplicable(
'XDG config dir not used on this platform')
super(TestXDGConfigDir, self).setUp()
=== modified file 'doc/developers/xdg_config_spec.txt'
--- a/doc/developers/xdg_config_spec.txt 2010-11-27 05:38:41 +0000
+++ b/doc/developers/xdg_config_spec.txt 2014-02-14 10:29:49 +0000
@@ -2,9 +2,8 @@
===================================================================
Currently, Bazaar stores its configuration files and plugins under the
-directory ~/.bazaar on unix installs. On Windows, this is
-%APPDATA%/Bazaar/2.0 and on Mac OS X, the directory is ~/.bazaar. With the
-XDG Base Directory specification
+directory ~/.bazaar on unix installs. On Windows, this is %APPDATA%/Bazaar/2.0.
+With the XDG Base Directory specification
(http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html), many
Linux and Unix platforms have tried to centralize configuration files under a
specific directory referred to as $XDG_CONFIG_HOME. This has a default value
@@ -13,10 +12,8 @@
Bazaar would like to be a good Unix citizen by using these standard locations
for configuration files. As such, we should support that location, but not
require it. Note that the following descriptions do not apply
-to Windows or Mac OS X which should use their own native configuration
-locations. (On Windows, we currently do this by working under %APPDATA%. The
-Mac OS X equivalent would be ~/Library/Application Support/Bazaar but there is
-also cultural support for ~/.bazaar on that platform.)
+to Windows which should use their own native configuration
+locations. (On Windows, we currently do this by working under %APPDATA%.
* If $XDG_CONFIG_HOME/bazaar exists, use the files there for configuration,
noting in the log that we are doing so. This allows individuals who would
=== modified file 'doc/en/release-notes/bzr-2.7.txt'
--- a/doc/en/release-notes/bzr-2.7.txt 2014-04-16 07:18:26 +0000
+++ b/doc/en/release-notes/bzr-2.7.txt 2014-05-07 22:20:27 +0000
@@ -59,6 +59,12 @@
.. Major internal changes, unlikely to be visible to users or plugin
developers, but interesting for bzr developers.
+Changed Behaviour
+*****************
+
+* Also honor $XDG_CONFIG_HOME specification on Mac OS X platform.
+ (Fabien Meghazi)
+
Testing
*******
More information about the bazaar-commits
mailing list