Merge ~pelpsi/launchpad:merge-proposal-url-fix into launchpad:master

Proposed by Simone Pelosi
Status: Merged
Approved by: Simone Pelosi
Approved revision: b3d46bbe5f38586287697d24ab5f010374ebc4a4
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~pelpsi/launchpad:merge-proposal-url-fix
Merge into: launchpad:master
Diff against target: 46 lines (+9/-5)
2 files modified
lib/lp/code/xmlrpc/git.py (+5/-2)
lib/lp/code/xmlrpc/tests/test_git.py (+4/-3)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+448614@code.launchpad.net

Commit message

mp.address replaced with canonical_url(mp, rootsite="code")

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/code/xmlrpc/git.py b/lib/lp/code/xmlrpc/git.py
2index 6e39e8c..3452fcd 100644
3--- a/lib/lp/code/xmlrpc/git.py
4+++ b/lib/lp/code/xmlrpc/git.py
5@@ -730,8 +730,11 @@ class GitAPI(LaunchpadXMLRPCView):
6 if merge_proposal:
7 return (
8 "Updated existing merge proposal "
9- "for %s on Launchpad:\n %s"
10- % (quote(branch), merge_proposal.address)
11+ "for '%s' on Launchpad:\n %s"
12+ % (
13+ quote(branch),
14+ canonical_url(merge_proposal, rootsite="code"),
15+ )
16 )
17 else:
18 base_url = canonical_url(repository, rootsite="code")
19diff --git a/lib/lp/code/xmlrpc/tests/test_git.py b/lib/lp/code/xmlrpc/tests/test_git.py
20index 4764319..e031f3f 100644
21--- a/lib/lp/code/xmlrpc/tests/test_git.py
22+++ b/lib/lp/code/xmlrpc/tests/test_git.py
23@@ -665,10 +665,11 @@ class TestGitAPIMixin:
24 ):
25 base_url = canonical_url(repository, rootsite="code")
26 expected_mp_url = (
27- "Create a merge proposal for 'branch1' on "
28+ "Create a merge proposal for '%s' on "
29 "Launchpad by visiting:\n "
30 "%s/+ref/%s/+register-merge"
31 % (
32+ quote(pushed_branch),
33 base_url,
34 quote(pushed_branch),
35 )
36@@ -677,8 +678,8 @@ class TestGitAPIMixin:
37 if mp:
38 expected_mp_url = (
39 "Updated existing merge proposal "
40- "for %s on Launchpad:\n %s"
41- % (quote(pushed_branch), mp.address)
42+ "for '%s' on Launchpad:\n %s"
43+ % (quote(pushed_branch), canonical_url(mp, rootsite="code"))
44 )
45
46 result = self.git_api.getMergeProposalInfo(

Subscribers

People subscribed via source and target branches

to status/vote changes: