launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #16457
[Merge] lp:~wgrant/launchpad/no-cscvs-svn into lp:launchpad
William Grant has proposed merging lp:~wgrant/launchpad/no-cscvs-svn into lp:launchpad.
Commit message:
Remove support for long-deprecated CSCVS Subversion imports.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #1283955 in Launchpad itself: "CSCVS Subversion imports are dead code"
https://bugs.launchpad.net/launchpad/+bug/1283955
For more details, see:
https://code.launchpad.net/~wgrant/launchpad/no-cscvs-svn/+merge/207873
bzr-svn replaced CSCVS for new Subversion imports years ago, and all remaining cscvs svn imports have been suspended for several weeks. We should remove the unused code.
This branch leaves them in basically the same state as bzr-hg imports: the enum value still exists, and there's one bit of code left to tell the model that this type of import has a URL. But that's it.
--
https://code.launchpad.net/~wgrant/launchpad/no-cscvs-svn/+merge/207873
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/no-cscvs-svn into lp:launchpad.
=== modified file 'lib/lp/code/browser/branch.py'
--- lib/lp/code/browser/branch.py 2013-11-14 05:06:18 +0000
+++ lib/lp/code/browser/branch.py 2014-02-24 07:35:22 +0000
@@ -651,14 +651,6 @@
return "/@@/no"
@property
- def is_svn_import(self):
- """True if an imported branch is a SVN import."""
- # You should only be calling this if it's a code import
- assert self.context.code_import
- return self.context.code_import.rcs_type in \
- (RevisionControlSystems.SVN, RevisionControlSystems.BZR_SVN)
-
- @property
def url_is_web(self):
"""True if an imported branch's URL is HTTP or HTTPS."""
# You should only be calling this if it's an SVN, BZR or GIT code
=== modified file 'lib/lp/code/browser/tests/test_codeimport.py'
--- lib/lp/code/browser/tests/test_codeimport.py 2012-10-02 23:32:57 +0000
+++ lib/lp/code/browser/tests/test_codeimport.py 2014-02-24 07:35:22 +0000
@@ -50,16 +50,6 @@
self.assertSvnDetailsDisplayed(
svn_details, RevisionControlSystems.BZR_SVN)
- def test_cscvs_svn_import(self):
- # The branch page for a cscvs-imported svn branch contains a summary
- # of the import details.
- bzr_svn_import = self.factory.makeCodeImport(
- rcs_type=RevisionControlSystems.SVN)
- browser = self.getUserBrowser(canonical_url(bzr_svn_import.branch))
- svn_details = find_tag_by_id(browser.contents, 'svn-import-details')
- self.assertSvnDetailsDisplayed(
- svn_details, RevisionControlSystems.SVN)
-
def test_branch_owner_of_import_forbidden(self):
# Unauthorized users are forbidden to edit an import.
cimport = self.factory.makeCodeImport()
=== modified file 'lib/lp/code/doc/codeimport.txt'
--- lib/lp/code/doc/codeimport.txt 2012-12-26 01:32:19 +0000
+++ lib/lp/code/doc/codeimport.txt 2014-02-24 07:35:22 +0000
@@ -131,7 +131,7 @@
Code imports from Subversion specify the URL used with "svn checkout" to
retrieve the tree to import.
- >>> svn = RevisionControlSystems.SVN
+ >>> svn = RevisionControlSystems.BZR_SVN
>>> svn_url = 'svn://svn.example.com/trunk'
>>> svn_import = code_import_set.new(
... registrant=nopriv, target=target, branch_name='trunk-svn',
@@ -153,29 +153,6 @@
True
-Import from Subversion via bzr-svn
-++++++++++++++++++++++++++++++++++
-
-Code imports from Subversion can also specify that they should be
-imported with 'bzr-svn' rather than cscvs. In most respects these
-imports are similar to the Subversion via cscvs imports.
-
- >>> bzr_svn = RevisionControlSystems.BZR_SVN
- >>> bzr_svn_url = 'svn://svn.example.com/for-bzr-svn/trunk'
- >>> bzr_svn_import = code_import_set.new(
- ... registrant=nopriv, target=target, branch_name='trunk-bzr-svn',
- ... rcs_type=bzr_svn, url=bzr_svn_url)
- >>> verifyObject(ICodeImport, removeSecurityProxy(svn_import))
- True
-
-The CodeImportSet.getBySVNDetails is also able to find bzr-svn
-imports.
-
- >>> existing_bzr_svn_import = code_import_set.getByURL(bzr_svn_url)
- >>> bzr_svn_import == existing_bzr_svn_import
- True
-
-
Import from Git
+++++++++++++++
@@ -338,8 +315,6 @@
datetime.timedelta(0, 21600)
>>> svn_import.effective_update_interval
datetime.timedelta(0, 21600)
- >>> bzr_svn_import.effective_update_interval
- datetime.timedelta(0, 21600)
>>> default_interval_git
datetime.timedelta(0, 21600)
@@ -514,13 +489,13 @@
Imports via bzr-svn are also similar.
>>> data = {'url': 'http://svn.example.com/for-bzr-svn/trunk'}
- >>> modify_event = bzr_svn_import.updateFromData(data, nopriv)
+ >>> modify_event = svn_import.updateFromData(data, nopriv)
>>> print make_email_body_for_code_import_update(
- ... bzr_svn_import, modify_event, None)
- ~import-person/widget/trunk-bzr-svn is now being imported from:
+ ... svn_import, modify_event, None)
+ ~import-person/widget/trunk-svn is now being imported from:
http://svn.example.com/for-bzr-svn/trunk
instead of:
- svn://svn.example.com/for-bzr-svn/trunk
+ svn://svn.example.com/branch/1.0
In addition, updateFromData can be used to set the branch whiteboard,
which is also described in the email that is sent.
=== modified file 'lib/lp/code/enums.py'
--- lib/lp/code/enums.py 2012-11-07 05:06:18 +0000
+++ lib/lp/code/enums.py 2014-02-24 07:35:22 +0000
@@ -859,5 +859,5 @@
""")
NON_CVS_RCS_TYPES = (
- RevisionControlSystems.SVN, RevisionControlSystems.BZR_SVN,
- RevisionControlSystems.GIT, RevisionControlSystems.BZR)
+ RevisionControlSystems.BZR_SVN, RevisionControlSystems.GIT,
+ RevisionControlSystems.BZR)
=== modified file 'lib/lp/code/mail/codeimport.py'
--- lib/lp/code/mail/codeimport.py 2013-04-09 09:47:58 +0000
+++ lib/lp/code/mail/codeimport.py 2014-02-24 07:35:22 +0000
@@ -47,7 +47,6 @@
location = code_import.url
rcs_type_map = {
RevisionControlSystems.CVS: 'CVS',
- RevisionControlSystems.SVN: 'subversion',
RevisionControlSystems.BZR_SVN: 'subversion',
RevisionControlSystems.GIT: 'git',
RevisionControlSystems.BZR: 'bazaar',
@@ -120,8 +119,7 @@
body.append(
details_change_prefix + '\n' + new_details +
"\ninstead of:\n" + old_details)
- elif code_import.rcs_type in (RevisionControlSystems.SVN,
- RevisionControlSystems.BZR_SVN,
+ elif code_import.rcs_type in (RevisionControlSystems.BZR_SVN,
RevisionControlSystems.GIT,
RevisionControlSystems.BZR):
if CodeImportEventDataType.OLD_URL in event_data:
=== modified file 'lib/lp/code/model/codeimport.py'
--- lib/lp/code/model/codeimport.py 2013-06-20 05:50:00 +0000
+++ lib/lp/code/model/codeimport.py 2014-02-24 07:35:22 +0000
@@ -106,8 +106,6 @@
default_interval_dict = {
RevisionControlSystems.CVS:
config.codeimport.default_interval_cvs,
- RevisionControlSystems.SVN:
- config.codeimport.default_interval_subversion,
RevisionControlSystems.BZR_SVN:
config.codeimport.default_interval_subversion,
RevisionControlSystems.GIT:
=== modified file 'lib/lp/code/model/codeimportevent.py'
--- lib/lp/code/model/codeimportevent.py 2013-01-07 02:40:55 +0000
+++ lib/lp/code/model/codeimportevent.py 2014-02-24 07:35:22 +0000
@@ -267,8 +267,7 @@
def _iterSourceDetails(self, code_import):
"""Yield key-value tuples describing the source of the import."""
- if code_import.rcs_type in (RevisionControlSystems.SVN,
- RevisionControlSystems.BZR_SVN,
+ if code_import.rcs_type in (RevisionControlSystems.BZR_SVN,
RevisionControlSystems.GIT,
RevisionControlSystems.BZR):
yield 'URL', code_import.url
=== modified file 'lib/lp/code/model/tests/test_codeimport.py'
--- lib/lp/code/model/tests/test_codeimport.py 2012-09-06 21:15:31 +0000
+++ lib/lp/code/model/tests/test_codeimport.py 2014-02-24 07:35:22 +0000
@@ -62,7 +62,7 @@
registrant=self.factory.makePerson(),
target=IBranchTarget(self.factory.makeProduct()),
branch_name='imported',
- rcs_type=RevisionControlSystems.SVN,
+ rcs_type=RevisionControlSystems.BZR_SVN,
url=self.factory.getUniqueURL(scheme="svn"))
self.assertEqual(
CodeImportReviewStatus.REVIEWED,
@@ -76,7 +76,7 @@
registrant=self.factory.makePerson(),
target=IBranchTarget(self.factory.makeProduct()),
branch_name='imported',
- rcs_type=RevisionControlSystems.SVN,
+ rcs_type=RevisionControlSystems.BZR_SVN,
url=self.factory.getUniqueURL(),
review_status=None)
self.assertEqual(
=== modified file 'lib/lp/code/templates/branch-import-details.pt'
--- lib/lp/code/templates/branch-import-details.pt 2012-09-06 09:25:47 +0000
+++ lib/lp/code/templates/branch-import-details.pt 2014-02-24 07:35:22 +0000
@@ -62,7 +62,7 @@
</p>
</tal:bzr-import>
- <tal:svn-import condition="view/is_svn_import">
+ <tal:svn-import condition="code_import/rcs_type/enumvalue:BZR_SVN">
<p id="svn-import-details">
This branch is an import of the
<span tal:attributes="title code_import/rcs_type/title">Subversion</span>
=== modified file 'lib/lp/codehosting/codeimport/foreigntree.py'
--- lib/lp/codehosting/codeimport/foreigntree.py 2011-08-24 14:24:06 +0000
+++ lib/lp/codehosting/codeimport/foreigntree.py 2014-02-24 07:35:22 +0000
@@ -1,17 +1,14 @@
# Copyright 2009 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
-"""Support for CVS and Subversion branches."""
+"""Support for CVS branches."""
__metaclass__ = type
-__all__ = ['CVSWorkingTree', 'SubversionWorkingTree']
+__all__ = ['CVSWorkingTree']
import os
import CVS
-import subvertpy
-import subvertpy.client
-import subvertpy.ra
class CVSWorkingTree:
@@ -39,37 +36,3 @@
def update(self):
tree = CVS.tree(self.local_path)
tree.update()
-
-
-class SubversionWorkingTree:
- """Represents a Subversion working tree."""
-
- def __init__(self, url, path):
- """Construct a `SubversionWorkingTree`.
-
- :param url: The URL of the branch for this tree.
- :param path: The path to the working tree.
- """
- self.remote_url = url
- self.local_path = path
-
- def _get_client(self):
- username_provider = subvertpy.ra.get_username_provider()
- auth = subvertpy.ra.Auth([username_provider])
- auth.set_parameter(subvertpy.AUTH_PARAM_DEFAULT_USERNAME, "lptest2")
- return subvertpy.client.Client(auth=auth)
-
- def checkout(self):
- client = self._get_client()
- client.checkout(
- self.remote_url, self.local_path, rev="HEAD",
- ignore_externals=True)
-
- def commit(self):
- client = self._get_client()
- client.log_msg_func = lambda c: 'Log message'
- client.commit([self.local_path], recurse=True)
-
- def update(self):
- client = self._get_client()
- client.update(self.local_path, "HEAD", True, True)
=== modified file 'lib/lp/codehosting/codeimport/tests/test_foreigntree.py'
--- lib/lp/codehosting/codeimport/tests/test_foreigntree.py 2012-01-01 02:58:52 +0000
+++ lib/lp/codehosting/codeimport/tests/test_foreigntree.py 2014-02-24 07:35:22 +0000
@@ -10,104 +10,12 @@
from bzrlib.tests import TestCaseWithTransport
import CVS
-import subvertpy.client
-import subvertpy.ra
-import subvertpy.wc
-from lp.codehosting.codeimport.foreigntree import (
- CVSWorkingTree,
- SubversionWorkingTree,
- )
-from lp.codehosting.codeimport.tests.servers import (
- CVSServer,
- SubversionServer,
- )
+from lp.codehosting.codeimport.foreigntree import CVSWorkingTree
+from lp.codehosting.codeimport.tests.servers import CVSServer
from lp.testing.layers import BaseLayer
-class TestSubversionWorkingTree(TestCaseWithTransport):
-
- layer = BaseLayer
-
- def assertIsUpToDate(self, original_url, new_path):
- """Assert that a Subversion working tree is up to date.
-
- :param original_url: The URL of the Subversion branch.
- :param new_path: The path of the checkout.
- """
- working_copy = subvertpy.wc.WorkingCopy(None, new_path)
- entry = working_copy.entry(new_path)
-
- remote = subvertpy.ra.RemoteAccess(original_url)
- self.assertEqual(original_url, entry.url)
- self.assertEqual(entry.revision, remote.get_latest_revnum())
-
- def setUp(self):
- super(TestSubversionWorkingTree, self).setUp()
- svn_server = SubversionServer('repository_path')
- svn_server.start_server()
- self.addCleanup(svn_server.stop_server)
- self.svn_branch_url = svn_server.makeBranch(
- 'trunk', [('README', 'original')])
-
- def test_path(self):
- # The local path is passed to the constructor is available as
- # 'local_path'.
- tree = SubversionWorkingTree('url', 'path')
- self.assertEqual(tree.local_path, 'path')
-
- def test_url(self):
- # The URL of the repository is available as 'remote_url'.
- tree = SubversionWorkingTree('url', 'path')
- self.assertEqual(tree.remote_url, 'url')
-
- def test_checkout(self):
- # checkout() checks out an up-to-date working tree to the local path.
- tree = SubversionWorkingTree(self.svn_branch_url, 'tree')
- tree.checkout()
- self.assertIsUpToDate(self.svn_branch_url, tree.local_path)
-
- def test_update(self):
- # update() fetches any changes to the branch from the remote branch.
- # We test this by checking out the same branch twice, making
- # modifications in one, then updating the other. If the modifications
- # appear, then update() works.
- tree = SubversionWorkingTree(self.svn_branch_url, 'tree')
- tree.checkout()
-
- tree2 = SubversionWorkingTree(self.svn_branch_url, 'tree2')
- tree2.checkout()
-
- # Make a change.
- # XXX: JonathanLange 2008-02-19: "README" is a mystery guest.
- new_content = 'Comfort ye\n'
- self.build_tree_contents([('tree/README', new_content)])
- tree.commit()
-
- tree2.update()
- readme_path = os.path.join(tree2.local_path, 'README')
- self.assertFileEqual(new_content, readme_path)
-
- def test_update_ignores_externals(self):
- # update() ignores svn:externals.
- # We test this in a similar way to test_update, by getting two trees,
- # mutating one and checking its effect on the other tree -- though
- # here we are hoping for no effect.
- tree = SubversionWorkingTree(self.svn_branch_url, 'tree')
- tree.checkout()
-
- tree2 = SubversionWorkingTree(self.svn_branch_url, 'tree2')
- tree2.checkout()
-
- client = subvertpy.client.Client()
- client.propset(
- 'svn:externals', 'external http://foo.invalid/svn/something',
- tree.local_path)
- tree.commit()
-
- tree2.update()
-
-
class TestCVSWorkingTree(TestCaseWithTransport):
layer = BaseLayer
=== modified file 'lib/lp/codehosting/codeimport/tests/test_worker.py'
--- lib/lp/codehosting/codeimport/tests/test_worker.py 2012-10-09 00:09:15 +0000
+++ lib/lp/codehosting/codeimport/tests/test_worker.py 2014-02-24 07:35:22 +0000
@@ -556,17 +556,6 @@
store._getForeignTree = _getForeignTree
return store
- def test_getForeignTreeSubversion(self):
- # _getForeignTree() returns a Subversion working tree for Subversion
- # code imports.
- source_details = self.factory.makeCodeImportSourceDetails(
- rcstype='svn')
- store = self.makeForeignTreeStore(source_details)
- working_tree = store._getForeignTree('path')
- self.assertIsSameRealPath(working_tree.local_path, 'path')
- self.assertEqual(
- working_tree.remote_url, source_details.url)
-
def test_getForeignTreeCVS(self):
# _getForeignTree() returns a CVS working tree for CVS code imports.
source_details = self.factory.makeCodeImportSourceDetails(
@@ -1013,17 +1002,6 @@
stacked_on_url=stacked_on_url)
-class TestSubversionImport(WorkerTest, SubversionImportHelpers,
- CSCVSActualImportMixin):
- """Tests for the worker importing and syncing a Subversion branch."""
-
- rcstype = 'svn'
-
- def setUp(self):
- WorkerTest.setUp(self)
- self.setUpImport()
-
-
class PullingImportWorkerTests:
"""Tests for the PullingImportWorker subclasses."""
@@ -1435,13 +1413,13 @@
':pserver:foo@xxxxxxxxxxx/bar', 'bar'],
arguments)
- def test_svn_arguments(self):
+ def test_bzr_svn_arguments(self):
code_import = self.factory.makeCodeImport(
svn_branch_url='svn://svn.example.com/trunk')
arguments = CodeImportSourceDetails.fromCodeImport(
code_import).asArguments()
self.assertEquals([
- str(code_import.branch.id), 'svn',
+ str(code_import.branch.id), 'bzr-svn',
'svn://svn.example.com/trunk'],
arguments)
=== modified file 'lib/lp/codehosting/codeimport/worker.py'
--- lib/lp/codehosting/codeimport/worker.py 2012-10-19 00:33:34 +0000
+++ lib/lp/codehosting/codeimport/worker.py 2014-02-24 07:35:22 +0000
@@ -67,10 +67,7 @@
branch_id_alias,
compose_public_url,
)
-from lp.codehosting.codeimport.foreigntree import (
- CVSWorkingTree,
- SubversionWorkingTree,
- )
+from lp.codehosting.codeimport.foreigntree import CVSWorkingTree
from lp.codehosting.codeimport.tarball import (
create_tarball,
extract_tarball,
@@ -266,9 +263,9 @@
:ivar branch_id: The id of the branch associated to this code import, used
for locating the existing import and the foreign tree.
- :ivar rcstype: 'svn', 'cvs', 'git', 'bzr-svn', 'bzr' as appropriate.
- :ivar url: The branch URL if rcstype in ['svn', 'bzr-svn',
- 'git', 'bzr'], None otherwise.
+ :ivar rcstype: 'cvs', 'git', 'bzr-svn', 'bzr' as appropriate.
+ :ivar url: The branch URL if rcstype in ['bzr-svn', 'git', 'bzr'], None
+ otherwise.
:ivar cvs_root: The $CVSROOT if rcstype == 'cvs', None otherwise.
:ivar cvs_module: The CVS module if rcstype == 'cvs', None otherwise.
"""
@@ -287,7 +284,7 @@
"""Convert command line-style arguments to an instance."""
branch_id = int(arguments.pop(0))
rcstype = arguments.pop(0)
- if rcstype in ['svn', 'bzr-svn', 'git', 'bzr']:
+ if rcstype in ['bzr-svn', 'git', 'bzr']:
url = arguments.pop(0)
try:
stacked_on_url = arguments.pop(0)
@@ -312,11 +309,7 @@
stacked_on_url = compose_public_url('http', stacked_path)
else:
stacked_on_url = None
- if code_import.rcs_type == RevisionControlSystems.SVN:
- return cls(
- branch.id, 'svn', str(code_import.url),
- stacked_on_url=stacked_on_url)
- elif code_import.rcs_type == RevisionControlSystems.BZR_SVN:
+ if code_import.rcs_type == RevisionControlSystems.BZR_SVN:
return cls(
branch.id, 'bzr-svn', str(code_import.url),
stacked_on_url=stacked_on_url)
@@ -340,7 +333,7 @@
"""Return a list of arguments suitable for passing to a child process.
"""
result = [str(self.branch_id), self.rcstype]
- if self.rcstype in ['svn', 'bzr-svn', 'git', 'bzr']:
+ if self.rcstype in ['bzr-svn', 'git', 'bzr']:
result.append(self.url)
if self.stacked_on_url is not None:
result.append(self.stacked_on_url)
@@ -458,10 +451,7 @@
def _getForeignTree(self, target_path):
"""Return a foreign tree object for `target_path`."""
source_details = self.import_data_store.source_details
- if source_details.rcstype == 'svn':
- return SubversionWorkingTree(
- source_details.url, str(target_path))
- elif source_details.rcstype == 'cvs':
+ if source_details.rcstype == 'cvs':
return CVSWorkingTree(
source_details.cvs_root, source_details.cvs_module,
target_path)
@@ -613,7 +603,7 @@
def getForeignTree(self):
"""Return the foreign branch object that we are importing from.
- :return: A `SubversionWorkingTree` or a `CVSWorkingTree`.
+ :return: A `CVSWorkingTree`.
"""
if os.path.isdir(self.FOREIGN_WORKING_TREE_PATH):
shutil.rmtree(self.FOREIGN_WORKING_TREE_PATH)
@@ -623,7 +613,7 @@
def importToBazaar(self, foreign_tree, bazaar_branch):
"""Actually import `foreign_tree` into `bazaar_branch`.
- :param foreign_tree: A `SubversionWorkingTree` or a `CVSWorkingTree`.
+ :param foreign_tree: A `CVSWorkingTree`.
:param bazaar_tree: A `bzrlib.branch.Branch`, which must have a
colocated working tree.
"""
=== modified file 'lib/lp/testing/factory.py'
--- lib/lp/testing/factory.py 2014-01-17 06:59:22 +0000
+++ lib/lp/testing/factory.py 2014-02-24 07:35:22 +0000
@@ -490,8 +490,8 @@
if branch_id is None:
branch_id = self.getUniqueInteger()
if rcstype is None:
- rcstype = 'svn'
- if rcstype in ['svn', 'bzr-svn', 'bzr']:
+ rcstype = 'bzr-svn'
+ if rcstype in ['bzr-svn', 'bzr']:
assert cvs_root is cvs_module is None
if url is None:
url = self.getUniqueURL()
@@ -2237,13 +2237,10 @@
code_import_set = getUtility(ICodeImportSet)
if svn_branch_url is not None:
- if rcs_type is None:
- rcs_type = RevisionControlSystems.SVN
- else:
- assert rcs_type in (RevisionControlSystems.SVN,
- RevisionControlSystems.BZR_SVN)
+ assert rcs_type in (None, RevisionControlSystems.BZR_SVN)
return code_import_set.new(
- registrant, target, branch_name, rcs_type=rcs_type,
+ registrant, target, branch_name,
+ rcs_type=RevisionControlSystems.BZR_SVN,
url=svn_branch_url, review_status=review_status)
elif git_repo_url is not None:
assert rcs_type in (None, RevisionControlSystems.GIT)
=== modified file 'scripts/code-import-worker.py'
--- scripts/code-import-worker.py 2013-01-07 02:40:55 +0000
+++ scripts/code-import-worker.py 2014-02-24 07:35:22 +0000
@@ -77,7 +77,7 @@
import_worker_cls = BzrSvnImportWorker
elif source_details.rcstype == 'bzr':
import_worker_cls = BzrImportWorker
- elif source_details.rcstype in ['cvs', 'svn']:
+ elif source_details.rcstype == 'cvs':
import_worker_cls = CSCVSImportWorker
else:
raise AssertionError(
Follow ups