Merge lp:~maxb/bzr/2.4-launchpadlib-service-root-api-compat into lp:bzr

Proposed by Max Bowsher
Status: Merged
Approved by: Vincent Ladeuil
Approved revision: no longer in the source branch.
Merged at revision: 5642
Proposed branch: lp:~maxb/bzr/2.4-launchpadlib-service-root-api-compat
Merge into: lp:bzr
Diff against target: 216 lines (+85/-38)
4 files modified
bzrlib/plugins/launchpad/lp_api.py (+20/-14)
bzrlib/status.py (+8/-2)
bzrlib/tests/blackbox/test_status.py (+10/-1)
doc/en/release-notes/bzr-2.2.txt (+47/-21)
To merge this branch: bzr merge lp:~maxb/bzr/2.4-launchpadlib-service-root-api-compat
Reviewer Review Type Date Requested Status
Vincent Ladeuil Approve
Review via email: mp+48428@code.launchpad.net

Commit message

Merge 2.3 into trunk including fix for lp:707075.

To post a comment you must log in.
Revision history for this message
Vincent Ladeuil (vila) :
review: Approve
Revision history for this message
Vincent Ladeuil (vila) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/plugins/launchpad/lp_api.py'
2--- bzrlib/plugins/launchpad/lp_api.py 2011-01-28 11:53:25 +0000
3+++ bzrlib/plugins/launchpad/lp_api.py 2011-02-03 05:18:54 +0000
4@@ -47,17 +47,7 @@
5 STAGING_SERVICE_ROOT,
6 Launchpad,
7 )
8-try:
9- from launchpadlib import uris
10-except ImportError:
11- # Create a minimal object so the getattr() calls below fail gently and
12- # provide default values
13- uris = object()
14
15-LPNET_SERVICE_ROOT = getattr(uris, 'LPNET_SERVICE_ROOT',
16- 'https://api.launchpad.net/beta/')
17-QASTAGING_SERVICE_ROOT = getattr(uris, 'QASTAGING_SERVICE_ROOT',
18- 'https://api.qastaging.launchpad.net/')
19
20 # Declare the minimum version of launchpadlib that we need in order to work.
21 # 1.5.1 is the version of launchpadlib packaged in Ubuntu 9.10, the most
22@@ -84,11 +74,27 @@
23 installed_version, installed_version)
24
25
26+# The older versions of launchpadlib only provided service root constants for
27+# edge and staging, whilst newer versions drop edge. Therefore service root
28+# URIs for which we do not always have constants are derived from the staging
29+# one, which does always exist.
30+#
31+# It is necessary to derive, rather than use hardcoded URIs because
32+# launchpadlib <= 1.5.4 requires service root URIs that end in a path of
33+# /beta/, whilst launchpadlib >= 1.5.5 requires service root URIs with no path
34+# info.
35+#
36+# Once we have a hard dependency on launchpadlib >= 1.5.4 we can replace all of
37+# bzr's local knowledge of individual Launchpad instances with use of the
38+# launchpadlib.uris module.
39 LAUNCHPAD_API_URLS = {
40- 'production': LPNET_SERVICE_ROOT,
41- 'qastaging': QASTAGING_SERVICE_ROOT,
42+ 'production': STAGING_SERVICE_ROOT.replace('api.staging.launchpad.net',
43+ 'api.launchpad.net'),
44+ 'qastaging': STAGING_SERVICE_ROOT.replace('api.staging.launchpad.net',
45+ 'api.qastaging.launchpad.net'),
46 'staging': STAGING_SERVICE_ROOT,
47- 'dev': 'https://api.launchpad.dev/beta/',
48+ 'dev': STAGING_SERVICE_ROOT.replace('api.staging.launchpad.net',
49+ 'api.launchpad.dev'),
50 }
51
52
53@@ -199,7 +205,7 @@
54 if str(launchpad._root_uri) == STAGING_SERVICE_ROOT:
55 return url.replace('bazaar.launchpad.net',
56 'bazaar.staging.launchpad.net')
57- elif str(launchpad._root_uri) == QASTAGING_SERVICE_ROOT:
58+ elif str(launchpad._root_uri) == LAUNCHPAD_API_URLS['qastaging']:
59 return url.replace('bazaar.launchpad.net',
60 'bazaar.qastaging.launchpad.net')
61 return url
62
63=== modified file 'bzrlib/status.py'
64--- bzrlib/status.py 2010-10-18 21:34:05 +0000
65+++ bzrlib/status.py 2011-02-03 05:18:54 +0000
66@@ -450,8 +450,14 @@
67 manager = get_shelf_manager()
68 shelves = manager.active_shelves()
69 if shelves:
70- params.to_file.write('%d shelves exist. '
71- 'See "bzr shelve --list" for details.\n' % len(shelves))
72+ singular = '%d shelf exists. '
73+ plural = '%d shelves exist. '
74+ if len(shelves) == 1:
75+ fmt = singular
76+ else:
77+ fmt = plural
78+ params.to_file.write(fmt % len(shelves))
79+ params.to_file.write('See "bzr shelve --list" for details.\n')
80
81
82 hooks = StatusHooks()
83
84=== modified file 'bzrlib/tests/blackbox/test_status.py'
85--- bzrlib/tests/blackbox/test_status.py 2010-10-29 17:26:03 +0000
86+++ bzrlib/tests/blackbox/test_status.py 2011-02-03 05:18:54 +0000
87@@ -562,7 +562,16 @@
88 self.assertStatus([
89 'added:\n',
90 ' bye.c\n',
91- '1 shelves exist. See "bzr shelve --list" for details.\n',
92+ '1 shelf exists. See "bzr shelve --list" for details.\n',
93+ ],
94+ wt)
95+ self.run_bzr(['shelve', '--all', '-m', 'bar'])
96+ self.build_tree(['spam.c'])
97+ wt.add('spam.c')
98+ self.assertStatus([
99+ 'added:\n',
100+ ' spam.c\n',
101+ '2 shelves exist. See "bzr shelve --list" for details.\n',
102 ],
103 wt)
104
105
106=== modified file 'doc/en/release-notes/bzr-2.2.txt'
107--- doc/en/release-notes/bzr-2.2.txt 2010-12-24 17:47:53 +0000
108+++ doc/en/release-notes/bzr-2.2.txt 2011-02-03 05:18:54 +0000
109@@ -5,10 +5,49 @@
110 .. toctree::
111 :maxdepth: 1
112
113+bzr 2.2.4
114+#########
115+
116+:2.2.4: NOT RELEASED YET
117+
118+Compatibility Breaks
119+********************
120+
121+New Features
122+************
123+
124+Bug Fixes
125+*********
126+
127+* Fix communications with the Launchpad web service when using
128+ launchpadlib >= 1.5.5. This was a latent bug in bzr's communication
129+ with Launchpad's production instance, which only became a problem when
130+ the default instance was switched from edge to production in bzr 2.2.3.
131+ (Max Bowsher, #707075)
132+
133+Improvements
134+************
135+
136+Documentation
137+*************
138+
139+API Changes
140+***********
141+
142+Internals
143+*********
144+
145+Testing
146+*******
147+
148+
149 bzr 2.2.3
150 #########
151
152-:2.2.3: NOT RELEASED YET
153+:2.2.3: 2011-01-20
154+
155+This is a bugfix release. Upgrading is recommended for all users
156+on earlier 2.2 releases.
157
158 Compatibility Breaks
159 ********************
160@@ -19,19 +58,23 @@
161 been updated in this release to talk to the main (``launchpad.net``) servers,
162 rather than the ``edge`` ones. (Vincent Ladeuil, #583667)
163
164-New Features
165-************
166-
167 Bug Fixes
168 *********
169
170 * Avoid UnicodeDecodeError in ``bzr add`` with multiple files under a non-ascii
171 path on windows from symlink support addition. (Martin [gz], #686611)
172
173+* Correctly resolve content (and path) conflicts for files in subdirs.
174+ (Vincent Ladeuil, #660935)
175+
176 * Don't probe for a repository from within ``NotBranchError.__repr__``,
177 because this can cause knock-on errors at awkward times.
178 (Andrew Bennetts, #687653)
179
180+* Fix a crash during ``RepositoryPackCollection.pack`` caused by a
181+ concurrent repository pack operation. This was particularly affecting
182+ ``bzr-svn`` users. (Andrew Bennetts, #701940)
183+
184 * ``https`` access works again with recent versions of python2.7.
185 (Vincent Ladeuil, #693880)
186
187@@ -39,20 +82,6 @@
188 symlinks. Instead, it returns False, like other Trees and methods.
189 (Aaron Bentley, #681885)
190
191-Improvements
192-************
193-
194-Documentation
195-*************
196-
197-API Changes
198-***********
199-
200-Internals
201-*********
202-
203-Testing
204-*******
205
206 bzr 2.2.2
207 #########
208@@ -62,9 +91,6 @@
209 This is a bugfix release. None of these bugfixes are critical, but upgrading
210 is recommended for all users on earlier 2.2 releases.
211
212-New Features
213-************
214-
215 Bug Fixes
216 *********
217