Merge lp:~jelmer/bzr-pqm/drop-deprecated into lp:bzr-pqm

Proposed by Jelmer Vernooij
Status: Merged
Merged at revision: 87
Proposed branch: lp:~jelmer/bzr-pqm/drop-deprecated
Merge into: lp:bzr-pqm
Diff against target: 93 lines (+1/-57)
2 files modified
pqm_submit.py (+1/-21)
tests/test_pqm_submit.py (+0/-36)
To merge this branch: bzr merge lp:~jelmer/bzr-pqm/drop-deprecated
Reviewer Review Type Date Requested Status
Bzr-pqm-devel Pending
Review via email: mp+86074@code.launchpad.net

Description of the change

Drop support for the long deprecated `pqm_branch` and `public_repository` options.

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

This is probably going to break some people - is there any specific
benefit to dropping it?

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Am 19/12/11 07:49, schrieb Martin Pool:
> This is probably going to break some people - is there any specific
> benefit to dropping it?
>
Mostly that it will make the migration to config stacks easier, as there
would be fewer options to migrate. These options have been deprecated
(and warning) for the last couple of years, so it seemed fair to drop
them now.

Keeping them and migrating them to config stacks too shouldn't be too
hard though.

Cheers,

Jelmer

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 2011-12-15 01:33:31 +0000
3+++ pqm_submit.py 2011-12-16 16:32:24 +0000
4@@ -86,19 +86,6 @@
5
6 if public_location is None:
7 public_location = self.source_branch.get_public_branch()
8- # Fall back to the old public_repository hack.
9- if public_location is None:
10- src_loc = source_branch.bzrdir.root_transport.local_abspath('.')
11- repository = source_branch.repository
12- repo_loc = repository.bzrdir.root_transport.local_abspath('.')
13- repo_config = _mod_config.LocationConfig(repo_loc)
14- public_repo = repo_config.get_user_option("public_repository")
15- if public_repo is not None:
16- warning("Please use public_branch, not public_repository, "
17- "to set the public location of branches.")
18- branch_relpath = osutils.relpath(repo_loc, src_loc)
19- public_location = urlutils.join(public_repo, branch_relpath)
20-
21 if public_location is None:
22 raise errors.NoPublicBranch(self.source_branch)
23 self.public_location = public_location
24@@ -108,14 +95,7 @@
25 raise errors.BzrError(
26 "Cannot determine submit location to use.")
27 config = self.source_branch.get_config()
28- # First check the deprecated pqm_branch config key:
29- submit_location = config.get_user_option('pqm_branch')
30- if submit_location is not None:
31- warning("Please use submit_branch, not pqm_branch to set "
32- "the PQM merge target branch.")
33- else:
34- # Otherwise, use the standard config key:
35- submit_location = self.source_branch.get_submit_branch()
36+ submit_location = self.source_branch.get_submit_branch()
37
38 if submit_location is None:
39 raise errors.NoSubmitBranch(self.source_branch)
40
41=== modified file 'tests/test_pqm_submit.py'
42--- tests/test_pqm_submit.py 2010-08-06 16:52:30 +0000
43+++ tests/test_pqm_submit.py 2011-12-16 16:32:24 +0000
44@@ -223,25 +223,6 @@
45 self.assertEqual('http://example.com/public',
46 submission.public_location)
47
48- def test_find_public_branch_from_repo(self):
49- # Test that public_location can be inferred from the obsolete
50- # "public_repository" config option.
51- source_repo = self.make_repository('repo', shared=True)
52- source_branch = self.make_bzrdir('repo/source').create_branch()
53-
54- config = _mod_config.LocationConfig(
55- source_repo.bzrdir.root_transport.base)
56- config.set_user_option(
57- 'public_repository', 'http://example.com/repo',
58- store=_mod_config.STORE_LOCATION_NORECURSE)
59-
60- submission = pqm_submit.PQMSubmission(
61- source_branch=source_branch,
62- submit_location='submit-branch',
63- message='commit message')
64- self.assertEqual('http://example.com/repo/source',
65- submission.public_location)
66-
67 def test_find_public_branch_missing(self):
68 source_branch = self.make_branch('source')
69 self.assertRaises(
70@@ -262,23 +243,6 @@
71 message='commit message')
72 self.assertEqual(submit_transport.base, submission.submit_location)
73
74- def test_find_submit_branch_from_pqm_branch(self):
75- # Test that submit_branch can be picked up from the obsolete
76- # pqm_branch config option.
77- source_branch = self.make_branch('source')
78- submit_transport = self.get_transport().clone('submit')
79- submit_transport.ensure_base()
80- source_branch.get_config().set_user_option(
81- 'pqm_branch', submit_transport.base)
82- # pqm_branch is used in preference to the submit_branch:
83- source_branch.set_submit_branch('bad-value')
84-
85- submission = pqm_submit.PQMSubmission(
86- source_branch=source_branch,
87- public_location='public-branch',
88- message='commit message')
89- self.assertEqual(submit_transport.base, submission.submit_location)
90-
91 def test_find_submit_branch_missing(self):
92 source_branch = self.make_branch('source')
93 self.assertRaises(

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: