Merge lp:~jjed/bzr/xdg_basedir_compliance into lp:bzr
Proposed by
Jjed
Status: | Work in progress |
---|---|
Proposed branch: | lp:~jjed/bzr/xdg_basedir_compliance |
Merge into: | lp:bzr |
Diff against target: |
65 lines (+30/-3) 1 file modified
bzrlib/config.py (+30/-3) |
To merge this branch: | bzr merge lp:~jjed/bzr/xdg_basedir_compliance |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Robert Collins (community) | Needs Resubmitting | ||
Andrew Bennetts | Needs Resubmitting | ||
Review via email: mp+24954@code.launchpad.net |
Description of the change
This branch moves the default bzr configuration path from $HOME/.bazaar to $XDG_CONFIG_
The migration of old configuration files is silent. However, to obey the principle of least surprise, the old configuration files are left in place, and a file is written there to alert the user of the new, actively-used location.
To post a comment you must log in.
Thanks for moving this bug along.
I read the linked bug (bug 195397), but didn't see any clear conclusion about what to do with plugins, and this branch doesn't seem to address them. I think they need to be addressed before this lands, because currently they are expected to exist in ~/.bazaar/plugins.
On to the code:
I'm not sure that calling ensure_ config_ dir_exists( ) in Config.__init__ is a good idea. Why is that necessary? In general it's nice to defer doing work until it is actually required. And I'm not sure it makes sense for BranchConfig to do this unconditionally.
> + while os.path. exists( user_notice) : (user_notice, 'ALT'))
> + user_notice = '_'.join(
This seems like overkill for a one-off transition. Is this just being extra careful, or do you expect this to be used? And it seems a shame to be so cautious and then leave a race between the exists check and the file open anyway.
> with open(user_notice, 'w') as file:
This is a Python 2.5-ism (although it needs a __future__ import), but bzr supports Python 2.4+. So update this to use try/finally.
Finally, the docs must be updated before this could be merged, so for the docs and the plugins issue I'm marking this Resubmit.