Merge lp:~abentley/bzr-pqm/config-stack-fixes into lp:bzr-pqm

Proposed by Aaron Bentley
Status: Merged
Approved by: Martin Packman
Approved revision: 90
Merged at revision: 90
Proposed branch: lp:~abentley/bzr-pqm/config-stack-fixes
Merge into: lp:bzr-pqm
Diff against target: 56 lines (+7/-3)
3 files modified
pqm_submit.py (+4/-1)
tests/test_lpland.py (+2/-1)
tests/test_pqm_submit.py (+1/-1)
To merge this branch: bzr merge lp:~abentley/bzr-pqm/config-stack-fixes
Reviewer Review Type Date Requested Status
Martin Packman (community) Approve
Review via email: mp+96233@code.launchpad.net

Commit message

Fix config use for bzr 2.3-2.6dev

Description of the change

This branch fixes the use of configuration. It restores compatibility with 2.4 and earlier by wrapping config stack access. It restores compatibility with bzr.dev by working around bug #948344.

I've run the test suite with bzr 2.3-bzr.dev r6480

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote :

Extending an using the compat wrapper like this looks fine. Would perhaps be neatest to pull the wrapper logic out of the pqm_submit module but doesn't need to happen here.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'pqm_submit.py'
2--- pqm_submit.py 2012-02-22 13:14:40 +0000
3+++ pqm_submit.py 2012-03-06 20:34:19 +0000
4@@ -217,6 +217,9 @@
5 return value
6 return None
7
8+ def set(self, name, value):
9+ self._sources[0].set_user_option(name, value)
10+
11
12 def pqm_email(local_config, submit_location):
13 """Determine the PQM email address.
14@@ -227,7 +230,7 @@
15 mail_to = local_config.get('pqm_email')
16 if not mail_to:
17 submit_branch = Branch.open(submit_location)
18- submit_branch_config = submit_branch.get_config_stack()
19+ submit_branch_config = get_stacked_config(submit_branch)
20 mail_to = submit_branch_config.get('child_pqm_email')
21 if mail_to is None:
22 return None
23
24=== modified file 'tests/test_lpland.py'
25--- tests/test_lpland.py 2012-02-28 16:57:20 +0000
26+++ tests/test_lpland.py 2012-03-06 20:34:19 +0000
27@@ -14,6 +14,7 @@
28 errors,
29 ui,
30 )
31+from bzrlib.plugins.pqm.pqm_submit import get_stacked_config
32 from bzrlib.plugins.pqm.lpland import (
33 get_bugs_clause,
34 get_email,
35@@ -667,7 +668,7 @@
36 def make_submitter(self):
37 """Return a Submitter for testing."""
38 b = self.make_branch('source')
39- b.get_config().set_user_option('pqm_email', 'PQM <pqm@example.com>')
40+ get_stacked_config(b).set('pqm_email', 'PQM <pqm@example.com>')
41 lp_source = self.make_branch('lp_source')
42 mp = MergeProposal(FakeLPMergeProposal())
43 return Submitter(b, mp)
44
45=== modified file 'tests/test_pqm_submit.py'
46--- tests/test_pqm_submit.py 2012-02-22 13:14:40 +0000
47+++ tests/test_pqm_submit.py 2012-03-06 20:34:19 +0000
48@@ -440,7 +440,7 @@
49
50 def test_child_pqm_email(self):
51 local_branch = self.make_branch('local')
52- local_config = local_branch.get_config_stack()
53+ local_config = pqm_submit.get_stacked_config(local_branch)
54 submit_branch = self.make_branch('submit')
55 submit_config = submit_branch.get_config()
56 submit_config.set_user_option('child_pqm_email', 'child@example.org')

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: