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
=== modified file 'lib/lp/code/browser/branch.py'
--- lib/lp/code/browser/branch.py 2009-12-07 02:57:22 +0000
+++ lib/lp/code/browser/branch.py 2009-12-08 19:25:27 +0000
@@ -79,7 +79,8 @@
79from lp.code.browser.branchmergeproposal import (79from lp.code.browser.branchmergeproposal import (
80 latest_proposals_for_each_branch)80 latest_proposals_for_each_branch)
81from lp.code.enums import (81from lp.code.enums import (
82 BranchLifecycleStatus, BranchType, UICreatableBranchType)82 BranchLifecycleStatus, BranchType, RevisionControlSystems,
83 UICreatableBranchType)
83from lp.code.errors import InvalidBranchMergeProposal84from lp.code.errors import InvalidBranchMergeProposal
84from lp.code.interfaces.branch import (85from lp.code.interfaces.branch import (
85 BranchCreationForbidden, BranchExists, IBranch,86 BranchCreationForbidden, BranchExists, IBranch,
@@ -501,6 +502,14 @@
501 return list(self.context.code_import.results[:10])502 return list(self.context.code_import.results[:10])
502503
503 @property504 @property
505 def is_svn_import(self):
506 """True if an imported branch is a SVN import."""
507 # You should only be calling this if it's a code import
508 assert self.context.code_import
509 return self.context.code_import.rcs_type in \
510 (RevisionControlSystems.SVN, RevisionControlSystems.BZR_SVN)
511
512 @property
504 def svn_url_is_web(self):513 def svn_url_is_web(self):
505 """True if an imported branch's SVN URL is HTTP or HTTPS."""514 """True if an imported branch's SVN URL is HTTP or HTTPS."""
506 # You should only be calling this if it's an SVN code import515 # You should only be calling this if it's an SVN code import
@@ -849,7 +858,6 @@
849 The keys are 'delete' and 'alter'; the values are dicts of858 The keys are 'delete' and 'alter'; the values are dicts of
850 'item', 'reason' and 'allowed'.859 'item', 'reason' and 'allowed'.
851 """860 """
852 branch = self.context
853 row_dict = {'delete': [], 'alter': [], 'break_link': []}861 row_dict = {'delete': [], 'alter': [], 'break_link': []}
854 for item, action, reason, allowed in (862 for item, action, reason, allowed in (
855 self.display_deletion_requirements):863 self.display_deletion_requirements):
856864
=== modified file 'lib/lp/code/browser/codeimport.py'
--- lib/lp/code/browser/codeimport.py 2009-08-24 20:28:33 +0000
+++ lib/lp/code/browser/codeimport.py 2009-12-08 19:25:27 +0000
@@ -227,7 +227,7 @@
227 custom_widget('rcs_type', LaunchpadRadioWidget)227 custom_widget('rcs_type', LaunchpadRadioWidget)
228228
229 initial_values = {229 initial_values = {
230 'rcs_type': RevisionControlSystems.SVN,230 'rcs_type': RevisionControlSystems.BZR_SVN,
231 'branch_name': 'trunk',231 'branch_name': 'trunk',
232 }232 }
233233
@@ -258,7 +258,7 @@
258 fields = soup.findAll('input')258 fields = soup.findAll('input')
259 [cvs_button, svn_button, git_button, empty_marker] = [259 [cvs_button, svn_button, git_button, empty_marker] = [
260 field for field in fields260 field for field in fields
261 if field.get('value') in ['CVS', 'SVN', 'GIT', '1']]261 if field.get('value') in ['CVS', 'BZR_SVN', 'GIT', '1']]
262 cvs_button['onclick'] = 'updateWidgets()'262 cvs_button['onclick'] = 'updateWidgets()'
263 svn_button['onclick'] = 'updateWidgets()'263 svn_button['onclick'] = 'updateWidgets()'
264 git_button['onclick'] = 'updateWidgets()'264 git_button['onclick'] = 'updateWidgets()'
@@ -360,7 +360,7 @@
360 data['svn_branch_url'] = None360 data['svn_branch_url'] = None
361 data['git_repo_url'] = None361 data['git_repo_url'] = None
362 self._validateCVS(data.get('cvs_root'), data.get('cvs_module'))362 self._validateCVS(data.get('cvs_root'), data.get('cvs_module'))
363 elif rcs_type == RevisionControlSystems.SVN:363 elif rcs_type == RevisionControlSystems.BZR_SVN:
364 data['cvs_root'] = None364 data['cvs_root'] = None
365 data['cvs_module'] = None365 data['cvs_module'] = None
366 data['git_repo_url'] = None366 data['git_repo_url'] = None
@@ -371,7 +371,8 @@
371 data['svn_branch_url'] = None371 data['svn_branch_url'] = None
372 self._validateGit(data.get('git_repo_url'))372 self._validateGit(data.get('git_repo_url'))
373 else:373 else:
374 raise AssertionError('Unknown revision control type.')374 raise AssertionError(
375 'Unexpected revision control type %r.' % rcs_type)
375376
376377
377class EditCodeImportForm(Interface):378class EditCodeImportForm(Interface):
@@ -458,7 +459,8 @@
458 if self.code_import.rcs_type == RevisionControlSystems.CVS:459 if self.code_import.rcs_type == RevisionControlSystems.CVS:
459 self.form_fields = self.form_fields.omit(460 self.form_fields = self.form_fields.omit(
460 'svn_branch_url', 'git_repo_url')461 'svn_branch_url', 'git_repo_url')
461 elif self.code_import.rcs_type == RevisionControlSystems.SVN:462 elif self.code_import.rcs_type in (RevisionControlSystems.SVN,
463 RevisionControlSystems.BZR_SVN):
462 self.form_fields = self.form_fields.omit(464 self.form_fields = self.form_fields.omit(
463 'cvs_root', 'cvs_module', 'git_repo_url')465 'cvs_root', 'cvs_module', 'git_repo_url')
464 elif self.code_import.rcs_type == RevisionControlSystems.GIT:466 elif self.code_import.rcs_type == RevisionControlSystems.GIT:
@@ -493,7 +495,8 @@
493 self._validateCVS(495 self._validateCVS(
494 data.get('cvs_root'), data.get('cvs_module'),496 data.get('cvs_root'), data.get('cvs_module'),
495 self.code_import)497 self.code_import)
496 elif self.code_import.rcs_type == RevisionControlSystems.SVN:498 elif self.code_import.rcs_type in (RevisionControlSystems.SVN,
499 RevisionControlSystems.BZR_SVN):
497 self._validateSVN(500 self._validateSVN(
498 data.get('svn_branch_url'), self.code_import)501 data.get('svn_branch_url'), self.code_import)
499 elif self.code_import.rcs_type == RevisionControlSystems.GIT:502 elif self.code_import.rcs_type == RevisionControlSystems.GIT:
500503
=== 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 19:25:27 +0000
@@ -0,0 +1,60 @@
1# Copyright 2009 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4"""Tests for the code import browser code."""
5
6__metaclass__ = type
7
8import re
9import unittest
10
11from canonical.launchpad.testing.pages import extract_text, find_tag_by_id
12from canonical.launchpad.webapp import canonical_url
13from canonical.testing.layers import DatabaseFunctionalLayer
14
15from lp.code.enums import RevisionControlSystems
16from lp.testing import TestCaseWithFactory
17
18
19class TestImportDetails(TestCaseWithFactory):
20
21 layer = DatabaseFunctionalLayer
22
23 def assertSvnDetailsDisplayed(self, svn_details, rcs_type):
24 """Assert the `svn_details` tag describes a Subversion import.
25
26 :param svn_details: The BeautifulSoup object for the
27 'svn-import-details' area.
28 :param rcs_type: SVN or BZR_SVN from RevisionControlSystems.
29 """
30 self.assertEquals(rcs_type.title, svn_details.span['title'])
31 text = re.sub('\s+', ' ', extract_text(svn_details))
32 self.assertTrue(
33 text.startswith(
34 'This branch is an import of the Subversion branch'))
35
36 def test_bzr_svn_import(self):
37 # The branch page for a bzr-svn-imported branch contains
38 # a summary of the import details.
39 bzr_svn_import = self.factory.makeCodeImport(
40 rcs_type=RevisionControlSystems.BZR_SVN)
41 browser = self.getUserBrowser(canonical_url(bzr_svn_import.branch))
42 svn_details = find_tag_by_id(browser.contents, 'svn-import-details')
43 self.assertSvnDetailsDisplayed(
44 svn_details, RevisionControlSystems.BZR_SVN)
45
46 def test_cscvs_svn_import(self):
47 # The branch page for a cscvs-imported svn branch contains a summary
48 # of the import details.
49 bzr_svn_import = self.factory.makeCodeImport(
50 rcs_type=RevisionControlSystems.SVN)
51 browser = self.getUserBrowser(canonical_url(bzr_svn_import.branch))
52 svn_details = find_tag_by_id(browser.contents, 'svn-import-details')
53 self.assertSvnDetailsDisplayed(
54 svn_details, RevisionControlSystems.SVN)
55
56
57
58def test_suite():
59 return unittest.TestLoader().loadTestsFromName(__name__)
60
061
=== modified file 'lib/lp/code/doc/codeimport.txt'
--- lib/lp/code/doc/codeimport.txt 2009-12-06 20:28:49 +0000
+++ lib/lp/code/doc/codeimport.txt 2009-12-08 19:25:27 +0000
@@ -56,7 +56,7 @@
56 >>> for item in RevisionControlSystems:56 >>> for item in RevisionControlSystems:
57 ... print item.title57 ... print item.title
58 Concurrent Versions System58 Concurrent Versions System
59 Subversion59 Subversion via CSCVS
60 Subversion via bzr-svn60 Subversion via bzr-svn
61 Git61 Git
6262
6363
=== modified file 'lib/lp/code/enums.py'
--- lib/lp/code/enums.py 2009-07-17 00:26:05 +0000
+++ lib/lp/code/enums.py 2009-12-08 19:25:27 +0000
@@ -388,7 +388,7 @@
388 """)388 """)
389389
390 SVN = DBItem(2, """390 SVN = DBItem(2, """
391 Subversion391 Subversion via CSCVS
392392
393 Imports from SVN using CSCVS.393 Imports from SVN using CSCVS.
394 """)394 """)
395395
=== modified file 'lib/lp/code/model/tests/test_codeimport.py'
--- lib/lp/code/model/tests/test_codeimport.py 2009-09-01 04:05:11 +0000
+++ lib/lp/code/model/tests/test_codeimport.py 2009-12-08 19:25:27 +0000
@@ -534,7 +534,7 @@
534def make_active_import(factory, project_name=None, product_name=None,534def make_active_import(factory, project_name=None, product_name=None,
535 branch_name=None, svn_branch_url=None,535 branch_name=None, svn_branch_url=None,
536 cvs_root=None, cvs_module=None, git_repo_url=None,536 cvs_root=None, cvs_module=None, git_repo_url=None,
537 last_update=None):537 last_update=None, rcs_type=None):
538 """Make a new CodeImport for a new Product, maybe in a new Project.538 """Make a new CodeImport for a new Product, maybe in a new Project.
539539
540 The import will be 'active' in the sense used by540 The import will be 'active' in the sense used by
@@ -549,7 +549,7 @@
549 code_import = factory.makeCodeImport(549 code_import = factory.makeCodeImport(
550 product=product, branch_name=branch_name,550 product=product, branch_name=branch_name,
551 svn_branch_url=svn_branch_url, cvs_root=cvs_root,551 svn_branch_url=svn_branch_url, cvs_root=cvs_root,
552 cvs_module=cvs_module, git_repo_url=git_repo_url)552 cvs_module=cvs_module, git_repo_url=git_repo_url, rcs_type=None)
553 make_import_active(factory, code_import, last_update)553 make_import_active(factory, code_import, last_update)
554 return code_import554 return code_import
555555
556556
=== modified file 'lib/lp/code/stories/codeimport/xx-admin-codeimport.txt'
--- lib/lp/code/stories/codeimport/xx-admin-codeimport.txt 2009-11-13 10:43:32 +0000
+++ lib/lp/code/stories/codeimport/xx-admin-codeimport.txt 2009-12-08 19:25:27 +0000
@@ -1,11 +1,13 @@
1= Administrating code imports =1Administrating code imports
2===========================
23
3The code import details are displayed on the main branch page for4The code import details are displayed on the main branch page for
4imported branches. If the logged in user is an import operator5imported branches. If the logged in user is an import operator
5(member of VCS imports or Launchpad admin) then they can see a link6(member of VCS imports or Launchpad admin) then they can see a link
6to edit the details.7to edit the details.
78
8 >>> from canonical.launchpad.ftests import ANONYMOUS, login, logout9 >>> from lp.code.enums import RevisionControlSystems
10 >>> from lp.testing import ANONYMOUS, login, logout
9 >>> login('test@canonical.com')11 >>> login('test@canonical.com')
1012
11 >>> svn_import = factory.makeCodeImport(13 >>> svn_import = factory.makeCodeImport(
@@ -14,6 +16,12 @@
14 >>> svn_import_location = str(canonical_url(svn_import.branch))16 >>> svn_import_location = str(canonical_url(svn_import.branch))
15 >>> svn_import_branch_unique_name = svn_import.branch.unique_name17 >>> svn_import_branch_unique_name = svn_import.branch.unique_name
1618
19 >>> bzr_svn_import = factory.makeCodeImport(
20 ... svn_branch_url='svn://svn.example.com/bzr-svn/trunk',
21 ... rcs_type=RevisionControlSystems.BZR_SVN)
22 >>> bzr_svn_import_location = str(canonical_url(bzr_svn_import.branch))
23 >>> bzr_svn_import_branch_unique_name = bzr_svn_import.branch.unique_name
24
17 >>> cvs_import = factory.makeCodeImport(25 >>> cvs_import = factory.makeCodeImport(
18 ... cvs_root=":pserver:anonymous@cvs.example.com:/fooix",26 ... cvs_root=":pserver:anonymous@cvs.example.com:/fooix",
19 ... cvs_module="fooix")27 ... cvs_module="fooix")
@@ -30,7 +38,8 @@
30 ... auth='Basic david.allouche@canonical.com:test')38 ... auth='Basic david.allouche@canonical.com:test')
3139
3240
33== Editing the import ==41Editing the import
42------------------
3443
35Both VCS Imports members and Launchpad administrators can edit the44Both VCS Imports members and Launchpad administrators can edit the
36import:45import:
@@ -46,7 +55,8 @@
46 from svn://svn.example.com/fooix/trunk.55 from svn://svn.example.com/fooix/trunk.
4756
4857
49== Editing details ==58Editing details
59---------------
5060
51There are a number of buttons shown on the editing page for61There are a number of buttons shown on the editing page for
52import operators.62import operators.
@@ -87,7 +97,8 @@
87 >>> print_form_fields(import_browser)97 >>> print_form_fields(import_browser)
88 field.git_repo_url: git://git.example.org/fooix98 field.git_repo_url: git://git.example.org/fooix
8999
90=== Editing the import location ===100Editing the import location
101+++++++++++++++++++++++++++
91102
92The +edit-import page allows the import operator to edit the location103The +edit-import page allows the import operator to edit the location
93an import is from.104an import is from.
@@ -102,6 +113,16 @@
102 ... print extract_text(message)113 ... print extract_text(message)
103 The code import has been updated.114 The code import has been updated.
104115
116bzr-svn imports,
117
118 >>> import_browser.open(bzr_svn_import_location + '/+edit-import')
119 >>> import_browser.getControl('Branch URL').value = \
120 ... 'svn://svn-new.example.com/bzr-svn/trunk'
121 >>> import_browser.getControl('Update').click()
122 >>> for message in get_feedback_messages(import_browser.contents):
123 ... print extract_text(message)
124 The code import has been updated.
125
105CVS imports,126CVS imports,
106127
107 >>> import_browser.open(cvs_import_location + '/+edit-import')128 >>> import_browser.open(cvs_import_location + '/+edit-import')
@@ -125,7 +146,8 @@
125 The code import has been updated.146 The code import has been updated.
126147
127148
128=== Approving an import ===149Approving an import
150+++++++++++++++++++
129151
130When a code import is approved, a pending job is created for it.152When a code import is approved, a pending job is created for it.
131153
@@ -141,7 +163,8 @@
141 The code import has been approved.163 The code import has been approved.
142164
143165
144=== Invalidating an import ===166Invalidating an import
167++++++++++++++++++++++
145168
146 >>> import_browser.getLink('Edit import source or review import').click()169 >>> import_browser.getLink('Edit import source or review import').click()
147 >>> import_browser.getControl('Mark Invalid').click()170 >>> import_browser.getControl('Mark Invalid').click()
@@ -153,7 +176,8 @@
153 The code import has been set as invalid.176 The code import has been set as invalid.
154177
155178
156=== Suspending an import ===179Suspending an import
180++++++++++++++++++++
157181
158 >>> import_browser.getLink('Edit import source or review import').click()182 >>> import_browser.getLink('Edit import source or review import').click()
159 >>> import_browser.getControl('Suspend').click()183 >>> import_browser.getControl('Suspend').click()
@@ -165,7 +189,8 @@
165 The code import has been suspended.189 The code import has been suspended.
166190
167191
168=== Marking an import as failing ===192Marking an import as failing
193++++++++++++++++++++++++++++
169194
170 >>> import_browser.getLink('Edit import source or review import').click()195 >>> import_browser.getLink('Edit import source or review import').click()
171 >>> import_browser.getControl('Mark Failing').click()196 >>> import_browser.getControl('Mark Failing').click()
@@ -177,7 +202,8 @@
177 The code import has been marked as failing.202 The code import has been marked as failing.
178203
179204
180== Import details for a running job ==205Import details for a running job
206--------------------------------
181207
182If the job for an approved import is running, then the import details208If the job for an approved import is running, then the import details
183says how long ago since it started.209says how long ago since it started.
@@ -218,7 +244,8 @@
218 Changeset 2244 Changeset 2
219245
220246
221== Import details for a import that has been imported successfully ==247Import details for a import that has been imported successfully
248---------------------------------------------------------------
222249
223If a branch has been successfully imported in the past, then the date250If a branch has been successfully imported in the past, then the date
224that it was last successful is shown, as well as when the next import251that it was last successful is shown, as well as when the next import
@@ -245,7 +272,8 @@
245 ...272 ...
246273
247274
248== Requesting an import ==275Requesting an import
276--------------------
249277
250If an import is waiting for its next update, any logged in user can278If an import is waiting for its next update, any logged in user can
251click a button to request an immediate import.279click a button to request an immediate import.
252280
=== modified file 'lib/lp/code/stories/codeimport/xx-codeimport-list.txt'
--- lib/lp/code/stories/codeimport/xx-codeimport-list.txt 2009-06-15 21:05:06 +0000
+++ lib/lp/code/stories/codeimport/xx-codeimport-list.txt 2009-12-08 19:25:27 +0000
@@ -8,7 +8,7 @@
8 >>> import pytz8 >>> import pytz
9 >>> from lp.codehosting.codeimport.tests.test_workermonitor import (9 >>> from lp.codehosting.codeimport.tests.test_workermonitor import (
10 ... nuke_codeimport_sample_data)10 ... nuke_codeimport_sample_data)
11 >>> from canonical.database.sqlbase import flush_database_updates11 >>> from lp.code.enums import RevisionControlSystems
12 >>> from lp.code.model.tests.test_codeimport import (12 >>> from lp.code.model.tests.test_codeimport import (
13 ... make_active_import)13 ... make_active_import)
14 >>> from lp.code.interfaces.codeimport import ICodeImportSet14 >>> from lp.code.interfaces.codeimport import ICodeImportSet
@@ -21,23 +21,27 @@
21 ... factory, product_name="myproject", branch_name="trunk",21 ... factory, product_name="myproject", branch_name="trunk",
22 ... svn_branch_url="http://example.com/svn/myproject/trunk",22 ... svn_branch_url="http://example.com/svn/myproject/trunk",
23 ... last_update=datetime.datetime(2007, 1, 1, tzinfo=pytz.UTC))23 ... last_update=datetime.datetime(2007, 1, 1, tzinfo=pytz.UTC))
24 >>> active_bzr_svn_import = make_active_import(
25 ... factory, product_name="ourproject", branch_name="trunk",
26 ... svn_branch_url="http://example.com/bzr-svn/myproject/trunk",
27 ... rcs_type=RevisionControlSystems.BZR_SVN,
28 ... last_update=datetime.datetime(2007, 1, 2, tzinfo=pytz.UTC))
24 >>> active_cvs_import = make_active_import(29 >>> active_cvs_import = make_active_import(
25 ... factory, product_name="hisproj", branch_name="main",30 ... factory, product_name="hisproj", branch_name="main",
26 ... cvs_root=":pserver:anon@example.com:/cvs", cvs_module="hisproj",31 ... cvs_root=":pserver:anon@example.com:/cvs", cvs_module="hisproj",
27 ... last_update=datetime.datetime(2007, 1, 2, tzinfo=pytz.UTC))32 ... last_update=datetime.datetime(2007, 1, 3, tzinfo=pytz.UTC))
28 >>> active_git_import = make_active_import(33 >>> active_git_import = make_active_import(
29 ... factory, product_name="herproj", branch_name="master",34 ... factory, product_name="herproj", branch_name="master",
30 ... git_repo_url="git://git.example.org/herproj",35 ... git_repo_url="git://git.example.org/herproj",
31 ... last_update=datetime.datetime(2007, 1, 3, tzinfo=pytz.UTC))36 ... last_update=datetime.datetime(2007, 1, 4, tzinfo=pytz.UTC))
32 >>> flush_database_updates()
33 >>> len(list(code_import_set.getActiveImports()))37 >>> len(list(code_import_set.getActiveImports()))
34 338 4
35 >>> logout()39 >>> logout()
3640
37The page is linked to from the "$N imported branches" text.41The page is linked to from the "$N imported branches" text.
3842
39 >>> browser.open('http://code.launchpad.dev')43 >>> browser.open('http://code.launchpad.dev')
40 >>> browser.getLink('3 imported branches').click()44 >>> browser.getLink('4 imported branches').click()
41 >>> print browser.title45 >>> print browser.title
42 Available code imports46 Available code imports
4347
@@ -48,10 +52,11 @@
48 ... print extract_text(table)52 ... print extract_text(table)
4953
50 >>> print_import_table()54 >>> print_import_table()
51 Project Branch Name Source Details Last Updated55 Project Branch Name Source Details Last Updated
52 herproj master git://git.example.org/herproj 2007-01-0356 herproj master git://git.example.org/herproj 2007-01-04
53 hisproj main :pserver:anon@example.com:/cvs hisproj 2007-01-0257 hisproj main :pserver:anon@example.com:/cvs hisproj 2007-01-03
54 myproject trunk http://example.com/svn/myproject/trunk 2007-01-0158 myproject trunk http://example.com/svn/myproject/trunk 2007-01-01
59 ourproject trunk http://example.com/bzr-svn/myproject/trunk 2007-01-02
5560
56You can filter the list by product:61You can filter the list by product:
5762
@@ -59,4 +64,4 @@
59 >>> browser.getControl('Search', index=0).click()64 >>> browser.getControl('Search', index=0).click()
60 >>> print_import_table()65 >>> print_import_table()
61 Project Branch Name Source Details Last Updated66 Project Branch Name Source Details Last Updated
62 hisproj main :pserver:anon@example.com:/cvs hisproj 2007-01-0267 hisproj main :pserver:anon@example.com:/cvs hisproj 2007-01-03
6368
=== modified file 'lib/lp/code/stories/codeimport/xx-codeimport-view.txt'
--- lib/lp/code/stories/codeimport/xx-codeimport-view.txt 2009-08-18 00:44:31 +0000
+++ lib/lp/code/stories/codeimport/xx-codeimport-view.txt 2009-12-08 19:25:27 +0000
@@ -1,4 +1,5 @@
1= Code imports =1Code imports
2============
23
3For now, there is no link to the page that lists all code imports, so4For now, there is no link to the page that lists all code imports, so
4we browse there directly:5we browse there directly:
@@ -31,7 +32,8 @@
31 'http://code.launchpad.dev/~vcs-imports/gnome-terminal/import'32 'http://code.launchpad.dev/~vcs-imports/gnome-terminal/import'
3233
3334
34= Filtering the code import list =35Filtering the code import list
36==============================
3537
36The code import listing is filterable, though only on review status so38The code import listing is filterable, though only on review status so
37far. There are no invalid imports in the sample data, so if we filter39far. There are no invalid imports in the sample data, so if we filter
3840
=== modified file 'lib/lp/code/stories/codeimport/xx-create-codeimport.txt'
--- lib/lp/code/stories/codeimport/xx-create-codeimport.txt 2009-11-05 11:06:27 +0000
+++ lib/lp/code/stories/codeimport/xx-create-codeimport.txt 2009-12-08 19:25:27 +0000
@@ -54,6 +54,14 @@
54 <Link text='http://svn.example.com/firefox/trunk'54 <Link text='http://svn.example.com/firefox/trunk'
55 url='http://svn.example.com/firefox/trunk'>55 url='http://svn.example.com/firefox/trunk'>
5656
57The fact that this is an import via bzr-svn is indicated in a 'title'
58attribute on the text of 'Subversion'.
59
60 >>> svn_span = find_tag_by_id(browser.contents, 'svn-import-details').span
61 >>> print extract_text(svn_span)
62 Subversion
63 >>> print svn_span['title']
64 Subversion via bzr-svn
5765
58Requesting a Git import66Requesting a Git import
59=======================67=======================
6068
=== modified file 'lib/lp/code/templates/branch-import-details.pt'
--- lib/lp/code/templates/branch-import-details.pt 2009-12-03 18:33:22 +0000
+++ lib/lp/code/templates/branch-import-details.pt 2009-12-08 19:25:27 +0000
@@ -45,15 +45,18 @@
45 </p>45 </p>
46 </tal:git-import>46 </tal:git-import>
4747
48 <tal:svn-import condition="code_import/rcs_type/enumvalue:SVN">48 <tal:svn-import condition="view/is_svn_import">
49 <p>This branch is an import of the Subversion branch from49 <p id="svn-import-details">
50 <tal:is-web-url condition="view/svn_url_is_web">50 This branch is an import of the
51 <a tal:attributes="href code_import/svn_branch_url"51 <span tal:attributes="title code_import/rcs_type/title">Subversion</span>
52 tal:content="code_import/svn_branch_url" />.52 branch from
53 </tal:is-web-url>53 <tal:is-web-url condition="view/svn_url_is_web">
54 <tal:not-web-url condition="not: view/svn_url_is_web">54 <a tal:attributes="href code_import/svn_branch_url"
55 tal:content="code_import/svn_branch_url" />.
56 </tal:is-web-url>
57 <tal:not-web-url condition="not: view/svn_url_is_web">
55 <span tal:replace="code_import/svn_branch_url" />.58 <span tal:replace="code_import/svn_branch_url" />.
56 </tal:not-web-url>59 </tal:not-web-url>
57 </p>60 </p>
58 </tal:svn-import>61 </tal:svn-import>
5962
6063
=== modified file 'lib/lp/code/templates/codeimport-new.pt'
--- lib/lp/code/templates/codeimport-new.pt 2009-09-18 03:00:45 +0000
+++ lib/lp/code/templates/codeimport-new.pt 2009-12-08 19:25:27 +0000
@@ -112,7 +112,7 @@
112 updateField(form['field.cvs_root'], rcs_type == 'CVS');112 updateField(form['field.cvs_root'], rcs_type == 'CVS');
113 updateField(form['field.cvs_module'], rcs_type == 'CVS');113 updateField(form['field.cvs_module'], rcs_type == 'CVS');
114 // SVN114 // SVN
115 updateField(form['field.svn_branch_url'], rcs_type == 'SVN');115 updateField(form['field.svn_branch_url'], rcs_type == 'BZR_SVN');
116 }116 }
117 registerLaunchpadFunction(updateWidgets);117 registerLaunchpadFunction(updateWidgets);
118 //]]>118 //]]>

Subscribers

People subscribed via source and target branches

to status/vote changes: