Merge lp:~blr/launchpad/golang-meta-import-fix into lp:launchpad

Proposed by Kit Randel
Status: Merged
Merged at revision: 17601
Proposed branch: lp:~blr/launchpad/golang-meta-import-fix
Merge into: lp:launchpad
Diff against target: 70 lines (+14/-10)
4 files modified
lib/lp/registry/browser/product.py (+7/-5)
lib/lp/registry/browser/productseries.py (+4/-2)
lib/lp/registry/browser/tests/test_product.py (+1/-1)
lib/lp/registry/browser/tests/test_productseries_views.py (+2/-2)
To merge this branch: bzr merge lp:~blr/launchpad/golang-meta-import-fix
Reviewer Review Type Date Requested Status
William Grant code Approve
Colin Watson (community) Approve
Review via email: mp+263625@code.launchpad.net

Commit message

Fix first part of golang import path for the bzr case, rendering root/product.name rather than root/branch.unique_name.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/browser/product.py'
2--- lib/lp/registry/browser/product.py 2015-07-02 07:18:35 +0000
3+++ lib/lp/registry/browser/product.py 2015-07-02 22:59:06 +0000
4@@ -1040,11 +1040,13 @@
5 return None
6 elif (self.context.vcs == VCSType.BZR and
7 self.context.development_focus.branch):
8- return ("{base_url}/{name} bzr "
9- "{browse_root}{name}").format(
10- base_url=config.vhost.mainsite.hostname,
11- name=self.context.development_focus.branch.unique_name,
12- browse_root=config.codehosting.supermirror_root)
13+ return (
14+ "{base_url}/{product} bzr "
15+ "{browse_root}{branch}").format(
16+ base_url=config.vhost.mainsite.hostname,
17+ product=self.context.name,
18+ branch=self.context.development_focus.branch.unique_name,
19+ browse_root=config.codehosting.supermirror_root)
20 else:
21 return None
22
23
24=== modified file 'lib/lp/registry/browser/productseries.py'
25--- lib/lp/registry/browser/productseries.py 2015-07-02 03:01:04 +0000
26+++ lib/lp/registry/browser/productseries.py 2015-07-02 22:59:06 +0000
27@@ -387,9 +387,11 @@
28 """
29 if (self.context.product.vcs == VCSType.BZR and
30 self.context.product.development_focus.branch):
31- return ("{base_url}/{name} bzr {root}{name}").format(
32+ return ("{base_url}/{product}/{series} bzr {root}{branch}").format(
33 base_url=config.vhost.mainsite.hostname,
34- name=self.context.branch.unique_name,
35+ product=self.context.product.name,
36+ series=self.context.name,
37+ branch=self.context.branch.unique_name,
38 root=config.codehosting.supermirror_root)
39 else:
40 return None
41
42=== modified file 'lib/lp/registry/browser/tests/test_product.py'
43--- lib/lp/registry/browser/tests/test_product.py 2015-07-02 07:18:35 +0000
44+++ lib/lp/registry/browser/tests/test_product.py 2015-07-02 22:59:06 +0000
45@@ -334,7 +334,7 @@
46 branch.product.vcs = VCSType.BZR
47
48 golang_import = (
49- "{base}/~zardoz/wapcaplet/a-branch bzr "
50+ "{base}/wapcaplet bzr "
51 "{root}~zardoz/wapcaplet/a-branch").format(
52 base=config.vhost.mainsite.hostname,
53 root=config.codehosting.supermirror_root
54
55=== modified file 'lib/lp/registry/browser/tests/test_productseries_views.py'
56--- lib/lp/registry/browser/tests/test_productseries_views.py 2015-07-02 03:20:37 +0000
57+++ lib/lp/registry/browser/tests/test_productseries_views.py 2015-07-02 22:59:06 +0000
58@@ -47,10 +47,10 @@
59 branch.product.vcs = VCSType.BZR
60
61 golang_import = (
62- "{base}/~zardoz/wapcaplet/a-branch bzr "
63+ "{base}/wapcaplet/trunk bzr "
64 "{root}~zardoz/wapcaplet/a-branch").format(
65 base=config.vhost.mainsite.hostname,
66- root=config.codehosting.supermirror_root
67+ root=config.codehosting.supermirror_root,
68 )
69 self.assertEqual(golang_import, view.golang_import_spec)
70 meta_tag = soupmatchers.Tag('go-import-meta', 'meta',