Merge lp:~jelmer/launchpad/always-import-link into lp:launchpad

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merged at revision: 11394
Proposed branch: lp:~jelmer/launchpad/always-import-link
Merge into: lp:launchpad
Diff against target: 62 lines (+7/-7)
3 files modified
lib/lp/code/browser/branchlisting.py (+2/-3)
lib/lp/code/stories/branches/xx-product-branches.txt (+4/-3)
lib/lp/code/stories/codeimport/xx-create-codeimport.txt (+1/-1)
To merge this branch: bzr merge lp:~jelmer/launchpad/always-import-link
Reviewer Review Type Date Requested Status
Michael Nelson (community) ui Approve
Tim Penhey (community) Approve
Launchpad code reviewers code Pending
Review via email: mp+33070@code.launchpad.net

Commit message

Always present the link for importing a branch from a foreign VCS, rename the branch to "Import a branch".

Description of the change

This changes the main branch listing page for each project to always have a "Import a branch" link, independently of whether the project is hosting its development branch on Launchpad.

It also changes the title of the link to be "Import a branch" rather than "Import your project", per the discussion in bug 504868.

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote :

Reasonable for now, but I'd really like to change the register branch view to handle foreign mirrors too.

review: Approve
Revision history for this message
Michael Nelson (michael.nelson) wrote :

Not much UI to review here :) From the bug discussion, the rename sounds sensible.

review: Approve (ui)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/code/browser/branchlisting.py'
2--- lib/lp/code/browser/branchlisting.py 2010-07-30 06:08:54 +0000
3+++ lib/lp/code/browser/branchlisting.py 2010-08-18 23:40:43 +0000
4@@ -1091,9 +1091,8 @@
5 return Link('+branchvisibility', text, icon='edit', site='mainsite')
6
7 def code_import(self):
8- text = 'Import your project'
9- enabled = not self.context.official_codehosting
10- return Link('+new-import', text, icon='add', enabled=enabled)
11+ text = 'Import a branch'
12+ return Link('+new-import', text, icon='add')
13
14
15 class ProductBranchListingView(BranchListingView):
16
17=== modified file 'lib/lp/code/stories/branches/xx-product-branches.txt'
18--- lib/lp/code/stories/branches/xx-product-branches.txt 2010-08-13 16:08:22 +0000
19+++ lib/lp/code/stories/branches/xx-product-branches.txt 2010-08-18 23:40:43 +0000
20@@ -159,7 +159,7 @@
21 ================
22
23 There are two buttons that show on the right hand side of the screen
24-for project branch listings. 'Register a branch' and 'Import your project'.
25+for project branch listings. 'Register a branch' and 'Import a branch'.
26
27 >>> from zope.component import getUtility
28 >>> from lp.registry.interfaces.product import IProductSet
29@@ -175,10 +175,10 @@
30 >>> browser.open('http://code.launchpad.dev/firefox')
31 >>> print_links(browser)
32 Register a branch
33- Import your project
34+ Import a branch
35
36 If the product specifies that it officially uses Launchpad code, then
37-the 'Import your project' button is not shown.
38+the 'Import a branch' button is still shown.
39
40 >>> login('admin@canonical.com')
41 >>> product.development_focus.branch = old_branch
42@@ -186,6 +186,7 @@
43 >>> browser.open('http://code.launchpad.dev/firefox')
44 >>> print_links(browser)
45 Register a branch
46+ Import a branch
47
48
49 Nice wording of summary numbers
50
51=== modified file 'lib/lp/code/stories/codeimport/xx-create-codeimport.txt'
52--- lib/lp/code/stories/codeimport/xx-create-codeimport.txt 2010-04-28 02:49:58 +0000
53+++ lib/lp/code/stories/codeimport/xx-create-codeimport.txt 2010-08-18 23:40:43 +0000
54@@ -27,7 +27,7 @@
55 link on the main branch listing page for the product.
56
57 >>> browser.open('http://code.launchpad.dev/firefox')
58- >>> browser.getLink('Import your project').click()
59+ >>> browser.getLink('Import a branch').click()
60
61
62 Requesting a Subversion import