launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #14086
[Merge] lp:~stevenk/launchpad/destroy-productseries-linkbranch into lp:launchpad
Steve Kowalik has proposed merging lp:~stevenk/launchpad/destroy-productseries-linkbranch into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~stevenk/launchpad/destroy-productseries-linkbranch/+merge/133410
Destroy ProductSeries:+linkbranch its friends and the horses they rode in on. ProductSeries:+setbranch is the new black.
I think I have eradicated all references to +linkbranch and made use of +setbranch in the tests.
--
https://code.launchpad.net/~stevenk/launchpad/destroy-productseries-linkbranch/+merge/133410
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/destroy-productseries-linkbranch into lp:launchpad.
=== modified file 'lib/lp/code/stories/branches/xx-product-branches.txt'
--- lib/lp/code/stories/branches/xx-product-branches.txt 2012-10-12 14:53:10 +0000
+++ lib/lp/code/stories/branches/xx-product-branches.txt 2012-11-08 05:52:19 +0000
@@ -116,11 +116,11 @@
If a branch is associated with more than one series, it is only shown
once, but both series are shown in the listing.
- >>> admin_browser.open('http://launchpad.dev/firefox/trunk/+linkbranch')
- >>> admin_browser.getControl('Branch').value = '~name12/firefox/main'
+ >>> admin_browser.open('http://launchpad.dev/firefox/trunk/+setbranch')
+ >>> admin_browser.getControl('Branch:').value = '~name12/firefox/main'
>>> admin_browser.getControl('Update').click()
- >>> admin_browser.open('http://launchpad.dev/firefox/1.0/+linkbranch')
- >>> admin_browser.getControl('Branch').value = '~name12/firefox/main'
+ >>> admin_browser.open('http://launchpad.dev/firefox/1.0/+setbranch')
+ >>> admin_browser.getControl('Branch:').value = '~name12/firefox/main'
>>> admin_browser.getControl('Update').click()
>>> browser.open('http://code.launchpad.dev/firefox')
@@ -133,8 +133,8 @@
Firstly lets associate release--0.9.1 with the 1.0 series.
- >>> admin_browser.open('http://launchpad.dev/firefox/1.0/+linkbranch')
- >>> admin_browser.getControl('Branch').value = (
+ >>> admin_browser.open('http://launchpad.dev/firefox/1.0/+setbranch')
+ >>> admin_browser.getControl('Branch:').value = (
... '~mark/firefox/release--0.9.1')
>>> admin_browser.getControl('Update').click()
=== modified file 'lib/lp/code/templates/branch-listing.pt'
--- lib/lp/code/templates/branch-listing.pt 2012-04-27 19:31:02 +0000
+++ lib/lp/code/templates/branch-listing.pt 2012-11-08 05:52:19 +0000
@@ -70,7 +70,7 @@
Only show the warning and link if the user can actually set the development focus
</tal:ignore>
<tr tal:condition="product/required:launchpad.Edit"
- tal:define="edit_link product/development_focus/fmt:url/+linkbranchtoseries">
+ tal:define="edit_link product/development_focus/fmt:url/+setbranch">
<td colspan="5" class="branch-no-dev-focus">A development focus branch hasn't
been specified, <a tal:attributes="href edit_link">set it now</a>.</td>
</tr>
=== modified file 'lib/lp/registry/browser/configure.zcml'
--- lib/lp/registry/browser/configure.zcml 2012-10-24 00:08:43 +0000
+++ lib/lp/registry/browser/configure.zcml 2012-11-08 05:52:19 +0000
@@ -1726,18 +1726,6 @@
template="../templates/milestone-add.pt"/>
<browser:page
for="lp.registry.interfaces.productseries.IProductSeries"
- name="+linkbranch"
- class="lp.registry.browser.productseries.ProductSeriesLinkBranchView"
- template="../templates/productseries-linkbranch.pt"
- permission="launchpad.Edit"/>
- <browser:page
- for="lp.registry.interfaces.productseries.IProductSeries"
- name="+linkbranchtoseries"
- class="lp.registry.browser.productseries.ProductSeriesLinkBranchFromCodeView"
- template="../templates/productseries-linkbranch.pt"
- permission="launchpad.Edit"/>
- <browser:page
- for="lp.registry.interfaces.productseries.IProductSeries"
name="+setbranch"
class="lp.registry.browser.productseries.ProductSeriesSetBranchView"
template="../templates/productseries-setbranch.pt"
=== modified file 'lib/lp/registry/browser/productseries.py'
--- lib/lp/registry/browser/productseries.py 2012-11-08 02:07:06 +0000
+++ lib/lp/registry/browser/productseries.py 2012-11-08 05:52:19 +0000
@@ -16,8 +16,6 @@
'ProductSeriesFileBugRedirect',
'ProductSeriesInvolvedMenu',
'ProductSeriesInvolvementView',
- 'ProductSeriesLinkBranchView',
- 'ProductSeriesLinkBranchFromCodeView',
'ProductSeriesNavigation',
'ProductSeriesOverviewMenu',
'ProductSeriesOverviewNavigationMenu',
@@ -273,7 +271,6 @@
'delete',
'driver',
'edit',
- 'link_branch',
'rdf',
'set_branch',
]
@@ -311,7 +308,9 @@
summary = 'Someone with permission to set goals this series'
return Link('+driver', text, summary, icon='edit')
- def _fetch_branch_link(self):
+ @enabled_with_permission('launchpad.Edit')
+ def set_branch(self):
+ """Return a link to set the bazaar branch for this series."""
if self.context.branch is None:
text = 'Link to branch'
icon = 'add'
@@ -320,20 +319,6 @@
text = "Change branch"
icon = 'edit'
summary = 'Change the branch for this series'
- return (text, icon, summary)
-
- @enabled_with_permission('launchpad.Edit')
- def link_branch(self):
- """Return a link to set the bazaar branch for this series."""
- text, icon, summary = self._fetch_branch_link()
- return Link('+linkbranch', text, summary, icon=icon)
-
- @enabled_with_permission('launchpad.Edit')
- def set_branch(self):
- """Return a link to set the bazaar branch for this series."""
- # Once +setbranch has been beta tested thoroughly, it should
- # replace the +linkbranch page.
- text, icon, summary = self._fetch_branch_link()
return Link('+setbranch', text, summary, icon=icon)
@enabled_with_permission('launchpad.AnyPerson')
@@ -1084,44 +1069,6 @@
return branch
-class ProductSeriesLinkBranchView(ReturnToReferrerMixin, ProductSeriesView,
- LaunchpadEditFormView):
- """View to set the bazaar branch for a product series."""
-
- schema = IProductSeries
- field_names = ['branch']
-
- @property
- def label(self):
- """The form label."""
- return 'Link an existing branch to %s %s series' % (
- self.context.product.displayname, self.context.name)
-
- page_title = label
-
- @action(_('Update'), name='update')
- def update_action(self, action, data):
- """Update the branch attribute."""
- if data['branch'] != self.context.branch:
- self.updateContextFromData(data)
- # Request an initial upload of translation files.
- getUtility(IRosettaUploadJobSource).create(
- self.context.branch, NULL_REVISION)
- else:
- self.updateContextFromData(data)
- self.request.response.addInfoNotification(
- 'Series code location updated.')
-
-
-class ProductSeriesLinkBranchFromCodeView(ProductSeriesLinkBranchView):
- """Set the branch link from the code overview page."""
-
- @property
- def next_url(self):
- """Take the user back to the code overview page."""
- return canonical_url(self.context.product, rootsite="code")
-
-
class ProductSeriesReviewView(LaunchpadEditFormView):
"""A view to review and change the series `IProduct` and name."""
schema = IProductSeries
=== modified file 'lib/lp/registry/browser/tests/productseries-views.txt'
--- lib/lp/registry/browser/tests/productseries-views.txt 2012-08-08 07:22:51 +0000
+++ lib/lp/registry/browser/tests/productseries-views.txt 2012-11-08 05:52:19 +0000
@@ -202,24 +202,6 @@
False
-Link branch
------------
-
-The +linkbranch view allows a user to associate a series with a branch. It
-provides a label and a page_title.
-
- >>> view = create_initialized_view(series, '+linkbranch')
- >>> print view.label
- Link an existing branch to App simple series
-
- >>> print view.page_title
- Link an existing branch to App simple series
-
-There is a cancel_url property too.
-
- >>> print view.cancel_url
- http://launchpad.dev/app/simple
-
Delete ProductSeries
--------------------
=== modified file 'lib/lp/registry/stories/product/xx-product-development-focus.txt'
--- lib/lp/registry/stories/product/xx-product-development-focus.txt 2012-09-18 19:41:02 +0000
+++ lib/lp/registry/stories/product/xx-product-development-focus.txt 2012-11-08 05:52:19 +0000
@@ -134,7 +134,7 @@
lp://dev/fooix (http://code.launchpad.dev/~eric/fooix/trunk)
Change branch
Change the branch for this series
- (http://launchpad.dev/fooix/trunk/+linkbranch)
+ (http://launchpad.dev/fooix/trunk/+setbranch)
Browse the code
(http://bazaar.launchpad.dev/~eric/fooix/trunk/files)
@@ -171,6 +171,6 @@
lp://dev/fooix (http://code.launchpad.dev/~eric/fooix/trunk)
Change branch
Change the branch for this series
- (http://launchpad.dev/fooix/trunk/+linkbranch)
+ (http://launchpad.dev/fooix/trunk/+setbranch)
Browse the code
(https://bazaar.launchpad.dev/~eric/fooix/trunk/files)
=== modified file 'lib/lp/registry/stories/productseries/xx-productseries-index.txt'
--- lib/lp/registry/stories/productseries/xx-productseries-index.txt 2012-03-07 00:58:37 +0000
+++ lib/lp/registry/stories/productseries/xx-productseries-index.txt 2012-11-08 05:52:19 +0000
@@ -106,7 +106,7 @@
bzr push lp:~name12/firefox/trunk ...
>>> driver_browser.getLink('link the branch to this series')
- <Link ... url='http://launchpad.dev/firefox/trunk/+linkbranch'>
+ <Link ... url='http://launchpad.dev/firefox/trunk/+setbranch'>
Distribution packaging is listed too. There is a link to the source package
in each Ubuntu series.
=== removed file 'lib/lp/registry/stories/productseries/xx-productseries-link-branch.txt'
--- lib/lp/registry/stories/productseries/xx-productseries-link-branch.txt 2012-09-06 09:25:47 +0000
+++ lib/lp/registry/stories/productseries/xx-productseries-link-branch.txt 1970-01-01 00:00:00 +0000
@@ -1,92 +0,0 @@
-Linking a product series to a branch
-====================================
-
-To make it a bit more obvious to the newer Launchpad user,
-there is an action item for product series to link to an existing
-bazaar branch.
-
- >>> sample_browser = setupBrowser(auth="Basic test@xxxxxxxxxxxxx:test")
- >>> sample_browser.open('http://launchpad.dev/firefox/trunk')
- >>> link = sample_browser.getLink('link the branch to this series')
- >>> link
- <Link ... url='http://launchpad.dev/firefox/trunk/+linkbranch'>
- >>> link.click()
-
-This page allows the user to import code from various source control systems
-
- >>> external_code = find_tag_by_id(sample_browser.contents, 'external-code')
- >>> print extract_text(external_code)
- If the code is in Git, CVS or Subversion you can
- request that the branch be imported to Bazaar.
-
-This link is only shown to those that have edit permissions on the
-product series.
-
- >>> browser.open('http://launchpad.dev/firefox/trunk')
- >>> browser.getLink('Link to branch')
- Traceback (most recent call last):
- ...
- LinkNotFoundError
-
-The only field shown is the branch field.
-
- # Add 15 revisions to the branch we're going to link; 10 old ones
- # and 5 within the last 30 days.
- >>> import datetime
- >>> import pytz
- >>> from zope.component import getUtility
- >>> from lp.code.interfaces.branch import IBranchSet
- >>> from lp.testing import time_counter
- >>> login('admin@xxxxxxxxxxxxx')
- >>> branch = getUtility(IBranchSet).getByUniqueName('~name12/firefox/main')
- >>> now = datetime.datetime.now(pytz.UTC)
- >>> day_delta = datetime.timedelta(days=1)
- >>> factory.makeRevisionsForBranch(
- ... branch, count=10, date_generator=time_counter(
- ... now - datetime.timedelta(days=50), day_delta))
- >>> factory.makeRevisionsForBranch(
- ... branch, count=5, date_generator=time_counter(
- ... now - datetime.timedelta(days=10), day_delta))
- >>> logout()
-
- >>> print sample_browser.title
- Link an existing branch to...
- >>> sample_browser.getControl('Branch').value = '~name12/firefox/main'
- >>> sample_browser.getControl('Update').click()
-
-Updating the branch takes Sample Person back to the product series page,
-where he can see the link to the branch and a link to see the content
-of the branch
-
- >>> print sample_browser.title
- Series trunk : Mozilla Firefox
- >>> branch = find_tag_by_id(sample_browser.contents, 'branch-details')
- >>> print extract_text(branch)
- lp://dev/~name12/firefox/main - Sample Person
- Change branch
-
- >>> print sample_browser.getLink('Browse the code').url
- http://bazaar.launchpad.dev/~name12/firefox/main/files
-
-The total and recent revision counts for the branch are displayed to
-give an idea of overall and recent activity on the project.
-
- >>> revisions = find_tag_by_id(sample_browser.contents, 'branch-revision-details')
- >>> print extract_text(revisions)
- 15 revisions.
-
-A helpful informational message is also shown to the user.
-
- >>> for message in get_feedback_messages(sample_browser.contents):
- ... print extract_text(message)
- Series code location updated.
-
-Once a branch is linked, the branch link becomes "Change branch".
-
- >>> sample_browser.getLink('Link to branch')
- Traceback (most recent call last):
- ...
- LinkNotFoundError
-
- >>> sample_browser.getLink('Change branch')
- <Link ... url='http://launchpad.dev/firefox/trunk/+linkbranch'>
=== modified file 'lib/lp/registry/templates/product-index.pt'
--- lib/lp/registry/templates/product-index.pt 2012-07-26 00:35:17 +0000
+++ lib/lp/registry/templates/product-index.pt 2012-11-08 05:52:19 +0000
@@ -108,7 +108,7 @@
<a tal:replace="structure overview_menu/edit/fmt:icon" /></p>
<p tal:condition="trunk_visible">
<a tal:replace="structure trunk/fmt:link" />
- <a tal:replace="structure dev_focus/menu:overview/link_branch/fmt:icon" />
+ <a tal:replace="structure dev_focus/menu:overview/set_branch/fmt:icon" />
<br/>
<a tal:replace="structure trunk/menu:context/source/fmt:link"/>
</p>
=== modified file 'lib/lp/registry/templates/productseries-codesummary.pt'
--- lib/lp/registry/templates/productseries-codesummary.pt 2012-09-06 09:25:47 +0000
+++ lib/lp/registry/templates/productseries-codesummary.pt 2012-11-08 05:52:19 +0000
@@ -22,7 +22,7 @@
<ul class="bulleted">
<li>
If the code is already in a Bazaar branch registered with Launchpad
- <a tal:attributes="href context/menu:overview/link_branch/fmt:url">link
+ <a tal:attributes="href context/menu:overview/set_branch/fmt:url">link
the branch to this series</a>.
</li>
@@ -48,7 +48,7 @@
<ul class="horizontal">
<li>
- <a tal:replace="structure context/menu:overview/link_branch/fmt:link" />
+ <a tal:replace="structure context/menu:overview/set_branch/fmt:link" />
</li>
</ul>
</tal:edit-link>
@@ -73,7 +73,7 @@
tal:content="view/long_bzr_identity">Mozilla Thunderbird 0.9.1</a>
- <a tal:replace="structure context/branch/owner/fmt:link:code/+ownedbranches" />
<a
- tal:replace="structure context/menu:overview/link_branch/fmt:icon" />
+ tal:replace="structure context/menu:overview/set_branch/fmt:icon" />
</div>
<div id="branch-revision-details" tal:condition="context/branch/revision_count">
<span tal:replace="context/branch/revision_count">35</span> revisions.
=== removed file 'lib/lp/registry/templates/productseries-linkbranch.pt'
--- lib/lp/registry/templates/productseries-linkbranch.pt 2012-06-15 10:43:40 +0000
+++ lib/lp/registry/templates/productseries-linkbranch.pt 1970-01-01 00:00:00 +0000
@@ -1,39 +0,0 @@
-<html
- xmlns="http://www.w3.org/1999/xhtml"
- xmlns:tal="http://xml.zope.org/namespaces/tal"
- xmlns:metal="http://xml.zope.org/namespaces/metal"
- xmlns:i18n="http://xml.zope.org/namespaces/i18n"
- metal:use-macro="view/macro:page/main_only"
- i18n:domain="launchpad">
- <body>
- <div metal:fill-slot="main">
- <ul>
- <li>If the code is already in a Bazaar branch registered with Launchpad,
- specify it here:
- <div metal:use-macro="context/@@launchpad_form/form" />
- </li>
-
- <li>
- <p id="ssh-key-directions">
- Otherwise, if the code is in a Bazaar branch not yet on Launchpad
- you can push the branch directly to Launchpad, e.g. with:<br />
- <tt class="command">
- bzr push lp:~<tal:user replace="view/user/name"/>/<tal:project replace="context/product/name"/>/<tal:series replace="context/name"/>
- </tt>
- <tal:no-keys condition="not:view/user/sshkeys">
- <br/>To authenticate with the Launchpad branch upload service,
- you need to
- <a tal:attributes="href string:${view/user/fmt:url}/+editsshkeys">
- register a SSH key</a>.
- </tal:no-keys>
- </p>
- </li>
-
- <li id="external-code">
- If the code is in Git, CVS or Subversion you can
- <a tal:attributes="href view/request_import_link">request that the branch be imported to Bazaar</a>.
- </li>
- </ul>
- </div>
- </body>
-</html>
=== modified file 'lib/lp/registry/templates/productseries-macros.pt'
--- lib/lp/registry/templates/productseries-macros.pt 2012-03-10 13:11:43 +0000
+++ lib/lp/registry/templates/productseries-macros.pt 2012-11-08 05:52:19 +0000
@@ -15,7 +15,7 @@
<table>
<tbody>
<tal:edit-link define="series_link series/fmt:url;
- edit_link string:${series_link}/+linkbranchtoseries">
+ edit_link string:${series_link}/+setbranch">
<tr>
<th>Series:</th>
<tal:comment condition="nothing">
=== modified file 'lib/lp/registry/tests/test_productseries.py'
--- lib/lp/registry/tests/test_productseries.py 2012-10-19 08:25:36 +0000
+++ lib/lp/registry/tests/test_productseries.py 2012-11-08 05:52:19 +0000
@@ -445,8 +445,7 @@
super(TestProductSeriesSet, self).setUp()
self.ps_set = getUtility(IProductSeriesSet)
- def _makeSeriesAndBranch(
- self, import_mode, branch=None, link_branch=True):
+ def _makeSeriesAndBranch(self, import_mode, branch=None, link_branch=True):
productseries = self.factory.makeProductSeries()
productseries.translations_autoimport_mode = import_mode
if branch is None:
@@ -484,24 +483,22 @@
TranslationsBranchImportMode.IMPORT_TEMPLATES, link_branch=False)
self.assertContentEqual(
- [],
- self.ps_set.findByTranslationsImportBranch(branch))
+ [], self.ps_set.findByTranslationsImportBranch(branch))
def test_findByTranslationsImportBranch_force_import(self):
productseries, branch = self._makeSeriesAndBranch(
TranslationsBranchImportMode.NO_IMPORT)
self.assertContentEqual(
- [productseries],
- self.ps_set.findByTranslationsImportBranch(branch, True))
+ [productseries],
+ self.ps_set.findByTranslationsImportBranch(branch, True))
def test_findByTranslationsImportBranch_no_branch_force_import(self):
productseries, branch = self._makeSeriesAndBranch(
TranslationsBranchImportMode.NO_IMPORT, link_branch=False)
self.assertContentEqual(
- [],
- self.ps_set.findByTranslationsImportBranch(branch, True))
+ [], self.ps_set.findByTranslationsImportBranch(branch, True))
def test_findByTranslationsImportBranch_multiple_series(self):
productseries, branch = self._makeSeriesAndBranch(
@@ -510,8 +507,8 @@
TranslationsBranchImportMode.IMPORT_TEMPLATES, branch=branch)
self.assertContentEqual(
- [productseries, second_series],
- self.ps_set.findByTranslationsImportBranch(branch))
+ [productseries, second_series],
+ self.ps_set.findByTranslationsImportBranch(branch))
def test_findByTranslationsImportBranch_multiple_series_force(self):
# XXX henninge 2010-03-18 bug=521095: This will fail when the bug
@@ -522,8 +519,8 @@
TranslationsBranchImportMode.IMPORT_TEMPLATES, branch=branch)
self.assertContentEqual(
- [productseries, second_series],
- self.ps_set.findByTranslationsImportBranch(branch, True))
+ [productseries, second_series],
+ self.ps_set.findByTranslationsImportBranch(branch, True))
class TestProductSeriesReleases(TestCaseWithFactory):
@@ -535,23 +532,20 @@
super(TestProductSeriesReleases, self).setUp()
self.product = self.factory.makeProduct()
self.productseries = self.factory.makeProductSeries(
- product=self.product)
+ product=self.product)
def test_getLatestRelease(self):
# getLatestRelease returns the most recent release.
self.assertIs(None, self.productseries.getLatestRelease())
release = self.factory.makeProductRelease(
- product=self.product,
- productseries=self.productseries)
+ product=self.product, productseries=self.productseries)
self.assertEqual(release, self.productseries.getLatestRelease())
second_release = self.factory.makeProductRelease(
- product=self.product,
- productseries=self.productseries)
+ product=self.product, productseries=self.productseries)
self.assertEqual(
- second_release,
- self.productseries.getLatestRelease())
+ second_release, self.productseries.getLatestRelease())
class ProductSeriesSnapshotTestCase(TestCaseWithFactory):
@@ -567,8 +561,7 @@
'all_milestones',
]
self.assertThat(
- productseries,
- DoesNotSnapshot(skipped, IProductSeries))
+ productseries, DoesNotSnapshot(skipped, IProductSeries))
class TestWebService(WebServiceTestCase):
=== modified file 'lib/lp/translations/browser/productseries.py'
--- lib/lp/translations/browser/productseries.py 2012-01-01 02:58:52 +0000
+++ lib/lp/translations/browser/productseries.py 2012-11-08 05:52:19 +0000
@@ -1,6 +1,5 @@
# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
-# pylint: disable-msg=E1002
"""View classes for `IProductSeries`."""
@@ -160,21 +159,22 @@
@property
def request_bzr_import_url(self):
"""URL to request a bazaar import."""
- return canonical_url(self.context,
- view_name="+request-bzr-import",
- rootsite="translations")
+ return canonical_url(
+ self.context, view_name="+request-bzr-import",
+ rootsite="translations")
@property
- def link_branch_url(self):
+ def set_branch_url(self):
"""URL to link the series to a branch."""
- return canonical_url(self.context, rootsite="mainsite",
- view_name="+linkbranch")
+ return canonical_url(
+ self.context, rootsite="mainsite", view_name="+setbranch")
@property
def translations_settings_url(self):
"""URL to change the translations for the series."""
- return canonical_url(self.context, rootsite="translations",
- view_name="+translations-settings")
+ return canonical_url(
+ self.context, rootsite="translations",
+ view_name="+translations-settings")
class ProductSeriesUploadView(LaunchpadView, TranslationsMixin):
=== modified file 'lib/lp/translations/browser/sourcepackage.py'
--- lib/lp/translations/browser/sourcepackage.py 2012-08-06 06:09:19 +0000
+++ lib/lp/translations/browser/sourcepackage.py 2012-11-08 05:52:19 +0000
@@ -380,7 +380,7 @@
if packaging is not None:
productseries = self.context.direct_packaging.productseries
productseries_menu = ProductSeriesOverviewMenu(productseries)
- branch_link = productseries_menu.link_branch()
+ branch_link = productseries_menu.set_branch()
url = '%s/%s' % (canonical_url(productseries), branch_link.target)
if branch_link.enabled:
return self.icon_link(id, icon, url, text, hidden=False)
=== modified file 'lib/lp/translations/browser/tests/productseries-views.txt'
--- lib/lp/translations/browser/tests/productseries-views.txt 2012-11-08 02:07:06 +0000
+++ lib/lp/translations/browser/tests/productseries-views.txt 2012-11-08 05:52:19 +0000
@@ -34,48 +34,6 @@
>>> login('foo.bar@xxxxxxxxxxxxx')
-= ProductSeriesLinkBranchView =
-
-The ProductSeries is setup to sync translations from a branch but no branch
-has been linked to the ProductSeries yet.
-
- >>> from lp.translations.interfaces.translations import (
- ... TranslationsBranchImportMode)
- >>> productseries = factory.makeProductSeries()
- >>> productseries.translations_autoimport_mode = (
- ... TranslationsBranchImportMode.IMPORT_TEMPLATES)
-
-When a branch is linked to the ProductSeries using this view, a new
-BranchJob to upload translation files to rosetta is created.
-
- >>> from lp.services.webapp.servers import LaunchpadTestRequest
- >>> from lp.registry.browser.productseries import (
- ... ProductSeriesLinkBranchView)
- >>> branch = makeScannedProductBranch(productseries)
- >>> request = LaunchpadTestRequest(
- ... method='POST',
- ... form={'field.branch': branch.unique_name,
- ... 'field.actions.update': 'Update'})
- >>> view = ProductSeriesLinkBranchView(productseries, request)
- >>> view.initialize()
- >>> print isUploadJobCreatedForBranch(productseries)
- True
-
-When a branch is removed from the ProductSeries using this view, no new
-BranchJob is created.
-
- >>> branch = makeScannedProductBranch(productseries)
- >>> request = LaunchpadTestRequest(
- ... method='POST',
- ... form={'field.branch': '',
- ... 'field.actions.update': 'Update'})
- >>> view = ProductSeriesLinkBranchView(
- ... productseries, request)
- >>> view.initialize()
- >>> print isUploadJobCreatedForBranch(productseries)
- False
-
-
= ProductSeriesTranslationsSettingsView =
Special settings for translations of a ProductSeries are set through
@@ -93,6 +51,7 @@
The only setting currently available is for the import of translation
templates from bazaar branches hosted on Launchpad.
+ >>> from lp.services.webapp.servers import LaunchpadTestRequest
>>> request = LaunchpadTestRequest()
>>> view = ProductSeriesTranslationsSettingsView(
... productseries, request)
=== modified file 'lib/lp/translations/browser/tests/test_sharing_details.py'
--- lib/lp/translations/browser/tests/test_sharing_details.py 2012-09-28 06:15:58 +0000
+++ lib/lp/translations/browser/tests/test_sharing_details.py 2012-11-08 05:52:19 +0000
@@ -996,7 +996,7 @@
def assertBranchLinks(self, contents, real_links, enabled):
if real_links:
match = (
- r'^http://translations.launchpad.dev/.*/trunk/\+linkbranch$')
+ r'^http://translations.launchpad.dev/.*/trunk/\+setbranch$')
def link_matcher(url):
if url is None:
=== modified file 'lib/lp/translations/stories/productseries/xx-productseries-translations-bzr-request.txt'
--- lib/lp/translations/stories/productseries/xx-productseries-translations-bzr-request.txt 2009-09-14 19:00:45 +0000
+++ lib/lp/translations/stories/productseries/xx-productseries-translations-bzr-request.txt 2012-11-08 05:52:19 +0000
@@ -64,7 +64,7 @@
== The request page without a branch ==
The official Bazaar branch gets removed from the product series.
- >>> browser.open('http://launchpad.dev/evolution/trunk/+linkbranch')
+ >>> browser.open('http://launchpad.dev/evolution/trunk/+setbranch')
>>> browser.getControl(name='field.branch').value = ''
>>> browser.getControl('Update').click()
@@ -81,7 +81,7 @@
Please set it first.
>>> browser.getLink('Please set it first.').click()
>>> print browser.url
- http://launchpad.dev/evolution/trunk/+linkbranch
+ http://launchpad.dev/evolution/trunk/+setbranch
The request button is missing completely from the page.
=== modified file 'lib/lp/translations/stories/productseries/xx-productseries-translations-settings.txt'
--- lib/lp/translations/stories/productseries/xx-productseries-translations-settings.txt 2012-06-03 13:20:54 +0000
+++ lib/lp/translations/stories/productseries/xx-productseries-translations-settings.txt 2012-11-08 05:52:19 +0000
@@ -35,7 +35,7 @@
a message indicating so is displayed instead of the branch. The
message also directs to the page where the branch can be set.
- >>> browser.open('http://launchpad.dev/evolution/trunk/+linkbranch')
+ >>> browser.open('http://launchpad.dev/evolution/trunk/+setbranch')
>>> browser.getControl(name='field.branch').value = ''
>>> browser.getControl('Update').click()
@@ -48,7 +48,7 @@
Set it now!
>>> browser.getLink('Set it now!').click()
>>> print browser.url
- http://launchpad.dev/evolution/trunk/+linkbranch
+ http://launchpad.dev/evolution/trunk/+setbranch
Pointer to one-time import
--------------------------
=== modified file 'lib/lp/translations/templates/productseries-translations-bzr-import.pt'
--- lib/lp/translations/templates/productseries-translations-bzr-import.pt 2009-10-31 12:03:43 +0000
+++ lib/lp/translations/templates/productseries-translations-bzr-import.pt 2012-11-08 05:52:19 +0000
@@ -47,7 +47,7 @@
<a tal:replace="structure branch/fmt:link">
branchname
</a>
- <a tal:attributes="href view/link_branch_url"
+ <a tal:attributes="href view/set_branch_url"
title="Change official branch"
class="edit sprite"></a>
</p>
@@ -59,7 +59,7 @@
<p tal:condition="not:view/context/branch"
id="no-branch-display">
This series does not have an official Bazaar branch.
- <a tal:attributes="href view/link_branch_url">
+ <a tal:attributes="href view/set_branch_url">
Please set it first.</a>
</p>
</div>
=== modified file 'lib/lp/translations/templates/productseries-translations-settings.pt'
--- lib/lp/translations/templates/productseries-translations-settings.pt 2012-06-02 12:25:39 +0000
+++ lib/lp/translations/templates/productseries-translations-settings.pt 2012-11-08 05:52:19 +0000
@@ -75,14 +75,14 @@
id="branch-display">
The official Bazaar branch is:
<a tal:replace="structure branch/fmt:link">branch</a>
- <a tal:attributes="href view/link_branch_url;
+ <a tal:attributes="href view/set_branch_url;
title string:Change official branch"
><span class="edit sprite" /></a>
</p>
<p tal:condition="not:view/context/branch"
id="no-branch-display">
This series does not have an official Bazaar branch.
- <a tal:attributes="href view/link_branch_url">Set it now!</a>
+ <a tal:attributes="href view/set_branch_url">Set it now!</a>
</p>
</tal:rosetta>
</div>
Follow ups