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
=== modified file 'bzrlib/plugins/launchpad/lp_api.py'
--- bzrlib/plugins/launchpad/lp_api.py 2011-01-28 11:53:25 +0000
+++ bzrlib/plugins/launchpad/lp_api.py 2011-02-03 05:18:54 +0000
@@ -47,17 +47,7 @@
47 STAGING_SERVICE_ROOT,47 STAGING_SERVICE_ROOT,
48 Launchpad,48 Launchpad,
49 )49 )
50try:
51 from launchpadlib import uris
52except ImportError:
53 # Create a minimal object so the getattr() calls below fail gently and
54 # provide default values
55 uris = object()
5650
57LPNET_SERVICE_ROOT = getattr(uris, 'LPNET_SERVICE_ROOT',
58 'https://api.launchpad.net/beta/')
59QASTAGING_SERVICE_ROOT = getattr(uris, 'QASTAGING_SERVICE_ROOT',
60 'https://api.qastaging.launchpad.net/')
6151
62# Declare the minimum version of launchpadlib that we need in order to work.52# Declare the minimum version of launchpadlib that we need in order to work.
63# 1.5.1 is the version of launchpadlib packaged in Ubuntu 9.10, the most53# 1.5.1 is the version of launchpadlib packaged in Ubuntu 9.10, the most
@@ -84,11 +74,27 @@
84 installed_version, installed_version)74 installed_version, installed_version)
8575
8676
77# The older versions of launchpadlib only provided service root constants for
78# edge and staging, whilst newer versions drop edge. Therefore service root
79# URIs for which we do not always have constants are derived from the staging
80# one, which does always exist.
81#
82# It is necessary to derive, rather than use hardcoded URIs because
83# launchpadlib <= 1.5.4 requires service root URIs that end in a path of
84# /beta/, whilst launchpadlib >= 1.5.5 requires service root URIs with no path
85# info.
86#
87# Once we have a hard dependency on launchpadlib >= 1.5.4 we can replace all of
88# bzr's local knowledge of individual Launchpad instances with use of the
89# launchpadlib.uris module.
87LAUNCHPAD_API_URLS = {90LAUNCHPAD_API_URLS = {
88 'production': LPNET_SERVICE_ROOT,91 'production': STAGING_SERVICE_ROOT.replace('api.staging.launchpad.net',
89 'qastaging': QASTAGING_SERVICE_ROOT,92 'api.launchpad.net'),
93 'qastaging': STAGING_SERVICE_ROOT.replace('api.staging.launchpad.net',
94 'api.qastaging.launchpad.net'),
90 'staging': STAGING_SERVICE_ROOT,95 'staging': STAGING_SERVICE_ROOT,
91 'dev': 'https://api.launchpad.dev/beta/',96 'dev': STAGING_SERVICE_ROOT.replace('api.staging.launchpad.net',
97 'api.launchpad.dev'),
92 }98 }
9399
94100
@@ -199,7 +205,7 @@
199 if str(launchpad._root_uri) == STAGING_SERVICE_ROOT:205 if str(launchpad._root_uri) == STAGING_SERVICE_ROOT:
200 return url.replace('bazaar.launchpad.net',206 return url.replace('bazaar.launchpad.net',
201 'bazaar.staging.launchpad.net')207 'bazaar.staging.launchpad.net')
202 elif str(launchpad._root_uri) == QASTAGING_SERVICE_ROOT:208 elif str(launchpad._root_uri) == LAUNCHPAD_API_URLS['qastaging']:
203 return url.replace('bazaar.launchpad.net',209 return url.replace('bazaar.launchpad.net',
204 'bazaar.qastaging.launchpad.net')210 'bazaar.qastaging.launchpad.net')
205 return url211 return url
206212
=== modified file 'bzrlib/status.py'
--- bzrlib/status.py 2010-10-18 21:34:05 +0000
+++ bzrlib/status.py 2011-02-03 05:18:54 +0000
@@ -450,8 +450,14 @@
450 manager = get_shelf_manager()450 manager = get_shelf_manager()
451 shelves = manager.active_shelves()451 shelves = manager.active_shelves()
452 if shelves:452 if shelves:
453 params.to_file.write('%d shelves exist. '453 singular = '%d shelf exists. '
454 'See "bzr shelve --list" for details.\n' % len(shelves))454 plural = '%d shelves exist. '
455 if len(shelves) == 1:
456 fmt = singular
457 else:
458 fmt = plural
459 params.to_file.write(fmt % len(shelves))
460 params.to_file.write('See "bzr shelve --list" for details.\n')
455461
456462
457hooks = StatusHooks()463hooks = StatusHooks()
458464
=== modified file 'bzrlib/tests/blackbox/test_status.py'
--- bzrlib/tests/blackbox/test_status.py 2010-10-29 17:26:03 +0000
+++ bzrlib/tests/blackbox/test_status.py 2011-02-03 05:18:54 +0000
@@ -562,7 +562,16 @@
562 self.assertStatus([562 self.assertStatus([
563 'added:\n',563 'added:\n',
564 ' bye.c\n',564 ' bye.c\n',
565 '1 shelves exist. See "bzr shelve --list" for details.\n',565 '1 shelf exists. See "bzr shelve --list" for details.\n',
566 ],
567 wt)
568 self.run_bzr(['shelve', '--all', '-m', 'bar'])
569 self.build_tree(['spam.c'])
570 wt.add('spam.c')
571 self.assertStatus([
572 'added:\n',
573 ' spam.c\n',
574 '2 shelves exist. See "bzr shelve --list" for details.\n',
566 ],575 ],
567 wt)576 wt)
568577
569578
=== modified file 'doc/en/release-notes/bzr-2.2.txt'
--- doc/en/release-notes/bzr-2.2.txt 2010-12-24 17:47:53 +0000
+++ doc/en/release-notes/bzr-2.2.txt 2011-02-03 05:18:54 +0000
@@ -5,10 +5,49 @@
5.. toctree::5.. toctree::
6 :maxdepth: 16 :maxdepth: 1
77
8bzr 2.2.4
9#########
10
11:2.2.4: NOT RELEASED YET
12
13Compatibility Breaks
14********************
15
16New Features
17************
18
19Bug Fixes
20*********
21
22* Fix communications with the Launchpad web service when using
23 launchpadlib >= 1.5.5. This was a latent bug in bzr's communication
24 with Launchpad's production instance, which only became a problem when
25 the default instance was switched from edge to production in bzr 2.2.3.
26 (Max Bowsher, #707075)
27
28Improvements
29************
30
31Documentation
32*************
33
34API Changes
35***********
36
37Internals
38*********
39
40Testing
41*******
42
43
8bzr 2.2.344bzr 2.2.3
9#########45#########
1046
11:2.2.3: NOT RELEASED YET47:2.2.3: 2011-01-20
48
49This is a bugfix release. Upgrading is recommended for all users
50on earlier 2.2 releases.
1251
13Compatibility Breaks52Compatibility Breaks
14********************53********************
@@ -19,19 +58,23 @@
19 been updated in this release to talk to the main (``launchpad.net``) servers,58 been updated in this release to talk to the main (``launchpad.net``) servers,
20 rather than the ``edge`` ones. (Vincent Ladeuil, #583667)59 rather than the ``edge`` ones. (Vincent Ladeuil, #583667)
2160
22New Features
23************
24
25Bug Fixes61Bug Fixes
26*********62*********
2763
28* Avoid UnicodeDecodeError in ``bzr add`` with multiple files under a non-ascii64* Avoid UnicodeDecodeError in ``bzr add`` with multiple files under a non-ascii
29 path on windows from symlink support addition. (Martin [gz], #686611)65 path on windows from symlink support addition. (Martin [gz], #686611)
3066
67* Correctly resolve content (and path) conflicts for files in subdirs.
68 (Vincent Ladeuil, #660935)
69
31* Don't probe for a repository from within ``NotBranchError.__repr__``,70* Don't probe for a repository from within ``NotBranchError.__repr__``,
32 because this can cause knock-on errors at awkward times.71 because this can cause knock-on errors at awkward times.
33 (Andrew Bennetts, #687653)72 (Andrew Bennetts, #687653)
3473
74* Fix a crash during ``RepositoryPackCollection.pack`` caused by a
75 concurrent repository pack operation. This was particularly affecting
76 ``bzr-svn`` users. (Andrew Bennetts, #701940)
77
35* ``https`` access works again with recent versions of python2.7.78* ``https`` access works again with recent versions of python2.7.
36 (Vincent Ladeuil, #693880)79 (Vincent Ladeuil, #693880)
3780
@@ -39,20 +82,6 @@
39 symlinks. Instead, it returns False, like other Trees and methods.82 symlinks. Instead, it returns False, like other Trees and methods.
40 (Aaron Bentley, #681885)83 (Aaron Bentley, #681885)
4184
42Improvements
43************
44
45Documentation
46*************
47
48API Changes
49***********
50
51Internals
52*********
53
54Testing
55*******
5685
57bzr 2.2.286bzr 2.2.2
58#########87#########
@@ -62,9 +91,6 @@
62This is a bugfix release. None of these bugfixes are critical, but upgrading91This is a bugfix release. None of these bugfixes are critical, but upgrading
63is recommended for all users on earlier 2.2 releases.92is recommended for all users on earlier 2.2 releases.
6493
65New Features
66************
67
68Bug Fixes94Bug Fixes
69*********95*********
7096