Rev 5554: Sync with trunk in file:///home/vila/src/bzr/bugs/583667-lp-no-edge-2.3/

Vincent Ladeuil v.ladeuil+lp at free.fr
Thu Dec 2 10:06:45 GMT 2010


At file:///home/vila/src/bzr/bugs/583667-lp-no-edge-2.3/

------------------------------------------------------------
revno: 5554 [merge]
revision-id: v.ladeuil+lp at free.fr-20101202100645-00tuab38xr2ksujp
parent: v.ladeuil+lp at free.fr-20101126175908-gkq3rvn1ga1k7e2i
parent: pqm at pqm.ubuntu.com-20101130054940-74uuru7wuvgla2oz
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 583667-lp-no-edge-2.3
timestamp: Thu 2010-12-02 11:06:45 +0100
message:
  Sync with trunk
added:
  doc/developers/xdg_config_spec.txt xdg_config_spec.txt-20101101151358-mqniaqpr56xpb5gu-1
modified:
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
  bzrlib/config.py               config.py-20051011043216-070c74f4e9e338e8
  bzrlib/tests/test_config.py    testconfig.py-20051011041908-742d0c15d8d8c8eb
  doc/en/release-notes/bzr-2.3.txt NEWS-20050323055033-4e00b5db738777ff
  doc/en/whats-new/whats-new-in-2.3.txt whatsnewin2.3.txt-20100818072501-x2h25r7jbnknvy30-1
-------------- next part --------------
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2010-11-18 00:22:24 +0000
+++ b/bzrlib/builtins.py	2010-11-30 05:49:40 +0000
@@ -3749,16 +3749,20 @@
     with bzr send. If neither is specified, the default is the upstream branch
     or the branch most recently merged using --remember.
 
-    When merging a branch, by default the tip will be merged. To pick a different
-    revision, pass --revision. If you specify two values, the first will be used as
-    BASE and the second one as OTHER. Merging individual revisions, or a subset of
-    available revisions, like this is commonly referred to as "cherrypicking".
-
-    Revision numbers are always relative to the branch being merged.
-
-    By default, bzr will try to merge in all new work from the other
-    branch, automatically determining an appropriate base.  If this
-    fails, you may need to give an explicit base.
+    When merging from a branch, by default bzr will try to merge in all new
+    work from the other branch, automatically determining an appropriate base
+    revision.  If this fails, you may need to give an explicit base.
+
+    To pick a different ending revision, pass "--revision OTHER".  bzr will
+    try to merge in all new work up to and including revision OTHER.
+
+    If you specify two values, "--revision BASE..OTHER", only revisions BASE
+    through OTHER, excluding BASE but including OTHER, will be merged.  If this
+    causes some revisions to be skipped, i.e. if the destination branch does
+    not already contain revision BASE, such a merge is commonly referred to as
+    a "cherrypick".
+
+    Revision numbers are always relative to the source branch.
 
     Merge will do its best to combine the changes in two branches, but there
     are some kinds of problems only a human can fix.  When it encounters those,
@@ -3788,7 +3792,7 @@
     you to apply each diff hunk and file change, similar to "shelve".
 
     :Examples:
-        To merge the latest revision from bzr.dev::
+        To merge all new revisions from bzr.dev::
 
             bzr merge ../bzr.dev
 

=== modified file 'bzrlib/config.py'
--- a/bzrlib/config.py	2010-11-17 15:51:10 +0000
+++ b/bzrlib/config.py	2010-11-29 01:23:53 +0000
@@ -1123,7 +1123,9 @@
 def config_dir():
     """Return per-user configuration directory.
 
-    By default this is ~/.bazaar/
+    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,
+    that will be used instead.
 
     TODO: Global option --config-dir to override this.
     """
@@ -1137,8 +1139,23 @@
             raise errors.BzrError('You must have one of BZR_HOME, APPDATA,'
                                   ' or HOME set')
         return osutils.pathjoin(base, 'bazaar', '2.0')
+    elif sys.platform == 'darwin':
+        if base is None:
+            # this takes into account $HOME
+            base = os.path.expanduser("~")
+        return osutils.pathjoin(base, '.bazaar')
     else:
         if base is None:
+
+            xdg_dir = os.environ.get('XDG_CONFIG_HOME', None)
+            if xdg_dir is None:
+                xdg_dir = osutils.pathjoin(os.path.expanduser("~"), ".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 = os.path.expanduser("~")
         return osutils.pathjoin(base, ".bazaar")
 

=== modified file 'bzrlib/tests/test_config.py'
--- a/bzrlib/tests/test_config.py	2010-11-17 15:52:03 +0000
+++ b/bzrlib/tests/test_config.py	2010-11-29 01:23:53 +0000
@@ -432,6 +432,34 @@
             '/home/bogus/.cache')
 
 
+class TestXDGConfigDir(tests.TestCaseInTempDir):
+    # must be in temp dir because config tests for the existence of the bazaar
+    # subdirectory of $XDG_CONFIG_HOME
+
+    def setUp(self):
+        if sys.platform in ('darwin', 'win32'):
+            raise tests.TestNotApplicable(
+                'XDG config dir not used on this platform')
+        super(TestXDGConfigDir, self).setUp()
+        os.environ['HOME'] = self.test_home_dir
+        # BZR_HOME overrides everything we want to test so unset it.
+        del os.environ['BZR_HOME']
+
+    def test_xdg_config_dir_exists(self):
+        """When ~/.config/bazaar exists, use it as the config dir."""
+        newdir = osutils.pathjoin(self.test_home_dir, '.config', 'bazaar')
+        os.makedirs(newdir)
+        self.assertEqual(config.config_dir(), newdir)
+
+    def test_xdg_config_home(self):
+        """When XDG_CONFIG_HOME is set, use it."""
+        xdgconfigdir = osutils.pathjoin(self.test_home_dir, 'xdgconfig')
+        os.environ['XDG_CONFIG_HOME'] = xdgconfigdir
+        newdir = osutils.pathjoin(xdgconfigdir, 'bazaar')
+        os.makedirs(newdir)
+        self.assertEqual(config.config_dir(), newdir)
+
+
 class TestIniConfig(tests.TestCaseInTempDir):
 
     def make_config_parser(self, s):

=== added file 'doc/developers/xdg_config_spec.txt'
--- a/doc/developers/xdg_config_spec.txt	1970-01-01 00:00:00 +0000
+++ b/doc/developers/xdg_config_spec.txt	2010-11-27 05:38:41 +0000
@@ -0,0 +1,27 @@
+Transitioning Unix installs to the XDG Base Directory Specification
+===================================================================
+
+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
+(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
+of ~/.config.
+
+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.)
+
+* 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
+  like to use the XDG specification to do so.
+* Due to a lack of consensus on where plugins should live under the XDG Base
+  Directory spec, continue to look for plugins in ~/.bazaar/plugins.  To
+  change this directory to something not under ~/.bazaar, use the environment
+  variable $BZR_PLUGIN_PATH.

=== modified file 'doc/en/release-notes/bzr-2.3.txt'
--- a/doc/en/release-notes/bzr-2.3.txt	2010-11-26 17:59:08 +0000
+++ b/doc/en/release-notes/bzr-2.3.txt	2010-12-02 10:06:45 +0000
@@ -46,6 +46,9 @@
   number of remaining conflicts. This provides a better feedback about the
   whole resolution process. (Vincent Ladeuil)
 
+* Read configuration files in $XDG_CONFIG_HOME/bazaar on Unix if there is
+  already a directory there.  (Neil Martinsen-Burrell, #195397)
+
 Bug Fixes
 *********
 

=== modified file 'doc/en/whats-new/whats-new-in-2.3.txt'
--- a/doc/en/whats-new/whats-new-in-2.3.txt	2010-11-22 03:35:24 +0000
+++ b/doc/en/whats-new/whats-new-in-2.3.txt	2010-11-29 01:23:53 +0000
@@ -38,6 +38,13 @@
   get the old behavior, one can use ``bzr tags --sort=alpha``.
   (Neil Martinsen-Burrell, #640760)
 
+* On platforms other than Windows and Mac OS X, Bazaar will use configuration
+  files that live in $XDG_CONFIG_HOME/bazaar if that directory exists.  This
+  allows interested individuals to conform to the XDG Base Directory
+  specification.  The plugin location has not changed and is still
+  ~/.bazaar/plugins.  To use a different directory for plugins, use the
+  environment variable BZR_PLUGIN_PATH.  (Neil Martinsen-Burrell, #195397)
+
 Launchpad integration
 *********************
 



More information about the bazaar-commits mailing list