Merge lp:~mwhudson/launchpad/bzr-svn-ui into lp:launchpad/db-devel

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Tim Penhey
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~mwhudson/launchpad/bzr-svn-ui
Merge into: lp:launchpad/db-devel
Diff against target: 512 lines (+163/-46)
12 files modified
lib/lp/code/browser/branch.py (+10/-2)
lib/lp/code/browser/codeimport.py (+9/-6)
lib/lp/code/browser/tests/test_codeimport.py (+60/-0)
lib/lp/code/doc/codeimport.txt (+1/-1)
lib/lp/code/enums.py (+1/-1)
lib/lp/code/model/tests/test_codeimport.py (+2/-2)
lib/lp/code/stories/codeimport/xx-admin-codeimport.txt (+40/-12)
lib/lp/code/stories/codeimport/xx-codeimport-list.txt (+16/-11)
lib/lp/code/stories/codeimport/xx-codeimport-view.txt (+4/-2)
lib/lp/code/stories/codeimport/xx-create-codeimport.txt (+8/-0)
lib/lp/code/templates/branch-import-details.pt (+11/-8)
lib/lp/code/templates/codeimport-new.pt (+1/-1)
To merge this branch: bzr merge lp:~mwhudson/launchpad/bzr-svn-ui
Reviewer Review Type Date Requested Status
Tim Penhey (community) conditional Approve
Review via email: mp+15792@code.launchpad.net

Commit message

New subversion code imports will be done with bzr-svn.

To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Hi Tim,

This branch updates the UI for the bzr-svn transition. It fixes the branch index page to show information about bzr-svn branches, fixes the edit import page and makes selecting "subversion" on the new import form create a bzr-svn import.

Some of the new tests duplicate parts of a page test (I wrote them before I found the page test) but I left them in so we can think about cleaning up the page test one day.

Cheers,
mwh

Revision history for this message
Tim Penhey (thumper) wrote :
Download full text (8.4 KiB)

  review approve conditional
  merge approved

Just some minor tweaks, but on the whole, awesome!

Tim

> === modified file 'lib/lp/code/browser/branch.py'
> --- lib/lp/code/browser/branch.py 2009-12-07 02:11:31 +0000
> +++ lib/lp/code/browser/branch.py 2009-12-08 03:10:29 +0000
> @@ -79,7 +79,8 @@
> from lp.code.browser.branchmergeproposal import (
> latest_proposals_for_each_branch)
> from lp.code.enums import (
> - BranchLifecycleStatus, BranchType, UICreatableBranchType)
> + BranchLifecycleStatus, BranchType, RevisionControlSystems,
> + UICreatableBranchType)
> from lp.code.errors import InvalidBranchMergeProposal
> from lp.code.interfaces.branch import (
> BranchCreationForbidden, BranchExists, IBranch,
> @@ -501,6 +502,14 @@
> return list(self.context.code_import.results[:10])
>
> @property
> + def is_svn_import(self):
> + """True if an imported branch is a SVN import."""
> + # You should only be calling this if it's an SVN code import

Well, we should only be calling this if it is an import of any kind.

> + assert self.context.code_import
> + return self.context.code_import.rcs_type in \
> + (RevisionControlSystems.SVN, RevisionControlSystems.BZR_SVN)
> +
> + @property
> def svn_url_is_web(self):
> """True if an imported branch's SVN URL is HTTP or HTTPS."""
> # You should only be calling this if it's an SVN code import
> === added file 'lib/lp/code/browser/tests/test_codeimport.py'
> --- lib/lp/code/browser/tests/test_codeimport.py 1970-01-01 00:00:00 +0000
> +++ lib/lp/code/browser/tests/test_codeimport.py 2009-12-08 03:10:29 +0000
> @@ -0,0 +1,58 @@
> +# Copyright 2009 Canonical Ltd. This software is licensed under the
> +# GNU Affero General Public License version 3 (see the file LICENSE).
> +
> +"""Tests for the code import browser code."""
> +
> +__metaclass__ = type
> +
> +import re
> +import unittest
> +
> +from canonical.launchpad.testing.pages import extract_text, find_tag_by_id
> +from canonical.launchpad.webapp import canonical_url
> +from canonical.testing.layers import DatabaseFunctionalLayer
> +
> +from lp.code.enums import RevisionControlSystems
> +from lp.testing import TestCaseWithFactory
> +
> +
> +class TestImportDetails(TestCaseWithFactory):
> +
> + layer = DatabaseFunctionalLayer
> +
> + def assertSvnDetailsDisplayed(self, svn_details, rcs_type, url):
> + """Assert the `svn_details` tag described a Subversion import."""
> + self.assertEquals(rcs_type.title, svn_details.span['title'])
> + text = re.sub('\s+', ' ', extract_text(svn_details))
> + self.assertTrue(
> + text.startswith(
> + 'This branch is an import of the Subversion branch'))
> + self.assertEquals(url, svn_details.a['href'])

I'm not sure I'd add this last assert here as we only show the anchor if
the subversion url is http. But the rest looks good.

> + def test_bzr_svn_import(self):
> + # The branch page for a bzr-svn-imported branch contains a summary
of
> + # the import details.
> + bzr_svn_import = self.factory.makeCodeImport(
> + rcs...

Read more...

review: Approve (conditional)
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :
Download full text (9.0 KiB)

Tim Penhey wrote:
> Review: Approve conditional
> review approve conditional
> merge approved
>
> Just some minor tweaks, but on the whole, awesome!

Thanks.

>> === modified file 'lib/lp/code/browser/branch.py'
>> --- lib/lp/code/browser/branch.py 2009-12-07 02:11:31 +0000
>> +++ lib/lp/code/browser/branch.py 2009-12-08 03:10:29 +0000
>> @@ -79,7 +79,8 @@
>> from lp.code.browser.branchmergeproposal import (
>> latest_proposals_for_each_branch)
>> from lp.code.enums import (
>> - BranchLifecycleStatus, BranchType, UICreatableBranchType)
>> + BranchLifecycleStatus, BranchType, RevisionControlSystems,
>> + UICreatableBranchType)
>> from lp.code.errors import InvalidBranchMergeProposal
>> from lp.code.interfaces.branch import (
>> BranchCreationForbidden, BranchExists, IBranch,
>> @@ -501,6 +502,14 @@
>> return list(self.context.code_import.results[:10])
>>
>> @property
>> + def is_svn_import(self):
>> + """True if an imported branch is a SVN import."""
>> + # You should only be calling this if it's an SVN code import
>
> Well, we should only be calling this if it is an import of any kind.

Uh. Right. Fixed.

>> + assert self.context.code_import
>> + return self.context.code_import.rcs_type in \
>> + (RevisionControlSystems.SVN, RevisionControlSystems.BZR_SVN)
>> +
>> + @property
>> def svn_url_is_web(self):
>> """True if an imported branch's SVN URL is HTTP or HTTPS."""
>> # You should only be calling this if it's an SVN code import
>> === added file 'lib/lp/code/browser/tests/test_codeimport.py'
>> --- lib/lp/code/browser/tests/test_codeimport.py 1970-01-01 00:00:00 +0000
>> +++ lib/lp/code/browser/tests/test_codeimport.py 2009-12-08 03:10:29 +0000
>> @@ -0,0 +1,58 @@
>> +# Copyright 2009 Canonical Ltd. This software is licensed under the
>> +# GNU Affero General Public License version 3 (see the file LICENSE).
>> +
>> +"""Tests for the code import browser code."""
>> +
>> +__metaclass__ = type
>> +
>> +import re
>> +import unittest
>> +
>> +from canonical.launchpad.testing.pages import extract_text, find_tag_by_id
>> +from canonical.launchpad.webapp import canonical_url
>> +from canonical.testing.layers import DatabaseFunctionalLayer
>> +
>> +from lp.code.enums import RevisionControlSystems
>> +from lp.testing import TestCaseWithFactory
>> +
>> +
>> +class TestImportDetails(TestCaseWithFactory):
>> +
>> + layer = DatabaseFunctionalLayer
>> +
>> + def assertSvnDetailsDisplayed(self, svn_details, rcs_type, url):
>> + """Assert the `svn_details` tag described a Subversion import."""
>> + self.assertEquals(rcs_type.title, svn_details.span['title'])
>> + text = re.sub('\s+', ' ', extract_text(svn_details))
>> + self.assertTrue(
>> + text.startswith(
>> + 'This branch is an import of the Subversion branch'))
>> + self.assertEquals(url, svn_details.a['href'])
>
> I'm not sure I'd add this last assert here as we only show the anchor if
> the subversion url is http. But the rest looks good.

You're right, the tests are more focused without that assert.

>> + def t...

Read more...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/code/browser/branch.py'
2--- lib/lp/code/browser/branch.py 2009-12-07 02:57:22 +0000
3+++ lib/lp/code/browser/branch.py 2009-12-08 19:25:27 +0000
4@@ -79,7 +79,8 @@
5 from lp.code.browser.branchmergeproposal import (
6 latest_proposals_for_each_branch)
7 from lp.code.enums import (
8- BranchLifecycleStatus, BranchType, UICreatableBranchType)
9+ BranchLifecycleStatus, BranchType, RevisionControlSystems,
10+ UICreatableBranchType)
11 from lp.code.errors import InvalidBranchMergeProposal
12 from lp.code.interfaces.branch import (
13 BranchCreationForbidden, BranchExists, IBranch,
14@@ -501,6 +502,14 @@
15 return list(self.context.code_import.results[:10])
16
17 @property
18+ def is_svn_import(self):
19+ """True if an imported branch is a SVN import."""
20+ # You should only be calling this if it's a code import
21+ assert self.context.code_import
22+ return self.context.code_import.rcs_type in \
23+ (RevisionControlSystems.SVN, RevisionControlSystems.BZR_SVN)
24+
25+ @property
26 def svn_url_is_web(self):
27 """True if an imported branch's SVN URL is HTTP or HTTPS."""
28 # You should only be calling this if it's an SVN code import
29@@ -849,7 +858,6 @@
30 The keys are 'delete' and 'alter'; the values are dicts of
31 'item', 'reason' and 'allowed'.
32 """
33- branch = self.context
34 row_dict = {'delete': [], 'alter': [], 'break_link': []}
35 for item, action, reason, allowed in (
36 self.display_deletion_requirements):
37
38=== modified file 'lib/lp/code/browser/codeimport.py'
39--- lib/lp/code/browser/codeimport.py 2009-08-24 20:28:33 +0000
40+++ lib/lp/code/browser/codeimport.py 2009-12-08 19:25:27 +0000
41@@ -227,7 +227,7 @@
42 custom_widget('rcs_type', LaunchpadRadioWidget)
43
44 initial_values = {
45- 'rcs_type': RevisionControlSystems.SVN,
46+ 'rcs_type': RevisionControlSystems.BZR_SVN,
47 'branch_name': 'trunk',
48 }
49
50@@ -258,7 +258,7 @@
51 fields = soup.findAll('input')
52 [cvs_button, svn_button, git_button, empty_marker] = [
53 field for field in fields
54- if field.get('value') in ['CVS', 'SVN', 'GIT', '1']]
55+ if field.get('value') in ['CVS', 'BZR_SVN', 'GIT', '1']]
56 cvs_button['onclick'] = 'updateWidgets()'
57 svn_button['onclick'] = 'updateWidgets()'
58 git_button['onclick'] = 'updateWidgets()'
59@@ -360,7 +360,7 @@
60 data['svn_branch_url'] = None
61 data['git_repo_url'] = None
62 self._validateCVS(data.get('cvs_root'), data.get('cvs_module'))
63- elif rcs_type == RevisionControlSystems.SVN:
64+ elif rcs_type == RevisionControlSystems.BZR_SVN:
65 data['cvs_root'] = None
66 data['cvs_module'] = None
67 data['git_repo_url'] = None
68@@ -371,7 +371,8 @@
69 data['svn_branch_url'] = None
70 self._validateGit(data.get('git_repo_url'))
71 else:
72- raise AssertionError('Unknown revision control type.')
73+ raise AssertionError(
74+ 'Unexpected revision control type %r.' % rcs_type)
75
76
77 class EditCodeImportForm(Interface):
78@@ -458,7 +459,8 @@
79 if self.code_import.rcs_type == RevisionControlSystems.CVS:
80 self.form_fields = self.form_fields.omit(
81 'svn_branch_url', 'git_repo_url')
82- elif self.code_import.rcs_type == RevisionControlSystems.SVN:
83+ elif self.code_import.rcs_type in (RevisionControlSystems.SVN,
84+ RevisionControlSystems.BZR_SVN):
85 self.form_fields = self.form_fields.omit(
86 'cvs_root', 'cvs_module', 'git_repo_url')
87 elif self.code_import.rcs_type == RevisionControlSystems.GIT:
88@@ -493,7 +495,8 @@
89 self._validateCVS(
90 data.get('cvs_root'), data.get('cvs_module'),
91 self.code_import)
92- elif self.code_import.rcs_type == RevisionControlSystems.SVN:
93+ elif self.code_import.rcs_type in (RevisionControlSystems.SVN,
94+ RevisionControlSystems.BZR_SVN):
95 self._validateSVN(
96 data.get('svn_branch_url'), self.code_import)
97 elif self.code_import.rcs_type == RevisionControlSystems.GIT:
98
99=== added file 'lib/lp/code/browser/tests/test_codeimport.py'
100--- lib/lp/code/browser/tests/test_codeimport.py 1970-01-01 00:00:00 +0000
101+++ lib/lp/code/browser/tests/test_codeimport.py 2009-12-08 19:25:27 +0000
102@@ -0,0 +1,60 @@
103+# Copyright 2009 Canonical Ltd. This software is licensed under the
104+# GNU Affero General Public License version 3 (see the file LICENSE).
105+
106+"""Tests for the code import browser code."""
107+
108+__metaclass__ = type
109+
110+import re
111+import unittest
112+
113+from canonical.launchpad.testing.pages import extract_text, find_tag_by_id
114+from canonical.launchpad.webapp import canonical_url
115+from canonical.testing.layers import DatabaseFunctionalLayer
116+
117+from lp.code.enums import RevisionControlSystems
118+from lp.testing import TestCaseWithFactory
119+
120+
121+class TestImportDetails(TestCaseWithFactory):
122+
123+ layer = DatabaseFunctionalLayer
124+
125+ def assertSvnDetailsDisplayed(self, svn_details, rcs_type):
126+ """Assert the `svn_details` tag describes a Subversion import.
127+
128+ :param svn_details: The BeautifulSoup object for the
129+ 'svn-import-details' area.
130+ :param rcs_type: SVN or BZR_SVN from RevisionControlSystems.
131+ """
132+ self.assertEquals(rcs_type.title, svn_details.span['title'])
133+ text = re.sub('\s+', ' ', extract_text(svn_details))
134+ self.assertTrue(
135+ text.startswith(
136+ 'This branch is an import of the Subversion branch'))
137+
138+ def test_bzr_svn_import(self):
139+ # The branch page for a bzr-svn-imported branch contains
140+ # a summary of the import details.
141+ bzr_svn_import = self.factory.makeCodeImport(
142+ rcs_type=RevisionControlSystems.BZR_SVN)
143+ browser = self.getUserBrowser(canonical_url(bzr_svn_import.branch))
144+ svn_details = find_tag_by_id(browser.contents, 'svn-import-details')
145+ self.assertSvnDetailsDisplayed(
146+ svn_details, RevisionControlSystems.BZR_SVN)
147+
148+ def test_cscvs_svn_import(self):
149+ # The branch page for a cscvs-imported svn branch contains a summary
150+ # of the import details.
151+ bzr_svn_import = self.factory.makeCodeImport(
152+ rcs_type=RevisionControlSystems.SVN)
153+ browser = self.getUserBrowser(canonical_url(bzr_svn_import.branch))
154+ svn_details = find_tag_by_id(browser.contents, 'svn-import-details')
155+ self.assertSvnDetailsDisplayed(
156+ svn_details, RevisionControlSystems.SVN)
157+
158+
159+
160+def test_suite():
161+ return unittest.TestLoader().loadTestsFromName(__name__)
162+
163
164=== modified file 'lib/lp/code/doc/codeimport.txt'
165--- lib/lp/code/doc/codeimport.txt 2009-12-06 20:28:49 +0000
166+++ lib/lp/code/doc/codeimport.txt 2009-12-08 19:25:27 +0000
167@@ -56,7 +56,7 @@
168 >>> for item in RevisionControlSystems:
169 ... print item.title
170 Concurrent Versions System
171- Subversion
172+ Subversion via CSCVS
173 Subversion via bzr-svn
174 Git
175
176
177=== modified file 'lib/lp/code/enums.py'
178--- lib/lp/code/enums.py 2009-07-17 00:26:05 +0000
179+++ lib/lp/code/enums.py 2009-12-08 19:25:27 +0000
180@@ -388,7 +388,7 @@
181 """)
182
183 SVN = DBItem(2, """
184- Subversion
185+ Subversion via CSCVS
186
187 Imports from SVN using CSCVS.
188 """)
189
190=== modified file 'lib/lp/code/model/tests/test_codeimport.py'
191--- lib/lp/code/model/tests/test_codeimport.py 2009-09-01 04:05:11 +0000
192+++ lib/lp/code/model/tests/test_codeimport.py 2009-12-08 19:25:27 +0000
193@@ -534,7 +534,7 @@
194 def make_active_import(factory, project_name=None, product_name=None,
195 branch_name=None, svn_branch_url=None,
196 cvs_root=None, cvs_module=None, git_repo_url=None,
197- last_update=None):
198+ last_update=None, rcs_type=None):
199 """Make a new CodeImport for a new Product, maybe in a new Project.
200
201 The import will be 'active' in the sense used by
202@@ -549,7 +549,7 @@
203 code_import = factory.makeCodeImport(
204 product=product, branch_name=branch_name,
205 svn_branch_url=svn_branch_url, cvs_root=cvs_root,
206- cvs_module=cvs_module, git_repo_url=git_repo_url)
207+ cvs_module=cvs_module, git_repo_url=git_repo_url, rcs_type=None)
208 make_import_active(factory, code_import, last_update)
209 return code_import
210
211
212=== modified file 'lib/lp/code/stories/codeimport/xx-admin-codeimport.txt'
213--- lib/lp/code/stories/codeimport/xx-admin-codeimport.txt 2009-11-13 10:43:32 +0000
214+++ lib/lp/code/stories/codeimport/xx-admin-codeimport.txt 2009-12-08 19:25:27 +0000
215@@ -1,11 +1,13 @@
216-= Administrating code imports =
217+Administrating code imports
218+===========================
219
220 The code import details are displayed on the main branch page for
221 imported branches. If the logged in user is an import operator
222 (member of VCS imports or Launchpad admin) then they can see a link
223 to edit the details.
224
225- >>> from canonical.launchpad.ftests import ANONYMOUS, login, logout
226+ >>> from lp.code.enums import RevisionControlSystems
227+ >>> from lp.testing import ANONYMOUS, login, logout
228 >>> login('test@canonical.com')
229
230 >>> svn_import = factory.makeCodeImport(
231@@ -14,6 +16,12 @@
232 >>> svn_import_location = str(canonical_url(svn_import.branch))
233 >>> svn_import_branch_unique_name = svn_import.branch.unique_name
234
235+ >>> bzr_svn_import = factory.makeCodeImport(
236+ ... svn_branch_url='svn://svn.example.com/bzr-svn/trunk',
237+ ... rcs_type=RevisionControlSystems.BZR_SVN)
238+ >>> bzr_svn_import_location = str(canonical_url(bzr_svn_import.branch))
239+ >>> bzr_svn_import_branch_unique_name = bzr_svn_import.branch.unique_name
240+
241 >>> cvs_import = factory.makeCodeImport(
242 ... cvs_root=":pserver:anonymous@cvs.example.com:/fooix",
243 ... cvs_module="fooix")
244@@ -30,7 +38,8 @@
245 ... auth='Basic david.allouche@canonical.com:test')
246
247
248-== Editing the import ==
249+Editing the import
250+------------------
251
252 Both VCS Imports members and Launchpad administrators can edit the
253 import:
254@@ -46,7 +55,8 @@
255 from svn://svn.example.com/fooix/trunk.
256
257
258-== Editing details ==
259+Editing details
260+---------------
261
262 There are a number of buttons shown on the editing page for
263 import operators.
264@@ -87,7 +97,8 @@
265 >>> print_form_fields(import_browser)
266 field.git_repo_url: git://git.example.org/fooix
267
268-=== Editing the import location ===
269+Editing the import location
270++++++++++++++++++++++++++++
271
272 The +edit-import page allows the import operator to edit the location
273 an import is from.
274@@ -102,6 +113,16 @@
275 ... print extract_text(message)
276 The code import has been updated.
277
278+bzr-svn imports,
279+
280+ >>> import_browser.open(bzr_svn_import_location + '/+edit-import')
281+ >>> import_browser.getControl('Branch URL').value = \
282+ ... 'svn://svn-new.example.com/bzr-svn/trunk'
283+ >>> import_browser.getControl('Update').click()
284+ >>> for message in get_feedback_messages(import_browser.contents):
285+ ... print extract_text(message)
286+ The code import has been updated.
287+
288 CVS imports,
289
290 >>> import_browser.open(cvs_import_location + '/+edit-import')
291@@ -125,7 +146,8 @@
292 The code import has been updated.
293
294
295-=== Approving an import ===
296+Approving an import
297++++++++++++++++++++
298
299 When a code import is approved, a pending job is created for it.
300
301@@ -141,7 +163,8 @@
302 The code import has been approved.
303
304
305-=== Invalidating an import ===
306+Invalidating an import
307+++++++++++++++++++++++
308
309 >>> import_browser.getLink('Edit import source or review import').click()
310 >>> import_browser.getControl('Mark Invalid').click()
311@@ -153,7 +176,8 @@
312 The code import has been set as invalid.
313
314
315-=== Suspending an import ===
316+Suspending an import
317+++++++++++++++++++++
318
319 >>> import_browser.getLink('Edit import source or review import').click()
320 >>> import_browser.getControl('Suspend').click()
321@@ -165,7 +189,8 @@
322 The code import has been suspended.
323
324
325-=== Marking an import as failing ===
326+Marking an import as failing
327+++++++++++++++++++++++++++++
328
329 >>> import_browser.getLink('Edit import source or review import').click()
330 >>> import_browser.getControl('Mark Failing').click()
331@@ -177,7 +202,8 @@
332 The code import has been marked as failing.
333
334
335-== Import details for a running job ==
336+Import details for a running job
337+--------------------------------
338
339 If the job for an approved import is running, then the import details
340 says how long ago since it started.
341@@ -218,7 +244,8 @@
342 Changeset 2
343
344
345-== Import details for a import that has been imported successfully ==
346+Import details for a import that has been imported successfully
347+---------------------------------------------------------------
348
349 If a branch has been successfully imported in the past, then the date
350 that it was last successful is shown, as well as when the next import
351@@ -245,7 +272,8 @@
352 ...
353
354
355-== Requesting an import ==
356+Requesting an import
357+--------------------
358
359 If an import is waiting for its next update, any logged in user can
360 click a button to request an immediate import.
361
362=== modified file 'lib/lp/code/stories/codeimport/xx-codeimport-list.txt'
363--- lib/lp/code/stories/codeimport/xx-codeimport-list.txt 2009-06-15 21:05:06 +0000
364+++ lib/lp/code/stories/codeimport/xx-codeimport-list.txt 2009-12-08 19:25:27 +0000
365@@ -8,7 +8,7 @@
366 >>> import pytz
367 >>> from lp.codehosting.codeimport.tests.test_workermonitor import (
368 ... nuke_codeimport_sample_data)
369- >>> from canonical.database.sqlbase import flush_database_updates
370+ >>> from lp.code.enums import RevisionControlSystems
371 >>> from lp.code.model.tests.test_codeimport import (
372 ... make_active_import)
373 >>> from lp.code.interfaces.codeimport import ICodeImportSet
374@@ -21,23 +21,27 @@
375 ... factory, product_name="myproject", branch_name="trunk",
376 ... svn_branch_url="http://example.com/svn/myproject/trunk",
377 ... last_update=datetime.datetime(2007, 1, 1, tzinfo=pytz.UTC))
378+ >>> active_bzr_svn_import = make_active_import(
379+ ... factory, product_name="ourproject", branch_name="trunk",
380+ ... svn_branch_url="http://example.com/bzr-svn/myproject/trunk",
381+ ... rcs_type=RevisionControlSystems.BZR_SVN,
382+ ... last_update=datetime.datetime(2007, 1, 2, tzinfo=pytz.UTC))
383 >>> active_cvs_import = make_active_import(
384 ... factory, product_name="hisproj", branch_name="main",
385 ... cvs_root=":pserver:anon@example.com:/cvs", cvs_module="hisproj",
386- ... last_update=datetime.datetime(2007, 1, 2, tzinfo=pytz.UTC))
387+ ... last_update=datetime.datetime(2007, 1, 3, tzinfo=pytz.UTC))
388 >>> active_git_import = make_active_import(
389 ... factory, product_name="herproj", branch_name="master",
390 ... git_repo_url="git://git.example.org/herproj",
391- ... last_update=datetime.datetime(2007, 1, 3, tzinfo=pytz.UTC))
392- >>> flush_database_updates()
393+ ... last_update=datetime.datetime(2007, 1, 4, tzinfo=pytz.UTC))
394 >>> len(list(code_import_set.getActiveImports()))
395- 3
396+ 4
397 >>> logout()
398
399 The page is linked to from the "$N imported branches" text.
400
401 >>> browser.open('http://code.launchpad.dev')
402- >>> browser.getLink('3 imported branches').click()
403+ >>> browser.getLink('4 imported branches').click()
404 >>> print browser.title
405 Available code imports
406
407@@ -48,10 +52,11 @@
408 ... print extract_text(table)
409
410 >>> print_import_table()
411- Project Branch Name Source Details Last Updated
412- herproj master git://git.example.org/herproj 2007-01-03
413- hisproj main :pserver:anon@example.com:/cvs hisproj 2007-01-02
414- myproject trunk http://example.com/svn/myproject/trunk 2007-01-01
415+ Project Branch Name Source Details Last Updated
416+ herproj master git://git.example.org/herproj 2007-01-04
417+ hisproj main :pserver:anon@example.com:/cvs hisproj 2007-01-03
418+ myproject trunk http://example.com/svn/myproject/trunk 2007-01-01
419+ ourproject trunk http://example.com/bzr-svn/myproject/trunk 2007-01-02
420
421 You can filter the list by product:
422
423@@ -59,4 +64,4 @@
424 >>> browser.getControl('Search', index=0).click()
425 >>> print_import_table()
426 Project Branch Name Source Details Last Updated
427- hisproj main :pserver:anon@example.com:/cvs hisproj 2007-01-02
428+ hisproj main :pserver:anon@example.com:/cvs hisproj 2007-01-03
429
430=== modified file 'lib/lp/code/stories/codeimport/xx-codeimport-view.txt'
431--- lib/lp/code/stories/codeimport/xx-codeimport-view.txt 2009-08-18 00:44:31 +0000
432+++ lib/lp/code/stories/codeimport/xx-codeimport-view.txt 2009-12-08 19:25:27 +0000
433@@ -1,4 +1,5 @@
434-= Code imports =
435+Code imports
436+============
437
438 For now, there is no link to the page that lists all code imports, so
439 we browse there directly:
440@@ -31,7 +32,8 @@
441 'http://code.launchpad.dev/~vcs-imports/gnome-terminal/import'
442
443
444-= Filtering the code import list =
445+Filtering the code import list
446+==============================
447
448 The code import listing is filterable, though only on review status so
449 far. There are no invalid imports in the sample data, so if we filter
450
451=== modified file 'lib/lp/code/stories/codeimport/xx-create-codeimport.txt'
452--- lib/lp/code/stories/codeimport/xx-create-codeimport.txt 2009-11-05 11:06:27 +0000
453+++ lib/lp/code/stories/codeimport/xx-create-codeimport.txt 2009-12-08 19:25:27 +0000
454@@ -54,6 +54,14 @@
455 <Link text='http://svn.example.com/firefox/trunk'
456 url='http://svn.example.com/firefox/trunk'>
457
458+The fact that this is an import via bzr-svn is indicated in a 'title'
459+attribute on the text of 'Subversion'.
460+
461+ >>> svn_span = find_tag_by_id(browser.contents, 'svn-import-details').span
462+ >>> print extract_text(svn_span)
463+ Subversion
464+ >>> print svn_span['title']
465+ Subversion via bzr-svn
466
467 Requesting a Git import
468 =======================
469
470=== modified file 'lib/lp/code/templates/branch-import-details.pt'
471--- lib/lp/code/templates/branch-import-details.pt 2009-12-03 18:33:22 +0000
472+++ lib/lp/code/templates/branch-import-details.pt 2009-12-08 19:25:27 +0000
473@@ -45,15 +45,18 @@
474 </p>
475 </tal:git-import>
476
477- <tal:svn-import condition="code_import/rcs_type/enumvalue:SVN">
478- <p>This branch is an import of the Subversion branch from
479- <tal:is-web-url condition="view/svn_url_is_web">
480- <a tal:attributes="href code_import/svn_branch_url"
481- tal:content="code_import/svn_branch_url" />.
482- </tal:is-web-url>
483- <tal:not-web-url condition="not: view/svn_url_is_web">
484+ <tal:svn-import condition="view/is_svn_import">
485+ <p id="svn-import-details">
486+ This branch is an import of the
487+ <span tal:attributes="title code_import/rcs_type/title">Subversion</span>
488+ branch from
489+ <tal:is-web-url condition="view/svn_url_is_web">
490+ <a tal:attributes="href code_import/svn_branch_url"
491+ tal:content="code_import/svn_branch_url" />.
492+ </tal:is-web-url>
493+ <tal:not-web-url condition="not: view/svn_url_is_web">
494 <span tal:replace="code_import/svn_branch_url" />.
495- </tal:not-web-url>
496+ </tal:not-web-url>
497 </p>
498 </tal:svn-import>
499
500
501=== modified file 'lib/lp/code/templates/codeimport-new.pt'
502--- lib/lp/code/templates/codeimport-new.pt 2009-09-18 03:00:45 +0000
503+++ lib/lp/code/templates/codeimport-new.pt 2009-12-08 19:25:27 +0000
504@@ -112,7 +112,7 @@
505 updateField(form['field.cvs_root'], rcs_type == 'CVS');
506 updateField(form['field.cvs_module'], rcs_type == 'CVS');
507 // SVN
508- updateField(form['field.svn_branch_url'], rcs_type == 'SVN');
509+ updateField(form['field.svn_branch_url'], rcs_type == 'BZR_SVN');
510 }
511 registerLaunchpadFunction(updateWidgets);
512 //]]>

Subscribers

People subscribed via source and target branches

to status/vote changes: