Merge lp:~james-w/launchpad/remove-code-import-list into lp:launchpad

Proposed by James Westby on 2010-03-18
Status: Merged
Approved by: Aaron Bentley on 2010-03-22
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~james-w/launchpad/remove-code-import-list
Merge into: lp:launchpad
Prerequisite: lp:~james-w/launchpad/code-imports-use-ibranchtarget
Diff against target: 526 lines (+9/-359)
10 files modified
lib/lp/code/browser/bazaar.py (+3/-1)
lib/lp/code/browser/configure.zcml (+0/-7)
lib/lp/code/interfaces/codeimport.py (+0/-10)
lib/lp/code/model/codeimport.py (+1/-49)
lib/lp/code/model/tests/test_codeimport.py (+0/-194)
lib/lp/code/stories/branches/xx-bazaar-home.txt (+1/-1)
lib/lp/code/stories/codeimport/xx-codeimport-list.txt (+0/-72)
lib/lp/code/stories/codeimport/xx-codeimport-view.txt (+3/-3)
lib/lp/code/templates/bazaar-index.pt (+1/-1)
lib/lp/registry/browser/productseries.py (+0/-21)
To merge this branch: bzr merge lp:~james-w/launchpad/remove-code-import-list
Reviewer Review Type Date Requested Status
Aaron Bentley (community) 2010-03-18 Approve on 2010-03-22
Review via email: mp+21690@code.launchpad.net

Commit Message

+code-import-list has been removed in favour of +code-imports

Description of the Change

This removes +code-import-list which is obsoleted by
+code-imports.

Thanks,

James

To post a comment you must log in.
Aaron Bentley (abentley) wrote :

Was there a preimplementation call? Is there an associated bug? Is there any lint?

This seems to change the way import_count is calculated. Why is that?

James Westby (james-w) wrote :

Here's the reason why I made this change:

[20:52] <james_w> thumper: could you perhaps provide a little SQL help?
[20:53] <thumper> sure
[20:54] <james_w> CodeImportSet.composeQueryString() assumes a Product, but that will no longer always be true in my branch
[20:54] <james_w> I need to rewrite the query to allow for using SourcePackage as well
[20:55] <thumper> ok
=== salgado-brb is now known as salgado
[20:55] <thumper> james_w: I'm just looking at your code import target branch
[20:55] <thumper> hmm.. seems to have gone
[20:55] <james_w> great
[20:56] <james_w> I keep screwing up the initial settings and forgetting things like prerequisite branches
[20:56] <thumper> :)
[20:56] <thumper> james_w: can you paste me a link?
[20:56] <james_w> https://code.edge.launchpad.net/~james-w/launchpad/code-imports-use-ibranchtarget
[20:56] <james_w> https://code.edge.launchpad.net/~james-w/launchpad/code-imports-use-ibranchtarget/+merge/21651
[20:57] <james_w> the intention of that one is just to refactor, not allow any new behaviour
[20:58] <james_w> and to make the tests more explicit about if they require the code import to be against a product
[21:06] <thumper> james_w: reviewed
[21:06] <james_w> thanks
[21:06] <mwhudson> flacoste: so buildbot farted again
[21:06] <mwhudson> flacoste: did you read my mail yet? (i only sent it a minute or so ago)
[21:07] <thumper> james_w: composeQueryString needs to die
[21:07] <james_w> even better
[21:07] <flacoste> mwhudson: switching to email...
[21:08] <mwhudson> thumper, james_w: it's used for the search box on https://code.edge.launchpad.net/+code-import-list
[21:08] <mwhudson> but maybe that page needs to die now
[21:08] <mwhudson> (now that (a) we disable failing imports (b) +code-imports is more useful)
[21:08] * thumper looks at the page
[21:09] <thumper> my vote is kill the page
[21:10] <thumper> +code-imports is where we should add stuff now
[21:10] <james_w> right, a search box isn't too useful as you could go from search->project->branch->info
[21:10] * james_w starts a new branch
...
[21:40] <james_w> thumper: what count should be on https://code.edge.launchpad.net/ for imported branches?
[21:40] <james_w> (see the bottom if you have forgotten it was there :-)
[21:48] <thumper> james_w: my suggestion would be working code imports
[21:49] <james_w> thumper: just a count of all imports in the REVIEWED state?
[21:49] <thumper> james_w: yeah
[21:49] <thumper> what is it now?
[21:49] <james_w> all "active"
[21:50] <james_w> so REVIEWED and not for deactivated products/projects
[21:50] <james_w> and tried at least once
[21:50] <james_w> so REVIEWED is a fine approximation in my opinion
[21:51] <mwhudson> REVIEWED is a decent approximation now we mark imports failing automatically

There was no call, as this discussion seemed sufficient.

There isn't an associated bug.

I don't know about lint.

> This seems to change the way import_count is calculated. Why is that?

It makes the change as that is basically the point of the branch.

Thanks,

James

James Westby (james-w) wrote :

New revision pushed with problems from lint fixed.

Thanks,

James

Aaron Bentley (abentley) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

James Westby wrote:
> Here's the reason why I made this change:

Great. Unless I'm a domain expert, I need to know that any change has
been sanity-checked by a domain expert, so please note things like this
when requesting reviews in the future.

> I don't know about lint.

There is quite a lot of it. You can see it by running "make lint", and
you should do that before submitting a branch for review. In general,
you should fix any lint that you encounter.

I recommend installing the lp:lpreview-body plugin, and then either
using "bzr lp-propose" or "bzr send" to create your merge proposals, as
this will automatically run lint on the relevant files and provide a
template for your review request.

>> This seems to change the way import_count is calculated. Why is that?
>
> It makes the change as that is basically the point of the branch.

The described point of the branch was "This removes +code-import-list
which is obsoleted by +code-imports," which had no obvious connection.
Now that I see the IRC log, it's much clearer.

Please fix the lint, but otherwise this is

 merge approved

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkun0WgACgkQ0F+nu1YWqI33tQCcDVKcXTybC/viU3Ss9yYEk9FC
ZlAAn3rcUyW6QssMIuERgcL8RNQxhYXZ
=nuwN
-----END PGP SIGNATURE-----

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/code/browser/bazaar.py'
2--- lib/lp/code/browser/bazaar.py 2009-08-28 01:31:51 +0000
3+++ lib/lp/code/browser/bazaar.py 2010-04-02 02:45:43 +0000
4@@ -21,6 +21,7 @@
5 from canonical.launchpad.webapp.authorization import (
6 precache_permission_for_objects)
7
8+from lp.code.enums import CodeImportReviewStatus
9 from lp.code.interfaces.branch import IBranchCloud, IBranchSet
10 from lp.code.interfaces.branchcollection import IAllBranches
11 from lp.code.interfaces.codeimport import ICodeImportSet
12@@ -61,7 +62,8 @@
13
14 @property
15 def import_count(self):
16- return getUtility(ICodeImportSet).getActiveImports().count()
17+ return getUtility(ICodeImportSet).search(
18+ review_status=CodeImportReviewStatus.REVIEWED).count()
19
20 @property
21 def bzr_version(self):
22
23=== modified file 'lib/lp/code/browser/configure.zcml'
24--- lib/lp/code/browser/configure.zcml 2010-03-18 17:30:14 +0000
25+++ lib/lp/code/browser/configure.zcml 2010-04-02 02:45:43 +0000
26@@ -57,13 +57,6 @@
27 permission="zope.Public"
28 />
29 <browser:page
30- for="canonical.launchpad.webapp.interfaces.ILaunchpadApplication"
31- name="+code-import-list"
32- class="lp.registry.browser.productseries.ProductSeriesSourceListView"
33- template="../templates/sources-list.pt"
34- permission="zope.Public"
35- />
36- <browser:page
37 for="zope.interface.Interface"
38 name="+test-webservice-js"
39 template="../../../canonical/launchpad/templates/test-webservice-js.pt"
40
41=== modified file 'lib/lp/code/interfaces/codeimport.py'
42--- lib/lp/code/interfaces/codeimport.py 2010-03-26 01:05:26 +0000
43+++ lib/lp/code/interfaces/codeimport.py 2010-04-02 02:45:43 +0000
44@@ -188,16 +188,6 @@
45 :param target: An `IBranchTarget` that the code is associated with.
46 """
47
48- def getActiveImports(text=None):
49- """Return an iterable of all 'active' CodeImport objects.
50-
51- Active is defined, somewhat arbitrarily, as having
52- review_status==REVIEWED and having completed at least once.
53-
54- :param text: If specifed, limit to the results to those that contain
55- ``text`` in the product or project titles and descriptions.
56- """
57-
58 def get(id):
59 """Get a CodeImport by its id.
60
61
62=== modified file 'lib/lp/code/model/codeimport.py'
63--- lib/lp/code/model/codeimport.py 2010-03-18 15:39:58 +0000
64+++ lib/lp/code/model/codeimport.py 2010-04-02 02:45:43 +0000
65@@ -30,10 +30,9 @@
66 from canonical.database.constants import DEFAULT
67 from canonical.database.datetimecol import UtcDateTimeCol
68 from canonical.database.enumcol import EnumCol
69-from canonical.database.sqlbase import SQLBase, quote, sqlvalues
70+from canonical.database.sqlbase import SQLBase
71 from canonical.launchpad.interfaces import IStore
72 from lp.code.model.codeimportjob import CodeImportJobWorkflow
73-from lp.registry.model.productseries import ProductSeries
74 from canonical.launchpad.webapp.interfaces import NotFoundError
75 from lp.code.enums import (
76 BranchType, CodeImportJobState, CodeImportResultStatus,
77@@ -41,8 +40,6 @@
78 from lp.code.interfaces.codeimport import ICodeImport, ICodeImportSet
79 from lp.code.interfaces.codeimportevent import ICodeImportEventSet
80 from lp.code.interfaces.codeimportjob import ICodeImportJobWorkflow
81-from lp.code.interfaces.branchnamespace import (
82- get_branch_namespace)
83 from lp.code.model.codeimportresult import CodeImportResult
84 from lp.code.mail.codeimport import code_import_updated
85 from lp.registry.interfaces.person import validate_public_person
86@@ -256,51 +253,6 @@
87 CodeImportJob.delete(code_import.import_job.id)
88 CodeImport.delete(code_import.id)
89
90- def getActiveImports(self, text=None):
91- """See `ICodeImportSet`."""
92- query = self.composeQueryString(text)
93- return CodeImport.select(
94- query, orderBy=['product.name', 'branch.name'],
95- clauseTables=['Product', 'Branch'])
96-
97- def composeQueryString(self, text=None):
98- """Build SQL "where" clause for `CodeImport` search.
99-
100- :param text: Text to search for in the product and project titles and
101- descriptions.
102- """
103- conditions = [
104- "date_last_successful IS NOT NULL",
105- "review_status=%s" % sqlvalues(CodeImportReviewStatus.REVIEWED),
106- "CodeImport.branch = Branch.id",
107- "Branch.product = Product.id",
108- ]
109- if text == u'':
110- text = None
111-
112- # First filter on text, if supplied.
113- if text is not None:
114- conditions.append("""
115- ((Project.fti @@ ftq(%s) AND Product.project IS NOT NULL) OR
116- Product.fti @@ ftq(%s))""" % (quote(text), quote(text)))
117-
118- # Exclude deactivated products.
119- conditions.append('Product.active IS TRUE')
120-
121- # Exclude deactivated projects, too.
122- conditions.append(
123- "((Product.project = Project.id AND Project.active) OR"
124- " Product.project IS NULL)")
125-
126- # And build the query.
127- query = " AND ".join(conditions)
128- return """
129- codeimport.id IN
130- (SELECT codeimport.id FROM codeimport, branch, product, project
131- WHERE %s)
132- AND codeimport.branch = branch.id
133- AND branch.product = product.id""" % query
134-
135 def get(self, id):
136 """See `ICodeImportSet`."""
137 try:
138
139=== modified file 'lib/lp/code/model/tests/test_codeimport.py'
140--- lib/lp/code/model/tests/test_codeimport.py 2010-03-18 17:49:21 +0000
141+++ lib/lp/code/model/tests/test_codeimport.py 2010-04-02 02:45:43 +0000
142@@ -11,14 +11,11 @@
143 from storm.store import Store
144 from zope.component import getUtility
145
146-from lp.codehosting.codeimport.tests.test_workermonitor import (
147- nuke_codeimport_sample_data)
148 from lp.code.model.codeimport import CodeImportSet
149 from lp.code.model.codeimportevent import CodeImportEvent
150 from lp.code.model.codeimportjob import CodeImportJob, CodeImportJobSet
151 from lp.code.model.codeimportresult import CodeImportResult
152 from lp.code.interfaces.branchtarget import IBranchTarget
153-from lp.code.interfaces.codeimport import ICodeImportSet
154 from lp.registry.interfaces.person import IPersonSet
155 from lp.code.enums import (
156 CodeImportResultStatus, CodeImportReviewStatus, RevisionControlSystems)
157@@ -551,196 +548,5 @@
158 requester, code_import.import_job.requesting_user)
159
160
161-def make_active_import(factory, project_name=None, product_name=None,
162- branch_name=None, svn_branch_url=None,
163- cvs_root=None, cvs_module=None, git_repo_url=None,
164- hg_repo_url=None, last_update=None, rcs_type=None):
165- """Make a new CodeImport for a new Product, maybe in a new Project.
166-
167- The import will be 'active' in the sense used by
168- `ICodeImportSet.getActiveImports`.
169- """
170- if project_name is not None:
171- project = factory.makeProject(name=project_name)
172- else:
173- project = None
174- product = factory.makeProduct(
175- name=product_name, displayname=product_name, project=project)
176- code_import = factory.makeProductCodeImport(
177- product=product, branch_name=branch_name,
178- svn_branch_url=svn_branch_url, cvs_root=cvs_root,
179- cvs_module=cvs_module, git_repo_url=git_repo_url,
180- hg_repo_url=hg_repo_url, rcs_type=None)
181- make_import_active(factory, code_import, last_update)
182- return code_import
183-
184-
185-def make_import_active(factory, code_import, last_update=None):
186- """Make `code_import` active as per `ICodeImportSet.getActiveImports`."""
187- from zope.security.proxy import removeSecurityProxy
188- naked_import = removeSecurityProxy(code_import)
189- if naked_import.review_status != CodeImportReviewStatus.REVIEWED:
190- naked_import.updateFromData(
191- {'review_status': CodeImportReviewStatus.REVIEWED},
192- factory.makePerson())
193- if last_update is None:
194- # If last_update is not specfied, presumably we don't care what it is
195- # so we just use some made up value.
196- last_update = datetime(2008, 1, 1, tzinfo=pytz.UTC)
197- naked_import.date_last_successful = last_update
198-
199-
200-def deactivate(project_or_product):
201- """Mark `project_or_product` as not active."""
202- from zope.security.proxy import removeSecurityProxy
203- removeSecurityProxy(project_or_product).active = False
204-
205-
206-class TestGetActiveImports(TestCaseWithFactory):
207- """Tests for CodeImportSet.getActiveImports()."""
208-
209- layer = DatabaseFunctionalLayer
210-
211- def setUp(self):
212- """Prepare by deleting all the import data in the sample data.
213-
214- This means that the tests only have to care about the import
215- data they create.
216- """
217- super(TestGetActiveImports, self).setUp()
218- nuke_codeimport_sample_data()
219- login('no-priv@canonical.com')
220-
221- def tearDown(self):
222- super(TestGetActiveImports, self).tearDown()
223- logout()
224-
225- def testEmpty(self):
226- # We start out with no code imports, so getActiveImports() returns no
227- # results.
228- results = getUtility(ICodeImportSet).getActiveImports()
229- self.assertEquals(list(results), [])
230-
231- def testOneSeries(self):
232- # When there is one active import, it is returned.
233- code_import = make_active_import(self.factory)
234- results = getUtility(ICodeImportSet).getActiveImports()
235- self.assertEquals(list(results), [code_import])
236-
237- def testOneSeriesWithProject(self):
238- # Code imports for products with a project should be returned too.
239- code_import = make_active_import(
240- self.factory, project_name="whatever")
241- results = getUtility(ICodeImportSet).getActiveImports()
242- self.assertEquals(list(results), [code_import])
243-
244- def testExcludeDeactivatedProducts(self):
245- # Deactivating a product means that code imports associated to it are
246- # no longer returned.
247- code_import = make_active_import(self.factory)
248- self.failUnless(code_import.branch.product.active)
249- results = getUtility(ICodeImportSet).getActiveImports()
250- self.assertEquals(list(results), [code_import])
251- deactivate(code_import.branch.product)
252- results = getUtility(ICodeImportSet).getActiveImports()
253- self.assertEquals(list(results), [])
254-
255- def testExcludeDeactivatedProjects(self):
256- # Deactivating a project means that code imports associated to
257- # products in it are no longer returned.
258- code_import = make_active_import(
259- self.factory, project_name="whatever")
260- self.failUnless(code_import.branch.product.project.active)
261- results = getUtility(ICodeImportSet).getActiveImports()
262- self.assertEquals(list(results), [code_import])
263- deactivate(code_import.branch.product.project)
264- results = getUtility(ICodeImportSet).getActiveImports()
265- self.assertEquals(list(results), [])
266-
267- def testSorting(self):
268- # Returned code imports are sorted by product name, then branch name.
269- prod1_a = make_active_import(
270- self.factory, product_name='prod1', branch_name='a')
271- prod2_a = make_active_import(
272- self.factory, product_name='prod2', branch_name='a')
273- prod1_b = self.factory.makeProductCodeImport(
274- product=prod1_a.branch.product, branch_name='b')
275- make_import_active(self.factory, prod1_b)
276- results = getUtility(ICodeImportSet).getActiveImports()
277- self.assertEquals(
278- list(results), [prod1_a, prod1_b, prod2_a])
279-
280- def testSearchByProduct(self):
281- # Searching can filter by product name and other texts.
282- code_import = make_active_import(
283- self.factory, product_name='product')
284- results = getUtility(ICodeImportSet).getActiveImports(
285- text='product')
286- self.assertEquals(
287- list(results), [code_import])
288-
289- def testSearchByProductWithProject(self):
290- # Searching can filter by product name and other texts, and returns
291- # matching imports even if the associated product is in a project
292- # which does not match.
293- code_import = make_active_import(
294- self.factory, project_name='whatever', product_name='product')
295- results = getUtility(ICodeImportSet).getActiveImports(
296- text='product')
297- self.assertEquals(
298- list(results), [code_import])
299-
300- def testSearchByProject(self):
301- # Searching can filter by project name and other texts.
302- code_import = make_active_import(
303- self.factory, project_name='project', product_name='product')
304- results = getUtility(ICodeImportSet).getActiveImports(
305- text='project')
306- self.assertEquals(
307- list(results), [code_import])
308-
309- def testSearchByProjectWithNonMatchingProduct(self):
310- # If a project matches the text, it's an easy mistake to make to
311- # consider all the products with no project as matching too.
312- code_import_1 = make_active_import(
313- self.factory, product_name='product1')
314- code_import_2 = make_active_import(
315- self.factory, project_name='thisone', product_name='product2')
316- results = getUtility(ICodeImportSet).getActiveImports(
317- text='thisone')
318- self.assertEquals(
319- list(results), [code_import_2])
320-
321- def testJoining(self):
322- # Test that the query composed by CodeImportSet.composeQueryString
323- # gets the joins right. We create code imports for each of the
324- # possibilities of active or inactive product and active or inactive
325- # or absent project.
326- expected = set()
327- source = {}
328- for project_active in [True, False, None]:
329- for product_active in [True, False]:
330- if project_active is not None:
331- project_name = self.factory.getUniqueString()
332- else:
333- project_name = None
334- code_import = make_active_import(
335- self.factory, project_name=project_name)
336- if code_import.branch.product.project and not project_active:
337- deactivate(code_import.branch.product.project)
338- if not product_active:
339- deactivate(code_import.branch.product)
340- if project_active != False and product_active:
341- expected.add(code_import)
342- source[code_import] = (product_active, project_active)
343- results = set(getUtility(ICodeImportSet).getActiveImports())
344- errors = []
345- for extra in results - expected:
346- errors.append(('extra', source[extra]))
347- for missing in expected - results:
348- errors.append(('extra', source[missing]))
349- self.assertEquals(errors, [])
350-
351-
352 def test_suite():
353 return unittest.TestLoader().loadTestsFromName(__name__)
354
355=== modified file 'lib/lp/code/stories/branches/xx-bazaar-home.txt'
356--- lib/lp/code/stories/branches/xx-bazaar-home.txt 2009-08-28 05:57:37 +0000
357+++ lib/lp/code/stories/branches/xx-bazaar-home.txt 2010-04-02 02:45:43 +0000
358@@ -16,7 +16,7 @@
359 >>> print extract_text(footer)
360 30 branches registered in
361 6 projects
362- 0 imported branches
363+ 1 imported branches
364 2 branches associated with bug reports
365 Launchpad uses Bazaar 0.92.0.
366
367
368=== removed file 'lib/lp/code/stories/codeimport/xx-codeimport-list.txt'
369--- lib/lp/code/stories/codeimport/xx-codeimport-list.txt 2010-01-12 22:09:23 +0000
370+++ lib/lp/code/stories/codeimport/xx-codeimport-list.txt 1970-01-01 00:00:00 +0000
371@@ -1,72 +0,0 @@
372-There is a page listing all the active code imports on the code
373-homepage.
374-
375-We start by deleting all the code import sample data and creating a
376-few imports that will be displayed in the listing.
377-
378- >>> import datetime
379- >>> import pytz
380- >>> from lp.codehosting.codeimport.tests.test_workermonitor import (
381- ... nuke_codeimport_sample_data)
382- >>> from lp.code.enums import RevisionControlSystems
383- >>> from lp.code.model.tests.test_codeimport import (
384- ... make_active_import)
385- >>> from lp.code.interfaces.codeimport import ICodeImportSet
386- >>> from lp.testing import login, logout
387- >>> from zope.component import getUtility
388- >>> login('david.allouche@canonical.com')
389- >>> nuke_codeimport_sample_data()
390- >>> code_import_set = getUtility(ICodeImportSet)
391- >>> active_svn_import = make_active_import(
392- ... factory, product_name="myproject", branch_name="trunk",
393- ... svn_branch_url="http://example.com/svn/myproject/trunk",
394- ... last_update=datetime.datetime(2007, 1, 1, tzinfo=pytz.UTC))
395- >>> active_bzr_svn_import = make_active_import(
396- ... factory, product_name="ourproject", branch_name="trunk",
397- ... svn_branch_url="http://example.com/bzr-svn/myproject/trunk",
398- ... rcs_type=RevisionControlSystems.BZR_SVN,
399- ... last_update=datetime.datetime(2007, 1, 2, tzinfo=pytz.UTC))
400- >>> active_cvs_import = make_active_import(
401- ... factory, product_name="hisproj", branch_name="main",
402- ... cvs_root=":pserver:anon@example.com:/cvs", cvs_module="hisproj",
403- ... last_update=datetime.datetime(2007, 1, 3, tzinfo=pytz.UTC))
404- >>> active_git_import = make_active_import(
405- ... factory, product_name="herproj", branch_name="master",
406- ... git_repo_url="git://git.example.org/herproj",
407- ... last_update=datetime.datetime(2007, 1, 4, tzinfo=pytz.UTC))
408- >>> active_hg_import = make_active_import(
409- ... factory, product_name="hg-proj", branch_name="tip",
410- ... hg_repo_url="http://hg.example.org/proj",
411- ... last_update=datetime.datetime(2007, 1, 5, tzinfo=pytz.UTC))
412- >>> len(list(code_import_set.getActiveImports()))
413- 5
414- >>> logout()
415-
416-The page is linked to from the "$N imported branches" text.
417-
418- >>> browser.open('http://code.launchpad.dev')
419- >>> browser.getLink('5 imported branches').click()
420- >>> print browser.title
421- Available code imports
422-
423-It lists the active imports, sorted by product then branch name:
424-
425- >>> def print_import_table():
426- ... table = first_tag_by_class(browser.contents, 'listing')
427- ... print extract_text(table)
428-
429- >>> print_import_table()
430- Project Branch Name Source Details Last Updated
431- herproj master git://git.example.org/herproj 2007-01-04
432- hg-proj tip http://hg.example.org/proj 2007-01-05
433- hisproj main :pserver:anon@example.com:/cvs hisproj 2007-01-03
434- myproject trunk http://example.com/svn/myproject/trunk 2007-01-01
435- ourproject trunk http://example.com/bzr-svn/myproject/trunk 2007-01-02
436-
437-You can filter the list by product:
438-
439- >>> browser.getControl(name='text').value = 'hisproj'
440- >>> browser.getControl('Search', index=0).click()
441- >>> print_import_table()
442- Project Branch Name Source Details Last Updated
443- hisproj main :pserver:anon@example.com:/cvs hisproj 2007-01-03
444
445=== modified file 'lib/lp/code/stories/codeimport/xx-codeimport-view.txt'
446--- lib/lp/code/stories/codeimport/xx-codeimport-view.txt 2010-03-18 17:49:21 +0000
447+++ lib/lp/code/stories/codeimport/xx-codeimport-view.txt 2010-04-02 02:45:43 +0000
448@@ -1,10 +1,10 @@
449 Code imports
450 ============
451
452-For now, there is no link to the page that lists all code imports, so
453-we browse there directly:
454+The code imports overview page is linked of the main code page.
455
456- >>> browser.open('http://code.launchpad.dev/+code-imports')
457+ >>> browser.open('http://code.launchpad.dev')
458+ >>> browser.getLink('1 imported branches').click()
459 >>> print browser.title
460 Code Imports
461
462
463=== modified file 'lib/lp/code/templates/bazaar-index.pt'
464--- lib/lp/code/templates/bazaar-index.pt 2010-03-11 06:43:00 +0000
465+++ lib/lp/code/templates/bazaar-index.pt 2010-04-02 02:45:43 +0000
466@@ -121,7 +121,7 @@
467 </a>
468 </div>
469 <div>
470- <a href="/+code-import-list">
471+ <a href="/+code-imports">
472 <strong tal:content="view/import_count">123</strong>
473 imported branches
474 </a>
475
476=== modified file 'lib/lp/registry/browser/productseries.py'
477--- lib/lp/registry/browser/productseries.py 2010-03-23 00:39:45 +0000
478+++ lib/lp/registry/browser/productseries.py 2010-04-02 02:45:43 +0000
479@@ -20,7 +20,6 @@
480 'ProductSeriesOverviewNavigationMenu',
481 'ProductSeriesRdfView',
482 'ProductSeriesReviewView',
483- 'ProductSeriesSourceListView',
484 'ProductSeriesSpecificationsMenu',
485 'ProductSeriesUbuntuPackagingView',
486 'ProductSeriesView',
487@@ -50,8 +49,6 @@
488 from lp.bugs.browser.bugtask import BugTargetTraversalMixin
489 from canonical.launchpad.helpers import browserLanguages
490 from lp.code.interfaces.branchjob import IRosettaUploadJobSource
491-from lp.code.interfaces.codeimport import (
492- ICodeImportSet)
493 from lp.services.worlddata.interfaces.country import ICountry
494 from lp.bugs.interfaces.bugtask import IBugTaskSet
495 from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities
496@@ -70,7 +67,6 @@
497 Link, Navigation, NavigationMenu, StandardLaunchpadFacets, stepthrough,
498 stepto)
499 from canonical.launchpad.webapp.authorization import check_permission
500-from canonical.launchpad.webapp.batching import BatchNavigator
501 from canonical.launchpad.webapp.breadcrumb import Breadcrumb
502 from canonical.launchpad.webapp.interfaces import NotFoundError
503 from canonical.launchpad.webapp.launchpadform import (
504@@ -753,23 +749,6 @@
505 return encodeddata
506
507
508-class ProductSeriesSourceListView(LaunchpadView):
509- """A listing of all the running imports.
510-
511- See `ICodeImportSet.getActiveImports` for our definition of running.
512- """
513-
514- page_title = 'Available code imports'
515- label = page_title
516-
517- def initialize(self):
518- """See `LaunchpadFormView`."""
519- self.text = self.request.get('text')
520- results = getUtility(ICodeImportSet).getActiveImports(text=self.text)
521-
522- self.batchnav = BatchNavigator(results, self.request)
523-
524-
525 class ProductSeriesFileBugRedirect(LaunchpadView):
526 """Redirect to the product's +filebug page."""
527