Merge lp:~abentley/bzr/appenddir into lp:bzr
Status: | Work in progress |
---|---|
Proposed branch: | lp:~abentley/bzr/appenddir |
Merge into: | lp:bzr |
Diff against target: |
158 lines (+43/-14) 5 files modified
bzrlib/config.py (+12/-9) bzrlib/help_topics/en/configuration.txt (+17/-1) bzrlib/tests/test_config.py (+7/-1) doc/developers/contribution-quickstart.txt (+2/-2) doc/en/release-notes/bzr-2.4.txt (+5/-1) |
To merge this branch: | bzr merge lp:~abentley/bzr/appenddir |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Vincent Ladeuil | Abstain | ||
Review via email: mp+50060@code.launchpad.net |
Commit message
Support appenddir configuration policy. (Aaron Bentley)
Description of the change
Hi all,
This branch introduces a new configuration policy, "appenddir". This new
policy is similar to appendpath, except that it appends only the last path
element to the value. Here's an example configuration:
[/home/
public_branch = lp:~abentley/bzr
public_
This means that the public branch for "/home/
"lp:~abentley/bzr/foo", as with appendpath. But the public branch of
"/home/
appendpath would make it "lp:~abentley/bzr/bar/foo". While the appendpath
behaviour may be useful for some, it produces too-long branch names in many
cases.
My motivating case is "bzr-pipeline". When a pipeline is created with
"reconfigure-
with branches at ".bzr/pipes/". If the push location had been set with
appendpath, a push location of "lp:~abentley/bzr/foo" would become
"lp:~abentley/bzr/.bzr/pipes/foo", which is undesirable. With appenddir, it
would retain the value "lp:~abentley/bzr/foo". I believe bzr-colo has the same
issue.
While the new policy is syntactically compatible with existing config files,
current versions of bzr treat unknown configuration policies as internal
errors:
*** Bazaar has encountered an internal error. This probably indicates a
bug in Bazaar. You can help us fix it by filing a bug report at
https:/
including this traceback and a description of the problem.
I would be happy to create a bugfix for earlier bzrs so that they emit a
user-friendly error when they encounter unknown configuration policies.
Unmerged revisions
- 5668. By Aaron Bentley
-
Saner checking for valid store locations.
- 5667. By Aaron Bentley
-
Support appenddir configuration policy.
Thanks for working on this, this is clearly a sore point in out config handling.
I've got a couple of questions about the implementation:
- are you aware of the work in progress documented in configuration.txt in the lp:~bzr/bzr/devnotes ? The interpolation part especially may provide a more scalable means to achieve the same result.
- why did you chose 'appendir' instead of say 'nick' ? I'm well aware that they may not match but the later would also work for looms,
27 STORE_LOCATION = POLICY_NONE NORECURSE = POLICY_NORECURSE APPENDPATH = POLICY_APPENDPATH LOCATION_ APPENDDIR = POLICY_APPENDDIR
28 STORE_LOCATION_
29 STORE_LOCATION_
30 STORE_BRANCH = 3
31 STORE_GLOBAL = 4
32 +STORE_
The overlapping between STORE_* and POLICY_* is already a concern in the current implementation, could you think of a better way to articulate their relationship ?
This shows even more in:
51 - if store not in [STORE_LOCATION, NORECURSE, APPENDPATH] :
52 - STORE_LOCATION_
53 - STORE_LOCATION_
54 + if store not in _policy_name:
Err, wait, checking 'store' in '_policy_name' ? This at least requires a comment...