[MERGE] Request merge of lp:~dobey/bzr/xdgconfigdir to trunk
John Arbash Meinel
john at arbash-meinel.com
Wed Oct 29 21:14:23 GMT 2008
John Arbash Meinel has voted resubmit.
Status is now: Resubmit
Comment:
I will comment that we have a lot of different systems, and I would
imagine that ".config" is not present on a lot of them. Certainly on
most of my systems it is not present.
So doing the plain:
+ if (os.path.isdir(oldpath) and not os.path.isdir(newpath)):
+ os.rename(oldpath, newpath)
Is going to fail because the target is not present.
Further, os.rename() fails if the two are on different filesystems.
Which seems to be the point of "$XDG_CONFIG_HOME".
You could use "shutil.move()" which I think handles the case where the
source and target are on different filesystems.
Though I'll also say having files renamed on your filesystem as part of
what is generally considered a readonly operation (config_dir()) is
probably not the best choice.
I believe in other cases where we have moved something, we just asked
the user to do so:
trace.warning('Please rename ~/.bazaar/branches.conf'
' to ~/.bazaar/locations.conf')
How widespread is the XDG_CONFIG_DIR option?
I realize it is part of some standardization, but do any platforms we
actually support use it? It seems like supporting the standard is
something that really needs to be decided upon.
I would probably rather support XDG_CONFIG_DIR if it is present, but not
use ~/.config/* by default.
And for completeness, to be merged we would need:
1) An entry in NEWS indicating this change, especially as it means older
clients won't be able to find the config directory anymore.
2) Tests in bzrlib/tests/test_config.py which test what happens under
the various circumstances. What happens if both are present, do we find
the old folder if the new one isn't there, etc.
For details, see:
http://bundlebuggy.aaronbentley.com/project/bzr/request/%3C1225157843.25420.7.camel%40lunatari%3E
Project: Bazaar
More information about the bazaar
mailing list